1183863Snwhitehorn# $FreeBSD$
2183863Snwhitehorn
3256266SbdrewerySSP_CFLAGS=
4183863Snwhitehorn
5183863SnwhitehornPROG=           boot1.elf
6183863SnwhitehornNEWVERSWHAT=    "Open Firmware boot block" ${MACHINE_ARCH}
7183863SnwhitehornBINDIR?=        /boot
8183863SnwhitehornINSTALLFLAGS=   -b
9183863Snwhitehorn
10183863SnwhitehornFILES=		boot1.hfs
11232432SnwhitehornSRCS=		boot1.c ashldi3.c syncicache.c
12183863Snwhitehorn
13183863SnwhitehornINTERNALPROG=
14183863SnwhitehornNO_MAN=
15183863Snwhitehorn
16209920SnwhitehornCFLAGS= -ffreestanding -msoft-float -Os \
17232432Snwhitehorn	-I${.CURDIR}/../../common -I${.CURDIR}/../../../ \
18232432Snwhitehorn	-D_STANDALONE
19183863SnwhitehornLDFLAGS=-nostdlib -static -N
20183863Snwhitehorn
21183863Snwhitehorn.include "${.CURDIR}/../Makefile.inc"
22232432Snwhitehorn.PATH:  ${.CURDIR}/../../../libkern ${.CURDIR}/../../../../lib/libc/powerpc/gen ${.CURDIR}
23183863Snwhitehorn
24183863Snwhitehorn# The following inserts out objects into a template HFS 
25183863Snwhitehorn# created by generate-hfs.sh
26183863Snwhitehorn
27183863Snwhitehorn.include "${.CURDIR}/Makefile.hfs"
28183863Snwhitehorn
29183863Snwhitehornboot1.hfs: boot1.elf bootinfo.txt
30183863Snwhitehorn	echo ${.OBJDIR}
31183863Snwhitehorn	uudecode ${.CURDIR}/hfs.tmpl.bz2.uu
32183863Snwhitehorn	mv hfs.tmpl.bz2 ${.TARGET}.bz2
33183863Snwhitehorn	bzip2 -f -d ${.TARGET}.bz2
34183863Snwhitehorn	dd if=boot1.elf of=${.TARGET} seek=${BOOT1_OFFSET} conv=notrunc
35183863Snwhitehorn	dd if=${.CURDIR}/bootinfo.txt of=${.TARGET} seek=${BOOTINFO_OFFSET} \
36183863Snwhitehorn	    conv=notrunc
37183863Snwhitehorn
38183863SnwhitehornCLEANFILES= boot1.hfs
39183863Snwhitehorn
40183863Snwhitehornboot1.o: ${.CURDIR}/../../common/ufsread.c
41183863Snwhitehorn
42183863Snwhitehorn.include <bsd.prog.mk>
43183863Snwhitehorn
44