]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - stand/i386/gptzfsboot/Makefile
contrib/tzdata: import tzdata 2021c
[FreeBSD/FreeBSD.git] / stand / i386 / gptzfsboot / Makefile
1 # $FreeBSD$
2
3 .include <bsd.init.mk>
4
5 .PATH:          ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
6                 ${BOOTSRC}/i386/zfsboot ${BOOTSRC}/i386/common \
7                 ${BOOTSRC}/common
8
9 FILES=          gptzfsboot
10 MAN=            gptzfsboot.8
11
12 BOOT_COMCONSOLE_PORT?= 0x3f8
13 BOOT_COMCONSOLE_SPEED?= 9600
14 B2SIOFMT?=      0x3
15
16 REL1=   0x700
17 ORG1=   0x7c00
18 ORG2=   0x0
19
20 CFLAGS+=-DBOOTPROG=\"gptzfsboot\" \
21         -O1 \
22         -DBOOT2 \
23         -DLOADER_GPT_SUPPORT \
24         -DLOADER_MBR_SUPPORT \
25         -DLOADER_ZFS_SUPPORT \
26         -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
27         -DSIOFMT=${B2SIOFMT} \
28         -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
29         -I${LDRSRC} \
30         -I${BOOTSRC}/i386/common \
31         -I${BOOTSRC}/i386/libi386 \
32         -I${ZFSSRC} \
33         -I${SYSDIR}/crypto/skein \
34         -I${SYSDIR}/cddl/boot/zfs \
35         -I${SYSDIR}/contrib/openzfs/include \
36         -I${SYSDIR}/contrib/openzfs/include/os/freebsd/spl \
37         -I${SYSDIR}/contrib/openzfs/include/os/freebsd/zfs \
38         -I${SYSDIR}/cddl/contrib/opensolaris/common/lz4 \
39         -I${BOOTSRC}/i386/btx/lib \
40         -I${BOOTSRC}/i386/boot2 \
41         -DHAVE_MEMCPY -I${SRCTOP}/sys/contrib/zlib \
42         -Wall -Waggregate-return -Wbad-function-cast \
43         -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
44         -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
45         -Wno-pointer-sign
46
47 CFLAGS.clang+=  -Wno-tentative-definition-incomplete-type
48
49 NO_WCAST_ALIGN=
50
51 CFLAGS.gcc+=    --param max-inline-insns-single=100
52
53 LD_FLAGS+=${LD_FLAGS_BIN}
54
55 CLEANFILES+=    gptzfsboot
56
57 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
58         btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
59             -o ${.TARGET} gptzfsboot.bin
60
61 CLEANFILES+=    gptldr.bin gptldr.out gptldr.o
62
63 gptldr.bin: gptldr.out
64         ${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
65
66 gptldr.out: gptldr.o
67         ${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o
68
69 OBJS=   zfsboot.o sio.o cons.o bcache.o devopen.o disk.o part.o zfs_cmd.o misc.o
70 CLEANFILES+=    gptzfsboot.bin gptzfsboot.out ${OBJS} ${OPENCRYPTO_XTS}
71
72 # i386 standalone support library
73 LIBI386=        ${BOOTOBJ}/i386/libi386/libi386.a
74
75 gptzfsboot.bin: gptzfsboot.out
76         ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET}
77
78 gptzfsboot.out: ${BTXCRT} ${OBJS} \
79         ${OPENCRYPTO_XTS}
80         ${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBI386} ${LIBSA32}
81
82 zfsboot.o: ${ZFSSRC}/zfsimpl.c
83
84 .include <bsd.prog.mk>