Makefile.bootfloppy revision 1.7
1#	$NetBSD: Makefile.bootfloppy,v 1.7 2002/04/16 05:23:40 lukem Exp $
2#
3# Makefile snippet to create a set of USTAR floppies
4#
5
6.include <bsd.own.mk>
7.include "${_SRC_TOP_}/distrib/Makefile.inc"
8
9#
10# Required variables:
11#	_SRC_TOP_	Top level of src tree (set by <bsd.own.mk>)
12#	FLOPPYBASE	Basename of floppies. Floppy number ${n} will
13#			be generated as ${FLOPPYBASE}${n}.fs
14#	FLOPPYKERNEL	Kernel to copy 
15#	FLOPPYKERNDIR	${FLOPPYKERNEL} is from ${.CURDIR}/../${FLOPPYKERNDIR}
16
17#
18# Optional variables:
19#	FLOPPYSIZE	Size of floppy in 512 byte blocks.	[2880]
20#	FLOPPYMAX	Maximum number of floppies to build.	[1]
21#			If 1, final image is installed as ${FLOPPYBASE}.fs
22#	FLOPPYBOOTCODE	Boot blocks to use.  [${DESTDIR}/usr/mdec/biosboot.sym]
23#	FLOPPYMETA	ustar metafile (written between "boot" & "netbsd")
24#	FLOPPYPAD	If defined, pad the last floppy to ${FLOPPYSIZE}
25#
26
27FLOPPYSIZE?=	2880
28FLOPPYMAX?=	1
29FLOPPYBOOTCODE?=${DESTDIR}/usr/mdec/biosboot.sym
30FLOPPYFILES=	boot ${FLOPPYMETA} netbsd
31
32FLOPPYKERNOBJ!=	cd ${.CURDIR}/../${FLOPPYKERNDIR} && ${PRINTOBJDIR}
33
34boot: ${FLOPPYBOOTCODE}
35	@echo "Copying ${FLOPPYBOOTCODE} to boot"
36	@rm -f boot
37	@cp ${FLOPPYBOOTCODE} boot
38	@${STRIP} boot
39
40netbsd: ${FLOPPYKERNOBJ}/${FLOPPYKERNEL}
41	@echo "Copying ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} to netbsd"
42	@rm -f netbsd
43	@cp ${FLOPPYKERNOBJ}/${FLOPPYKERNEL} netbsd
44
45.if defined(FLOPPYMETA)
46${FLOPPYMETA}:
47	echo "Creating ${FLOPPYMETA}"
48	@rm -f ${FLOPPYMETA}
49	@touch ${FLOPPYMETA}
50.endif
51
52${FLOPPYBASE}1.fs: ${FLOPPYFILES}
53	@echo "Creating ${FLOPPYBASE}1.fs from ${FLOPPYFILES}
54#		XXXDISTRIB; need MI installboot for i386
55	sh ${DISTRIBDIR}/common/buildfloppies.sh \
56	    -i "${DESTDIR}/usr/mdec/installboot -b 17 -f ${FLOPPYBOOTCODE} @IMAGE@" \
57	    ${FLOPPYMAX:D-m "${FLOPPYMAX}"} ${FLOPPYPAD:D-p} \
58	    ${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
59
60CLEANFILES+=	${FLOPPYFILES} ${FLOPPYBASE}?.fs
61
62
63realall: ${FLOPPYBASE}1.fs
64
65release: check_RELEASEDIR .WAIT ${FLOPPYBASE}1.fs
66	-mkdir -p ${RELEASEDIR}/installation/floppy
67	if [ -e ${FLOPPYBASE}2.fs ]; then \
68		${RELINSTALL} ${FLOPPYBASE}?.fs \
69		    ${RELEASEDIR}/installation/floppy; \
70	else \
71		${RELINSTALL} ${FLOPPYBASE}1.fs \
72		    ${RELEASEDIR}/installation/floppy/${FLOPPYBASE}.fs; \
73	fi
74
75
76.include <bsd.prog.mk>
77