xref: /freebsd/stand/i386/isoboot/Makefile (revision 4722ceb7d53e76507c76e053caab6b6f7b24ecef)
17acb51f6SBenno Rice
27acb51f6SBenno Rice.include <bsd.init.mk>
37acb51f6SBenno Rice
47acb51f6SBenno Rice.PATH:		${BOOTSRC}/i386/boot2 ${BOOTSRC}/i386/gptboot \
57acb51f6SBenno Rice		${BOOTSRC}/i386/common ${SASRC}
67acb51f6SBenno Rice
77acb51f6SBenno RiceFILES=		isoboot
87acb51f6SBenno RiceMAN=		isoboot.8
97acb51f6SBenno Rice
107acb51f6SBenno RiceBOOT_COMCONSOLE_PORT?= 0x3f8
11*4722ceb7SEd MasteBOOT_COMCONSOLE_SPEED?= 115200
127acb51f6SBenno RiceB2SIOFMT?=	0x3
137acb51f6SBenno Rice
147acb51f6SBenno RiceREL1=	0x700
157acb51f6SBenno RiceORG1=	0x7c00
167acb51f6SBenno RiceORG2=	0x0
177acb51f6SBenno Rice
187acb51f6SBenno RiceISOBOOTSIZE?=	30720
197acb51f6SBenno Rice
207acb51f6SBenno RiceCFLAGS+=-DBOOTPROG=\"isoboot\" \
217acb51f6SBenno Rice	-O1 \
227acb51f6SBenno Rice	-DSIOPRT=${BOOT_COMCONSOLE_PORT} \
237acb51f6SBenno Rice	-DSIOFMT=${B2SIOFMT} \
247acb51f6SBenno Rice	-DSIOSPD=${BOOT_COMCONSOLE_SPEED} \
257acb51f6SBenno Rice	-I${LDRSRC} \
267acb51f6SBenno Rice	-I${BOOTSRC}/i386/common \
277acb51f6SBenno Rice	-I${BOOTSRC}/i386/boot2 \
287acb51f6SBenno Rice	-Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \
297acb51f6SBenno Rice	-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
307acb51f6SBenno Rice	-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
31c8c62548SAlex Richardson	-Wno-pointer-sign
327acb51f6SBenno Rice
337acb51f6SBenno RiceCFLAGS.gcc+=	--param max-inline-insns-single=100
347acb51f6SBenno RiceCFLAGS.clang+=  -Oz ${CLANG_OPT_SMALL}
357acb51f6SBenno Rice
367acb51f6SBenno RiceLD_FLAGS+=${LD_FLAGS_BIN}
377acb51f6SBenno Rice
387acb51f6SBenno RiceCLEANFILES+=	isoboot
397acb51f6SBenno Rice
407acb51f6SBenno Riceisoboot: gptldr.bin isoboot.bin ${BTXKERN}
417acb51f6SBenno Rice	btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l gptldr.bin \
427acb51f6SBenno Rice	    -o ${.TARGET} isoboot.bin
437acb51f6SBenno Rice	@set -- `ls -l ${.TARGET}`; x=$$((${ISOBOOTSIZE}-$$5)); \
447acb51f6SBenno Rice	    echo "$$x bytes available"; test $$x -ge 0
457acb51f6SBenno Rice
467acb51f6SBenno RiceCLEANFILES+=	gptldr.bin gptldr.out gptldr.o
477acb51f6SBenno Rice
487acb51f6SBenno Ricegptldr.bin: gptldr.out
497acb51f6SBenno Rice	${OBJCOPY} -S -O binary gptldr.out ${.TARGET}
507acb51f6SBenno Rice
517acb51f6SBenno Ricegptldr.out: gptldr.o
52a2037dbaSDimitry Andric	${LD} ${LD_FLAGS} -e start --defsym ORG=${ORG1} -T ${LDSCRIPT} -o ${.TARGET} gptldr.o
537acb51f6SBenno Rice
54ca251958SToomas SoomeCLEANFILES+=	isoboot.bin isoboot.out isoboot.o sio.o drv.o \
557acb51f6SBenno Rice		cons.o ${OPENCRYPTO_XTS}
567acb51f6SBenno Rice
577acb51f6SBenno Riceisoboot.bin: isoboot.out
587acb51f6SBenno Rice	${OBJCOPY} -S -O binary isoboot.out ${.TARGET}
597acb51f6SBenno Rice
60ca251958SToomas Soomeisoboot.out: ${BTXCRT} isoboot.o sio.o drv.o cons.o ${OPENCRYPTO_XTS}
61a2037dbaSDimitry Andric	${LD} ${LD_FLAGS} --defsym ORG=${ORG2} -T ${LDSCRIPT} -o ${.TARGET} ${.ALLSRC} ${LIBSA32}
627acb51f6SBenno Rice
637acb51f6SBenno Rice.include <bsd.prog.mk>
64