3 .PATH: ${.CURDIR}/../boot2 ${.CURDIR}/../gptboot \
4 ${.CURDIR}/../zfsboot ${.CURDIR}/../common \
5 ${.CURDIR}/../../common
11 BOOT_COMCONSOLE_PORT?= 0x3f8
12 BOOT_COMCONSOLE_SPEED?= 9600
19 CFLAGS= -DBOOTPROG=\"gptzfsboot\" \
21 -fno-guess-branch-probability \
22 -fomit-frame-pointer \
24 -mno-align-long-strings \
26 -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 \
28 -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
29 -DSIOFMT=${B2SIOFMT} \
30 -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
31 -I${.CURDIR}/../../common \
32 -I${.CURDIR}/../common \
33 -I${.CURDIR}/../../zfs \
34 -I${.CURDIR}/../../../cddl/boot/zfs \
35 -I${.CURDIR}/../btx/lib -I. \
36 -I${.CURDIR}/../boot2 \
37 -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \
38 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
39 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
40 -Winline --param max-inline-insns-single=100
42 LDFLAGS=-static -N --gc-sections
44 # Pick up ../Makefile.inc early.
45 .include <bsd.init.mk>
47 CLEANFILES= gptzfsboot
49 gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN}
50 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
51 -o ${.TARGET} gptzfsboot.bin
53 CLEANFILES+= gptldr.bin gptldr.out gptldr.o
55 gptldr.bin: gptldr.out
56 objcopy -S -O binary gptldr.out ${.TARGET}
59 ${LD} ${LDFLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o
61 CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o
63 gptzfsboot.bin: gptzfsboot.out
64 objcopy -S -O binary gptzfsboot.out ${.TARGET}
66 gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o util.o
67 ${LD} ${LDFLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND}
69 zfsboot.o: ${.CURDIR}/../../zfs/zfsimpl.c
71 .if ${MACHINE_ARCH} == "amd64"
72 beforedepend zfsboot.o: machine
75 ln -sf ${.CURDIR}/../../../i386/include machine
78 .include <bsd.prog.mk>