]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/gptzfsboot/Makefile
Need to include skein in the include path so we don't get this from
[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         -Winline -Wno-pointer-sign
41
42 NO_WCAST_ALIGN=
43
44 .if ${COMPILER_TYPE} == "clang" || \
45     (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201)
46 CFLAGS+=        -Wno-tentative-definition-incomplete-type
47 .endif
48
49 .if ${MACHINE} == "amd64"
50 LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
51 .else
52 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
53 .endif
54
55 CFLAGS.gcc+=    --param max-inline-insns-single=100
56
57 LD_FLAGS+=${LD_FLAGS_BIN}
58
59 CLEANFILES+=    gptzfsboot
60
61 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
62         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
63             -o ${.TARGET} gptzfsboot.bin
64
65 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
66
67 gptldr.bin: gptldr.out
68         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
69
70 gptldr.out: gptldr.o
71         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
72
73 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
74                 drv.o gpt.o ${OPENCRYPTO_XTS}
75
76 gptzfsboot.bin: gptzfsboot.out
77         ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
78
79 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \
80         ${OPENCRYPTO_XTS}
81         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
82
83 zfsboot.o: ${ZFSSRC}/zfsimpl.c
84
85 .include <bsd.prog.mk>
86
87 # XXX: clang integrated-as doesn't grok .codeNN directives yet
88 CFLAGS.gptldr.S=        ${CLANG_NO_IAS}