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 #
15
16 include $(SRC)/Makefile.master
17
18 CFLAGS= -O2
19 CPPFLAGS= -DSTAND -nostdinc -I../../../../include -I../../..
20 LOADER= zfsloader
21 NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
22 MAN=
23
24 # Set by zfsloader Makefile
25 CPPFLAGS += -DLOADER_ZFS_SUPPORT -I../../zfs
26 CPPFLAGS += -I../libi386
27 LIBZFSBOOT= ../../zfs/i386/libzfsboot.a
28 LIBI386= ../libi386/libi386.a
29
30 # loader.help build needs better awk
31 AWK= /usr/xpg4/bin/awk
32 LD= $(GNU_ROOT)/bin/gld
33 CC= $(GCC_ROOT)/bin/gcc
34 OBJCOPY= $(GNU_ROOT)/bin/gobjcopy
35 GSTRIP= $(GNU_ROOT)/bin/gstrip
36 ROOT_BOOT= $(ROOT)/boot
37 ROOT_BOOT_DEFAULTS= $(ROOT)/boot/defaults
38 ROOT_BOOT_FORTH= $(ROOT)/boot/forth
39 ROOT_BOOT_CONF= $(ROOT)/boot/conf.d
40 ROOTBOOTFILES=$(FILES:%=$(ROOT_BOOT)/%)
41 ROOTBOOTFORTH=$(FORTH:%=$(ROOT_BOOT_FORTH)/%)
42 ROOTBOOTDEFAULTS=$(DEFFILES:%=$(ROOT_BOOT_DEFAULTS)/%)
43 FILEMODE=0444
44
45 all: machine x86 ${LOADER} loader.help
46
47 install: all $(ROOTBOOTLOADER)
48
49 PROG= ${LOADER}.sym
50 INTERNALPROG=
51
52 # architecture-specific loader code
53 SRCS= main.c conf.c vers.c chain.c
54
55 CPPFLAGS += -DLOADER_TFTP_SUPPORT -DLOADER_GZIP_SUPPORT
56
57 # Enable BootForth
58 CPPFLAGS += -DBOOT_FORTH -I$(SRC)/common/ficl -I../../ficl
59 LIBFICL= ../../ficl/i386/libficl.a
60
61 # Always add MI sources
62 SRCS += boot.c commands.c console.c devopen.c interp.c
63 SRCS += interp_backslash.c interp_parse.c ls.c misc.c
64 SRCS += module.c panic.c linenoise.c
65
127 FILES += loader.rc
128 FORTH += menu.rc
129
130 # XXX crt0.o needs to be first for pxeboot(8) to work
131
132 DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
133 LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
134
135 CLEANFILES += machine x86
136 CFLAGS += -DLOADER_PREFER_AMD64
137
138 machine:
139 $(RM) machine
140 $(SYMLINK) ../../../i386/include machine
141
142 x86:
143 $(RM) x86
144 $(SYMLINK) ../../../x86/include x86
145
146 OBJS= $(SRCS:%.c=%.o)
147
148 ${PROG}: ${OBJS} $(LDADD)
149 $(LD) $(LDFLAGS) -o $@ $(BTXCRT) $(OBJS) $(LDADD)
150
151 clean: clobber
152 clobber:
153 $(RM) $(CLEANFILES) $(OBJS)
154
155 install: all $(ROOT_BOOT_DEFAULTS) $(ROOT_BOOT_FORTH) \
156 $(ROOTBOOTFILES) $(ROOTBOOTDEFAULTS) $(ROOT_BOOT_CONF) $(ROOTBOOTFORTH)
157
158 %.o: ../../common/%.c
159 $(COMPILE.c) -o $@ $<
160
161 %.o: ../../common/linenoise/%.c
162 $(COMPILE.c) -o $@ $<
163
164 $(ROOT_BOOT)/%: ../../forth/%
165 $(INS.file)
166
|
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 CFLAGS= -O2
20 CPPFLAGS= -DSTAND -nostdinc -I../../../../include -I../../..
21 LOADER= zfsloader
22 NEWVERSWHAT= "ZFS enabled bootstrap loader" x86
23 MAN=
24
25 # Set by zfsloader Makefile
26 CPPFLAGS += -DLOADER_ZFS_SUPPORT -I../../zfs
27 CPPFLAGS += -I../libi386
28 LIBZFSBOOT= ../../zfs/i386/libzfsboot.a
29 LIBI386= ../libi386/libi386.a
30
31 # loader.help build needs better awk
32 AWK= /usr/xpg4/bin/awk
33 LD= $(GNU_ROOT)/bin/gld
34 CC= $(GCC_ROOT)/bin/gcc
35 OBJCOPY= $(GNU_ROOT)/bin/gobjcopy
36 GSTRIP= $(GNU_ROOT)/bin/gstrip
37 ROOT_BOOT= $(ROOT)/boot
38 ROOT_BOOT_DEFAULTS= $(ROOT)/boot/defaults
39 ROOT_BOOT_FORTH= $(ROOT)/boot/forth
40 ROOT_BOOT_CONF= $(ROOT)/boot/conf.d
41 ROOTBOOTFILES=$(FILES:%=$(ROOT_BOOT)/%)
42 ROOTBOOTFORTH=$(FORTH:%=$(ROOT_BOOT_FORTH)/%)
43 ROOTBOOTDEFAULTS=$(DEFFILES:%=$(ROOT_BOOT_DEFAULTS)/%)
44 FILEMODE=0444
45
46 all: ${LOADER} loader.help
47
48 install: all $(ROOTBOOTLOADER)
49
50 PROG= ${LOADER}.sym
51 INTERNALPROG=
52
53 # architecture-specific loader code
54 SRCS= main.c conf.c vers.c chain.c
55
56 CPPFLAGS += -DLOADER_TFTP_SUPPORT -DLOADER_GZIP_SUPPORT
57
58 # Enable BootForth
59 CPPFLAGS += -DBOOT_FORTH -I$(SRC)/common/ficl -I../../ficl
60 LIBFICL= ../../ficl/i386/libficl.a
61
62 # Always add MI sources
63 SRCS += boot.c commands.c console.c devopen.c interp.c
64 SRCS += interp_backslash.c interp_parse.c ls.c misc.c
65 SRCS += module.c panic.c linenoise.c
66
128 FILES += loader.rc
129 FORTH += menu.rc
130
131 # XXX crt0.o needs to be first for pxeboot(8) to work
132
133 DPADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
134 LDADD= ${LIBFICL} ${LIBZFSBOOT} ${LIBI386} ${LIBSTAND}
135
136 CLEANFILES += machine x86
137 CFLAGS += -DLOADER_PREFER_AMD64
138
139 machine:
140 $(RM) machine
141 $(SYMLINK) ../../../i386/include machine
142
143 x86:
144 $(RM) x86
145 $(SYMLINK) ../../../x86/include x86
146
147 OBJS= $(SRCS:%.c=%.o)
148
149 ${OBJS}: machine x86
150
151 ${PROG}: ${OBJS} $(LDADD)
152 $(LD) $(LDFLAGS) -o $@ $(BTXCRT) $(OBJS) $(LDADD)
153
154 clean: clobber
155 clobber:
156 $(RM) $(CLEANFILES) $(OBJS)
157
158 install: all $(ROOT_BOOT_DEFAULTS) $(ROOT_BOOT_FORTH) \
159 $(ROOTBOOTFILES) $(ROOTBOOTDEFAULTS) $(ROOT_BOOT_CONF) $(ROOTBOOTFORTH)
160
161 %.o: ../../common/%.c
162 $(COMPILE.c) -o $@ $<
163
164 %.o: ../../common/linenoise/%.c
165 $(COMPILE.c) -o $@ $<
166
167 $(ROOT_BOOT)/%: ../../forth/%
168 $(INS.file)
169
|