1*7acb51f6SBenno Rice# $FreeBSD$ 2*7acb51f6SBenno Rice 3*7acb51f6SBenno RiceHAVE_GELI= yes 4*7acb51f6SBenno Rice 5*7acb51f6SBenno Rice.include <bsd.init.mk> 6*7acb51f6SBenno Rice 7*7acb51f6SBenno Rice.PATH: ${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \ 8*7acb51f6SBenno Rice ${BOOTSRC}/i386/common ${SASRC} 9*7acb51f6SBenno Rice 10*7acb51f6SBenno RiceFILES= isoboot 11*7acb51f6SBenno RiceMAN= isoboot.8 12*7acb51f6SBenno Rice 13*7acb51f6SBenno RiceNM?= nm 14*7acb51f6SBenno Rice 15*7acb51f6SBenno RiceBOOT_COMCONSOLE_PORT?= 0x3f8 16*7acb51f6SBenno RiceBOOT_COMCONSOLE_SPEED?= 9600 17*7acb51f6SBenno RiceB2SIOFMT?= 0x3 18*7acb51f6SBenno Rice 19*7acb51f6SBenno RiceREL1= 0x700 20*7acb51f6SBenno RiceORG1= 0x7c00 21*7acb51f6SBenno RiceORG2= 0x0 22*7acb51f6SBenno Rice 23*7acb51f6SBenno RiceISOBOOTSIZE?= 30720 24*7acb51f6SBenno Rice 25*7acb51f6SBenno RiceCFLAGS+=-DBOOTPROG=\"isoboot\" \ 26*7acb51f6SBenno Rice -O1 \ 27*7acb51f6SBenno Rice -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ 28*7acb51f6SBenno Rice -DSIOFMT=${B2SIOFMT} \ 29*7acb51f6SBenno Rice -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ 30*7acb51f6SBenno Rice -I${LDRSRC} \ 31*7acb51f6SBenno Rice -I${BOOTSRC}/i386/common \ 32*7acb51f6SBenno Rice -I${BOOTSRC}/i386/boot2 \ 33*7acb51f6SBenno Rice -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ 34*7acb51f6SBenno Rice -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ 35*7acb51f6SBenno Rice -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ 36*7acb51f6SBenno Rice -Winline -Wno-pointer-sign 37*7acb51f6SBenno Rice 38*7acb51f6SBenno RiceCFLAGS.gcc+= --param max-inline-insns-single=100 39*7acb51f6SBenno RiceCFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} 40*7acb51f6SBenno Rice 41*7acb51f6SBenno RiceLD_FLAGS+=${LD_FLAGS_BIN} 42*7acb51f6SBenno Rice 43*7acb51f6SBenno RiceCLEANFILES+= isoboot 44*7acb51f6SBenno Rice 45*7acb51f6SBenno Riceisoboot: gptldr.bin isoboot.bin ${BTXKERN} 46*7acb51f6SBenno Rice btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \ 47*7acb51f6SBenno Rice -o ${.TARGET} isoboot.bin 48*7acb51f6SBenno Rice @set -- `ls -l ${.TARGET}`; x=$$((${ISOBOOTSIZE}-$$5)); \ 49*7acb51f6SBenno Rice echo "$$x bytes available"; test $$x -ge 0 50*7acb51f6SBenno Rice 51*7acb51f6SBenno RiceCLEANFILES+= gptldr.bin gptldr.out gptldr.o 52*7acb51f6SBenno Rice 53*7acb51f6SBenno Ricegptldr.bin: gptldr.out 54*7acb51f6SBenno Rice ${OBJCOPY} -S -O binary gptldr.out ${.TARGET} 55*7acb51f6SBenno Rice 56*7acb51f6SBenno Ricegptldr.out: gptldr.o 57*7acb51f6SBenno Rice ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o 58*7acb51f6SBenno Rice 59*7acb51f6SBenno RiceCLEANFILES+= isoboot.bin isoboot.out isoboot.o sio.o crc32.o drv.o \ 60*7acb51f6SBenno Rice cons.o ${OPENCRYPTO_XTS} 61*7acb51f6SBenno Rice 62*7acb51f6SBenno Riceisoboot.bin: isoboot.out 63*7acb51f6SBenno Rice ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} 64*7acb51f6SBenno Rice 65*7acb51f6SBenno Riceisoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} 66*7acb51f6SBenno Rice ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} 67*7acb51f6SBenno Rice 68*7acb51f6SBenno Rice.include <bsd.prog.mk> 69