1# $FreeBSD$ 2 3HAVE_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 11FILES= gptzfsboot 12MAN= gptzfsboot.8 13 14NM?= nm 15 16BOOT_COMCONSOLE_PORT?= 0x3f8 17BOOT_COMCONSOLE_SPEED?= 9600 18B2SIOFMT?= 0x3 19 20REL1= 0x700 21ORG1= 0x7c00 22ORG2= 0x0 23 24CFLAGS+=-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 42CFLAGS.clang+= -Wno-tentative-definition-incomplete-type 43 44NO_WCAST_ALIGN= 45 46.if ${MACHINE} == "amd64" 47LIBZFSBOOT=${BOOTOBJ}/zfs32/libzfsboot.a 48.else 49LIBZFSBOOT=${BOOTOBJ}/zfs/libzfsboot.a 50.endif 51 52CFLAGS.gcc+= --param max-inline-insns-single=100 53 54LD_FLAGS+=${LD_FLAGS_BIN} 55 56CLEANFILES+= gptzfsboot 57 58gptzfsboot: gptldr.bin gptzfsboot.bin ${BTXKERN} 59 btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ 60 -o ${.TARGET} gptzfsboot.bin 61 62CLEANFILES+= gptldr.bin gptldr.out gptldr.o 63 64gptldr.bin: gptldr.out 65 ${OBJCOPY} -S -O binary gptldr.out ${.TARGET} 66 67gptldr.out: gptldr.o 68 ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o 69 70CLEANFILES+= gptzfsboot.bin gptzfsboot.out zfsboot.o sio.o cons.o \ 71 drv.o gpt.o ${OPENCRYPTO_XTS} 72 73gptzfsboot.bin: gptzfsboot.out 74 ${OBJCOPY} -S -O binary gptzfsboot.out ${.TARGET} 75 76gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ 77 ${OPENCRYPTO_XTS} 78 ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} 79 80zfsboot.o: ${ZFSSRC}/zfsimpl.c 81 82.include <bsd.prog.mk> 83 84# XXX: clang integrated-as doesn't grok .codeNN directives yet 85CFLAGS.gptldr.S= ${CLANG_NO_IAS} 86