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 2016 Toomas Soome <tsoome@me.com>
14 #
15
16 include $(SRC)/Makefile.master
17
18 CC= $(GCC_ROOT)/bin/gcc
19
20 install:
21
22 SRCS += delay.c devicename.c devpath.c efi_console.c efi_driver_utils.c \
23 efichar.c efinet.c efipart.c efizfs.c env.c errno.c gfx_fb.c handles.c \
24 libefi.c pnglite.c wchar.c
25
26 OBJS= $(SRCS:%.c=%.o)
27
28 PNGLITE=$(SRC)/common/pnglite
29
30 CPPFLAGS= -D_STANDALONE -DEFI
31 CFLAGS = -Os
32
33 CPPFLAGS += -nostdinc -I. -I../../../../../include -I../../../..
34 CPPFLAGS += -I$(SRC)/common/ficl -I../../../libficl
35 CPPFLAGS += -I../../include
36 CPPFLAGS += -I../../include/${MACHINE}
37 CPPFLAGS += -I../../../../../lib/libstand
38 CPPFLAGS += -I../../../zfs
39 CPPFLAGS += -I../../../../cddl/boot/zfs
40 CPPFLAGS += -I../../../../../lib/libz
41 CPPFLAGS += -I$(PNGLITE)
42
43 # Pick up the bootstrap header for some interface items
44 CPPFLAGS += -I../../../common
45
46 # Handle FreeBSD specific %b and %D printf format specifiers
47 # CFLAGS+= ${FORMAT_EXTENSIONS}
48 # CFLAGS += -D__printf__=__freebsd_kprintf__
49
50 include ../../Makefile.inc
51
52 # For multiboot2.h, must be last, to avoid conflicts
53 CPPFLAGS += -I$(SRC)/uts/common
54
55 libefi.a: $(OBJS)
56 $(AR) $(ARFLAGS) $@ $(OBJS)
57
58 clean: clobber
59 clobber:
60 $(RM) $(CLEANFILES) $(OBJS) libefi.a
61
62 machine:
63 $(RM) machine
64 $(SYMLINK) ../../../../${MACHINE}/include machine
65
66 x86:
67 $(RM) x86
68 $(SYMLINK) ../../../../x86/include x86
69
70 %.o: ../%.c
71 $(COMPILE.c) $<
72
73 %.o: ../../../common/%.c
74 $(COMPILE.c) $<
75
76 %.o: $(PNGLITE)/%.c
77 $(COMPILE.c) $<