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