1 #
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
6 #
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
10 #
11
12 #
13 # Copyright 2015 Toomas Soome <tsoome@me.com>
14 # Copyright 2016 RackTop Systems.
15 #
16
17 include $(SRC)/Makefile.master
18
19 CC= $(GCC_ROOT)/bin/gcc
20
21 LIB= efi
22
23 all: lib$(LIB).a
24
25 install:
26
27 SRCS= delay.c efi_console.c efinet.c efipart.c errno.c handles.c \
28 libefi.c time.c
29
30 OBJS= $(SRCS:%.c=%.o)
31
32 CPPFLAGS= -DTERM_EMU
33 CFLAGS = -O2
34
35 #.if ${MACHINE_CPUARCH} == "aarch64"
36 #CFLAGS+= -msoft-float -mgeneral-regs-only
37 #.endif
38 #.if ${MACHINE_ARCH} == "amd64"
39 CFLAGS += -fPIC
40 #.endif
41
42 CFLAGS += -nostdinc -I. -I../../../../include -I../../..
43 CFLAGS += -I../include
44 CFLAGS += -I../include/${MACH64}
45 CFLAGS += -I../../../../lib/libstand
46
47 # Pick up the bootstrap header for some interface items
48 CFLAGS += -I../../common
49
50 # Handle FreeBSD specific %b and %D printf format specifiers
51 # CFLAGS+= ${FORMAT_EXTENSIONS}
52 # CFLAGS += -D__printf__=__freebsd_kprintf__
53 CFLAGS+= -DTERM_EMU
54
55 include ../Makefile.inc
56
57 lib$(LIB).a: $(SRCS) $(OBJS)
58 $(AR) $(ARFLAGS) $@ $(OBJS)
59
60 clean: clobber
61 clobber:
62 $(RM) $(CLEANFILES) $(OBJS) machine x86 lib$(LIB).a
63
64 machine:
65 $(RM) machine
66 $(SYMLINK) ../../../amd64/include machine
67
68 x86:
69 $(RM) x86
70 $(SYMLINK) ../../../x86/include x86
71
72 $(OBJS): machine x86