Drop main() prototype. Syncs with NetBSD-8
[minix.git] / distrib / common / Makefile.tarfloppy
blobfb88434cc9cff3af9d5ee8bc861fe4e8d95a99d6
1 #       $NetBSD: Makefile.tarfloppy,v 1.18 2014/08/05 15:40:58 apb Exp $
3 # Makefile snippet to create a set of ustar floppies.
4 # Each floppy has an 8KB header, followed by part or all of the ustar archive.
6 # Required variables:
7 #       NETBSDSRCDIR    Top level of src tree (set by <bsd.own.mk>)
8 #       FLOPPYBASE      Basename of floppies. Floppy number ${n} will
9 #                       be generated as ${FLOPPYBASE}${n}${FLOPPYSUFFIX}
10 #       FLOPPYSIZE      Size of floppy in 512 byte blocks.
11 #       FLOPPYFILES     Files to write to floppy.
12 #                       Usually set to "boot ${FLOPPYMETAFILE} netbsd"
14 # Optional variables:
15 #       FLOPPY_BOOT             Bootstrap to use as "boot".
16 #       FLOPPY_BOOT_STRIP       If yes, strip "boot" before use.
17 #       FLOPPY_NETBSD           Kernel to to use as "netbsd".
18 #       FLOPPYINSTBOOT          Installboot program to use.
19 #                               USTAR image file is in @IMAGE@.
20 #       FLOPPYMAX               Maximum number of floppies to build.
21 #                               If 1, the final image is installed as
22 #                               ${FLOPPYBASE}${FLOPPYSUFFIX} instead of
23 #                               ${FLOPPYBASE}1${FLOPPYSUFFIX}
24 #       FLOPPYMETAFILE          USTAR metafile(s) (optional)
25 #       FLOPPYPAD               If defined, pad the last floppy to ${FLOPPYSIZE}
26 #       FLOPPYSUFFIX            Suffix of created floppies.
27 #       FLOPPY_RELEASEDIR       Where to install release floppies.
30 .if !defined(_MAKEFILE_TARFLOPPY_)
31 _MAKEFILE_TARFLOPPY_=1
34 .if defined(FLOPPY_BOOT)                                # {
35 CLEANFILES+=    boot
36 boot: ${FLOPPY_BOOT}
37         ${_MKTARGET_CREATE} "(from: ${.ALLSRC})"
38         @rm -f boot
39         @cp ${.ALLSRC} boot
40 .if defined(FLOPPY_BOOT_STRIP)
41         @${STRIP} boot
42 .endif
43 .endif  # FLOPPY_BOOT                                   # }
45 .if defined(FLOPPY_BOOT_CFG)
46 CLEANFILES+=    boot.cfg
47 boot.cfg:       ${FLOPPY_BOOT_CFG}
48         ${_MKTARGET_CREATE} "(from: ${.ALLSRC})"
49         @rm -f ${.TARGET}
50         @cp ${.ALLSRC} ${.TARGET}
51 .endif  # FLOPPY_BOOT_CFG
53 .if defined(FLOPPY_NETBSD)                              # {
54 CLEANFILES+=    netbsd netbsd.tmp
55 .if ${FLOPPY_NETBSD:E}=="gz"
56 COPY_CMD=       gunzip -c ${.ALLSRC} > ${.TARGET}.tmp
57 COMPRESS_CMD=   ${TOOL_GZIP_N} -9c ${.TARGET}.tmp > ${.TARGET}; \
58                 rm -f ${.TARGET}.tmp
59 .else
60 COPY_CMD=       cp ${.ALLSRC} ${.TARGET}.tmp
61 COMPRESS_CMD=   mv -f ${.TARGET}.tmp ${.TARGET}
62 .endif
63 netbsd: ${FLOPPY_NETBSD}
64         ${_MKTARGET_CREATE} "(from: ${.ALLSRC})"
65         ${COPY_CMD}
66         ${STRIP} -R .comment -R .ident ${.TARGET}.tmp
67         ${COMPRESS_CMD}
68 .endif  # FLOPPY_NETBSD                                 # }
71 .if defined(FLOPPYMETAFILE)                             # {
72 CLEANFILES+=    ${FLOPPYMETAFILE}
73 ${FLOPPYMETAFILE}:
74         ${_MKTARGET_CREATE}
75         @rm -f ${FLOPPYMETAFILE}
76         @touch ${FLOPPYMETAFILE}
77 .endif  # FLOPPYMETAFILE                                # }
80 ${FLOPPYBASE}1${FLOPPYSUFFIX}: ${FLOPPYFILES} ${DISTRIBDIR}/common/buildfloppies.sh
81         ${_MKTARGET_CREATE} "(from: ${FLOPPYFILES})"
82         PAX=${TOOL_PAX:Q} ${HOST_SH} ${DISTRIBDIR}/common/buildfloppies.sh \
83             ${FLOPPYINSTBOOT:D-i ${FLOPPYINSTBOOT}} ${FLOPPYPAD:D-p} \
84             ${FLOPPYMAX:D-m ${FLOPPYMAX}} ${FLOPPYSUFFIX:D-s ${FLOPPYSUFFIX}} \
85             -N ${DESTDIR}/etc \
86             ${FLOPPYBASE} ${FLOPPYSIZE} ${FLOPPYFILES}
88 CLEANFILES+=    ${FLOPPYBASE}?${FLOPPYSUFFIX}
91 realall: ${FLOPPYBASE}1${FLOPPYSUFFIX}
93 .if defined(FLOPPY_RELEASEDIR)
94 release:: check_RELEASEDIR .WAIT ${FLOPPYBASE}1${FLOPPYSUFFIX}
95         if [ -e ${FLOPPYBASE}2${FLOPPYSUFFIX} ]; then \
96                 ${RELEASE_INSTALL} ${FLOPPYBASE}?${FLOPPYSUFFIX} \
97                     ${RELEASEDIR}/${RELEASEMACHINEDIR}/${FLOPPY_RELEASEDIR}; \
98         else \
99                 ${RELEASE_INSTALL} ${FLOPPYBASE}1${FLOPPYSUFFIX} \
100                     ${RELEASEDIR}/${RELEASEMACHINEDIR}/${FLOPPY_RELEASEDIR}/${FLOPPYBASE}${FLOPPYSUFFIX}; \
101         fi
102 .endif
105 .endif  # _MAKEFILE_TARFLOPPY_