]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/gptzfsboot/Makefile
Re-sync loader.mk and ficl.mk to where they should be
[FreeBSD/FreeBSD.git] / stand / i386 / gptzfsboot / Makefile
1 # $FreeBSD$
2
3 HAVE_GPT=       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}/cddl/boot/zfs \
34         -I${BOOTSRC}/i386/btx/lib \
35         -I${BOOTSRC}/i386/boot2 \
36         -Wall -Waggregate-return -Wbad-function-cast \
37         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
38         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
39         -Winline -Wno-pointer-sign
40
41 NO_WCAST_ALIGN=
42
43 .if ${COMPILER_TYPE} == "clang" || \
44     (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201)
45 CFLAGS+=        -Wno-tentative-definition-incomplete-type
46 .endif
47
48 .if ${MACHINE} == "amd64"
49 LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
50 .else
51 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
52 .endif
53
54 CFLAGS.gcc+=    --param max-inline-insns-single=100
55
56 LD_FLAGS+=${LD_FLAGS_BIN}
57
58 CLEANFILES+=    gptzfsboot
59
60 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
61         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
62             -o ${.TARGET} gptzfsboot.bin
63
64 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
65
66 gptldr.bin: gptldr.out
67         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
68
69 gptldr.out: gptldr.o
70         ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
71
72 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \
73                 drv.o gpt.o util.o ${OPENCRYPTO_XTS}
74
75 gptzfsboot.bin: gptzfsboot.out
76         ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
77
78 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o \
79         ${OPENCRYPTO_XTS}
80         ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32}
81
82 zfsboot.o: ${ZFSSRC}/zfsimpl.c
83
84 .include <bsd.prog.mk>
85
86 # XXX: clang integrated-as doesn't grok .codeNN directives yet
87 CFLAGS.gptldr.S=        ${CLANG_NO_IAS}