190699Srobert# $FreeBSD$
290699Srobert
3125622SruPROG=	boot1.elf
4125622SruINTERNALPROG=
5139103SruNO_MAN=
6234898SmariusFILES?=	boot1
7125717SruSRCS=	_start.s boot1.c
8235207SmariusCLEANFILES=${FILES} boot1.aout
993605Stmm
10125622SruBOOTBLOCKBASE= 0x4000
1190699Srobert
12234898SmariusCFLAGS+=-mcmodel=medlow -Os -I${.CURDIR}/../../common
13208789SedLDFLAGS=-Ttext ${BOOTBLOCKBASE} -Wl,-N
1490699Srobert
15125622Sru# Construct boot1. sunlabel expects it to contain zeroed-out space for the
1693605Stmm# label, and to be of the correct size.
17235207Smarius${FILES}: boot1.aout
18234898Smarius	@set -- `ls -l boot1.aout`; x=$$((7680-$$5)); \
19234898Smarius	    echo "$$x bytes available"; test $$x -ge 0
2093605Stmm	dd if=/dev/zero of=${.TARGET} bs=512 count=16
2193605Stmm	dd if=boot1.aout of=${.TARGET} bs=512 oseek=1 conv=notrunc
2293605Stmm
23125622Sruboot1.aout: boot1.elf
24125622Sru	elf2aout -o ${.TARGET} ${.ALLSRC}
25125622Sru
26125622Sruboot1.o: ${.CURDIR}/../../common/ufsread.c
27125622Sru
2893605Stmm.include <bsd.prog.mk>
29