Home | History | Annotate | Line # | Download | only in common
Makefile.tarfloppy revision 1.3
      1  1.3  lukem #	$NetBSD: Makefile.tarfloppy,v 1.3 2002/04/26 15:50:28 lukem Exp $
      2  1.1  lukem #
      3  1.1  lukem # Makefile snippet to create a set of ustar floppies.
      4  1.1  lukem # Each floppy has an 8KB header, followed by part or all of the ustar archive.
      5  1.1  lukem #
      6  1.1  lukem 
      7  1.1  lukem #
      8  1.1  lukem # Required variables:
      9  1.3  lukem #	NETBSDSRCDIR	Top level of src tree (set by <bsd.own.mk>)
     10  1.1  lukem #	FLOPPYBASE	Basename of floppies. Floppy number ${n} will
     11  1.1  lukem #			be generated as ${FLOPPYBASE}${n}.fs
     12  1.1  lukem #	FLOPPYSIZE	Size of floppy in 512 byte blocks.
     13  1.1  lukem #	FLOPPYFILES	Files to write to floppy.
     14  1.1  lukem #			Usually set to "boot ${FLOPPYMETAFILE} netbsd"
     15  1.1  lukem #
     16  1.1  lukem 
     17  1.1  lukem #
     18  1.1  lukem # Optional variables:
     19  1.1  lukem #	FLOPPY_BOOT		Bootstrap to use as "boot".
     20  1.1  lukem #	FLOPPY_BOOT_STRIP	If yes, strip "boot" before use.
     21  1.1  lukem #	FLOPPY_NETBSD		Kernel to to use as "netbsd".
     22  1.1  lukem #
     23  1.1  lukem #	FLOPPYMAX	Maximum number of floppies to build.
     24  1.1  lukem #			If 1, final image is installed as ${FLOPPYBASE}.fs
     25  1.1  lukem #	FLOPPYMETAFILE	Ustar metafile (optional)
     26  1.1  lukem #	FLOPPYINSTBOOT	Installboot program to use.  ustar file is in @IMAGE@.
     27  1.1  lukem #	FLOPPYPAD	If defined, pad the last floppy to ${FLOPPYSIZE}
     28  1.1  lukem #	FLOPPYINSTDIR	Where to install release images.
     29  1.1  lukem #
     30  1.1  lukem 
     31  1.1  lukem 
     32  1.1  lukem .if defined(FLOPPY_BOOT)				# {
     33  1.1  lukem CLEANFILES+=	boot
     34  1.1  lukem boot: ${FLOPPY_BOOT}
     35  1.1  lukem 	@echo "Copying ${.ALLSRC} to boot"
     36  1.1  lukem 	@rm -f boot
     37  1.1  lukem 	@cp ${.ALLSRC} boot
     38  1.1  lukem .if defined(FLOPPY_BOOT_STRIP)
     39  1.1  lukem 	@${STRIP} boot
     40  1.1  lukem .endif
     41  1.1  lukem .endif	# FLOPPY_BOOT					# }
     42  1.1  lukem 
     43  1.1  lukem 
     44  1.1  lukem .if defined(FLOPPY_NETBSD)				# {
     45  1.1  lukem CLEANFILES+=	netbsd
     46  1.1  lukem netbsd: ${FLOPPY_NETBSD}
     47  1.1  lukem 	@echo "Copying ${.ALLSRC} to netbsd"
     48  1.1  lukem 	@rm -f netbsd
     49  1.1  lukem 	@cp ${.ALLSRC} netbsd
     50  1.1  lukem .endif	# FLOPPY_NETBSD					# }
     51  1.1  lukem 
     52  1.1  lukem 
     53  1.1  lukem .if defined(FLOPPYMETAFILE)				# {
     54  1.1  lukem CLEANFILES+=	${FLOPPYMETAFILE}
     55  1.1  lukem ${FLOPPYMETAFILE}:
     56  1.1  lukem 	@echo "Creating ${FLOPPYMETAFILE}"
     57  1.1  lukem 	@rm -f ${FLOPPYMETAFILE}
     58  1.1  lukem 	@touch ${FLOPPYMETAFILE}
     59  1.1  lukem .endif	# FLOPPYMETAFILE				# }
     60  1.1  lukem 
     61  1.1  lukem 
     62  1.1  lukem ${FLOPPYBASE}1.fs: ${FLOPPYFILES} ${DISTRIBDIR}/common/buildfloppies.sh
     63  1.1  lukem 	@echo "Creating ${FLOPPYBASE}1.fs from: ${FLOPPYFILES}"
     64  1.2  bjh21 	PAX=${PAX:Q} sh ${DISTRIBDIR}/common/buildfloppies.sh \
     65  1.2  bjh21 	    ${FLOPPYMAX:D-m ${FLOPPYMAX}} \
     66  1.1  lukem 	    ${FLOPPYINSTBOOT:D-i ${FLOPPYINSTBOOT}} ${FLOPPYPAD:D-p} \
     67  1.1  lukem 	    ${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
     68  1.1  lukem 
     69  1.1  lukem CLEANFILES+=	${FLOPPYBASE}?.fs
     70  1.1  lukem 
     71  1.1  lukem 
     72  1.1  lukem realall: ${FLOPPYBASE}1.fs
     73  1.1  lukem 
     74  1.1  lukem .if defined(FLOPPYINSTDIR)
     75  1.1  lukem release: check_RELEASEDIR .WAIT ${FLOPPYBASE}1.fs
     76  1.1  lukem 	-mkdir -p ${RELEASEDIR}/${FLOPPYINSTDIR}
     77  1.1  lukem 	if [ -e ${FLOPPYBASE}2.fs ]; then \
     78  1.1  lukem 		${RELINSTALL} ${FLOPPYBASE}?.fs \
     79  1.1  lukem 		    ${RELEASEDIR}/${FLOPPYINSTDIR}; \
     80  1.1  lukem 	else \
     81  1.1  lukem 		${RELINSTALL} ${FLOPPYBASE}1.fs \
     82  1.1  lukem 		    ${RELEASEDIR}/${FLOPPYINSTDIR}/${FLOPPYBASE}.fs; \
     83  1.1  lukem 	fi
     84  1.1  lukem .endif
     85