7 .PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/common ${SASRC}
14 BOOT_COMCONSOLE_PORT?= 0x3f8
15 BOOT_COMCONSOLE_SPEED?= 9600
22 CFLAGS+=-DBOOTPROG=\"zfsboot\" \
25 -DSIOPRT=${BOOT_COMCONSOLE_PORT} \
26 -DSIOFMT=${B2SIOFMT} \
27 -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
29 -I${BOOTSRC}/i386/common \
32 -I${SYSDIR}/cddl/boot/zfs \
34 -I${BOOTSRC}/i386/boot2 \
35 -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
36 -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
37 -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
40 CFLAGS.gcc+= --param max-inline-insns-single=100
41 .if ${MACHINE} == "amd64"
42 LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a
44 LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a
47 LD_FLAGS+=${LD_FLAGS_BIN}
51 zfsboot: zfsboot1 zfsboot2
52 cat zfsboot1 zfsboot2 > zfsboot
54 CLEANFILES+= zfsboot1 zfsldr.out zfsldr.o
57 ${OBJCOPY} -S -O binary zfsldr.out ${.TARGET}
60 ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} zfsldr.o
62 CLEANFILES+= zfsboot2 zfsboot.ld zfsboot.ldr zfsboot.bin zfsboot.out \
63 zfsboot.o zfsboot.s zfsboot.s.tmp sio.o cons.o drv.o
65 # We currently allow 256k bytes for zfsboot - in practice it could be
66 # any size up to 3.5Mb but keeping it fixed size simplifies zfsldr.
71 @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \
72 echo "$$x bytes available"; test $$x -ge 0
73 ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync
75 zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN}
76 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \
77 -o ${.TARGET} -P 1 zfsboot.bin
80 cp /dev/null ${.TARGET}
82 zfsboot.bin: zfsboot.out
83 ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET}
85 zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o
86 ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32}
90 .include <bsd.prog.mk>
92 # XXX: clang integrated-as doesn't grok .codeNN directives yet
93 CFLAGS.zfsldr.S= ${CLANG_NO_IAS}