1#         $NetBSD: Makefile,v 1.22 2014/08/05 15:40:58 apb Exp $
2
3.include <bsd.own.mk>
4.include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
5
6.include <bsd.kernobj.mk>
7
8# Stuff an arbitrary kernel onto a ustarfs boot floppy set.
9#
10# Optional variables available:
11#         FLOPPYKERNEL        Path to kernel to stuff onto the floppy.
12#                             [ ${KERNOBJDIR}/GENERIC/netbsd ]
13#
14#         FLOPPYBASE          Basename of floppies (written as "${FLOPPYBASE}N.fs")
15#                             [ "generic" ]
16#
17#         FLOPPYSIZE          Size of a floppy.  [ 2880 ]
18#
19#         FLOPPYMAX Maximum number of floppies allowed in the set.  [1]
20#
21FLOPPYKERNEL?=      ${KERNOBJDIR}/GENERIC/netbsd
22FLOPPYBASE?=        generic
23FLOPPYMAX?=         1
24
25FLOPPY_RELEASEDIR?= installation/misc
26
27.if defined(FLOPPYSIZE) && (${FLOPPYSIZE} != 2880)
28FLOPPYMETAFILE!=printf "USTAR.volsize.%o" ${FLOPPYSIZE}
29.else
30FLOPPYSIZE=         2880
31.endif
32
33FLOPPYFILES=        boot ${FLOPPYMETAFILE} netbsd
34
35MDEC=               ${DESTDIR}/usr/mdec
36KERNOBJ!= cd ${.CURDIR}/../instkernel && ${PRINTOBJDIR}
37FLOPPY_BOOT=        ${MDEC}/ustarboot
38FLOPPYINSTBOOT=     "${TOOL_INSTALLBOOT} -v -m ${MACHINE} -t raw -b 17 @IMAGE@ ${FLOPPY_BOOT}"
39
40netbsd: ${FLOPPYKERNEL}
41          @echo "Copying stripped and gzipped ${.ALLSRC} to ${.TARGET}"
42          @rm -f ${.TARGET} ${.TARGET}.tmp
43          cp ${.ALLSRC} ${.TARGET}.tmp
44          ${STRIP} ${.TARGET}.tmp
45          ${TOOL_GZIP_N} -9f ${.TARGET}.tmp
46          mv ${.TARGET}.tmp.gz ${.TARGET}
47
48CLEANFILES+=        netbsd netbsd.tmp netbsd.tmp.gz
49
50.include "${DISTRIBDIR}/common/Makefile.tarfloppy"
51
52.include <bsd.prog.mk>
53