Sync usage with man page.
[netbsd-mini2440.git] / distrib / bebox / floppies / bootfloppy-common / Makefile.inc
blob38d3354dc6b4ee9d88a5bf62234756c89d548911
1 #       $NetBSD: Makefile.inc,v 1.11 2009/04/03 22:36:34 perry Exp $
3 # TOP is assumed to be defined by Makefile including this one.
5 COMMONDIR=      ${TOP}/bootfloppy-common
7 .include <bsd.kernobj.mk>
8 .include <bsd.own.mk>
10 MOUNT_POINT?=   /mnt
11 VND?=           vnd0
12 VND_DEV=        /dev/${VND}a
13 VND_RDEV=       /dev/r${VND}a
14 VND_CDEV=       /dev/${VND}d
15 VND_CRDEV=      /dev/r${VND}d
16 IMAGE?=         xxx.fs
17 KERN?=          netbsd-xxx
18 MDEC=           ${DESTDIR}/usr/mdec
20 LISTS=          ${COMMONDIR}/list
22 RAMDISKDIR!=    cd $(.CURDIR)/../ramdisk && ${PRINTOBJDIR}
23 RAMDISK=        ${RAMDISKDIR}/ramdisk.fs
25 DISKTYPE?=      floppy3
26 DISKSIZE?=      2880
28 # Some reasonable values for the -i parameter to newfs are:
30 #   6144        1147k, 189 inodes free
31 #  16384        1159k,  93 inodes free
32 # 204800        1167k,  29 inodes free
33 INO_BYTES?=     204800
35 CLEANFILES+=    netbsd.ram.gz
37 all:    netbsd.ram.gz
38         dd if=/dev/zero of=${IMAGE} count=${DISKSIZE}
39         vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
40         disklabel -rw ${VND_CDEV} ${DISKTYPE}
41         newfs -B be -m 0 -o space -i ${INO_BYTES} -c 80 ${VND_RDEV} ${DISKTYPE}
42         mount ${VND_DEV} ${MOUNT_POINT}
43         TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
44             KERNOBJDIR=${KERNOBJDIR} TARGDIR=${MOUNT_POINT} ${HOST_SH} \
45             ${NETBSDSRCDIR}/distrib/common/runlist.sh ${LISTS}
46         @echo ""
47         @df -i ${MOUNT_POINT}
48         @echo ""
49         umount ${MOUNT_POINT}
50         vnconfig -u ${VND_CDEV}
52 unconfig:
53         -umount -f ${MOUNT_POINT}
54         -vnconfig -u ${VND_DEV}
55         -/bin/rm -f ${IMAGE}
57 netbsd.ram.gz: ${KERN} ${RAMDISK}
58         cp ${KERN} netbsd.tmp
59         ${TOOL_MDSETIMAGE} -v netbsd.tmp ${RAMDISK}
60         gzip -9nf netbsd.tmp
61         mv netbsd.tmp.gz ${.TARGET}
63 clean cleandir:
64         /bin/rm -f *.core ${IMAGE} ${CLEANFILES}
66 .include <bsd.obj.mk>
67 .include <bsd.subdir.mk>