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