]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/gptzfsboot/Makefile
MFC r335321, r335336: stand: move libgeliboot into libsa
[FreeBSD/FreeBSD.git] / stand / i386 / gptzfsboot / Makefile
1 # $FreeBSD$
2
3 HAVE_GELI=      yes
4
5 .include <bsd.init.mk>
6
7 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
8                 ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \
9                 ${SASRC}
10
11 FILES=          gptzfsboot
12 MAN=            gptzfsboot.8
13
14 NM?=            nm
15
16 BOOT_COMCONSOLE_PORT?= 0x3f8
17 BOOT_COMCONSOLE_SPEED?= 9600
18 B2SIOFMT?=      0x3
19
20 REL1=   0x700
21 ORG1=   0x7c00
22 ORG2=   0x0
23
24 CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
25         -O1 \
26         -DGPT -DZFS -DBOOT2 \
27         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
28         -DSIOFMT=${B2SIOFMT} \
29         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
30         -I${LDRSRC} \
31         -I${BOOTSRC}/i386/common \
32         -I${ZFSSRC} \
33         -I${SYSDIR}/crypto/skein \
34         -I${SYSDIR}/cddl/boot/zfs \
35         -I${BOOTSRC}/i386/btx/lib \
36         -I${BOOTSRC}/i386/boot2 \
37         -Wall -Waggregate-return -Wbad-function-cast \
38         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
39         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
40         -Wno-pointer-sign
41
42 CFLAGS.clang+=  -Wno-tentative-definition-incomplete-type
43
44 NO_WCAST_ALIGN=
45
46 .if ${MACHINE} == "amd64"
47 LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
48 .else
49 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
50 .endif
51
52 CFLAGS.gcc+=    --param max-inline-insns-single=100
53
54 LD_FLAGS+=${LD_FLAGS_BIN}
55
56 CLEANFILES+=    gptzfsboot
57
58 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
59         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
60             -o ${.TARGET} gptzfsboot.bin
61
62 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
63
64 gptldr.bin: gptldr.out
65         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
66
67 gptldr.out: gptldr.o
68         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
69
70 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
71                 drv.o gpt.o ${OPENCRYPTO_XTS}
72
73 gptzfsboot.bin: gptzfsboot.out
74         ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
75
76 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
77         ${OPENCRYPTO_XTS}
78         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32}
79
80 zfsboot.o: ${ZFSSRC}/zfsimpl.c
81
82 .include <bsd.prog.mk>
83
84 # XXX: clang integrated-as doesn't grok .codeNN directives yet
85 CFLAGS.gptldr.S=        ${CLANG_NO_IAS}