Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / distrib / bebox / floppies / ramdisk / Makefile
blobbce862a264e576b67b3c9cd26db0f36939d7dbf1
1 # $NetBSD: Makefile,v 1.12 2008/10/25 22:27:34 apb Exp $
3 TOP= ${.CURDIR}/..
5 .include "${TOP}/Makefile.inc"
6 IMAGE= ramdisk.fs
8 AUXTARGETS= install.sh upgrade.sh start.sh
9 AUXCLEAN= ${AUXTARGETS}
11 CBIN= ramdiskbin
13 MOUNT_POINT?= /mnt
14 # DEV/RDEV file system device, CDEV/RDEV vnconfig device
15 VND?= vnd0
16 VND_DEV= /dev/${VND}a
17 VND_RDEV= /dev/r${VND}a
18 VND_CDEV= /dev/${VND}d
19 VND_CRDEV= /dev/r${VND}d
20 IMAGE?= xxx.fs
21 MDEC= ${DESTDIR}/usr/mdec
23 LISTS= list
24 CRUNCHCONF= ${CBIN}.conf
25 MTREECONF= mtree.conf
27 DISKTYPE= floppy3
29 install.sh: install.tmpl
30 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.ALLSRC} > ${.TARGET}
32 upgrade.sh: upgrade.tmpl
33 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.ALLSRC} > ${.TARGET}
35 start.sh: start.tmpl
36 ${TOOL_SED} "s/@@VERSION@@/${DISTRIBVER}/" < ${.ALLSRC} > ${.TARGET}
38 all: ${AUXTARGETS} ${CBIN}
39 dd if=/dev/zero of=${IMAGE} count=3074
40 vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
41 disklabel -rw ${VND_CDEV} ${DISKTYPE}
42 newfs -B be -m 0 -o space -i 5120 -c 80 ${VND_RDEV} ${DISKTYPE}
43 mount ${VND_DEV} ${MOUNT_POINT}
44 ${TOOL_MTREE} -def ${.CURDIR}/${MTREECONF} -p ${MOUNT_POINT}/ -u
45 TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
46 KERNOBJDIR=${KERNOBJDIR} TARGDIR=${MOUNT_POINT} ${HOST_SH} \
47 ${NETBSDSRCDIR}/distrib/common/runlist.sh ${LISTS}
48 @echo ""
49 @df -i ${MOUNT_POINT}
50 @echo ""
51 umount ${MOUNT_POINT}
52 vnconfig -u ${VND_CDEV}
54 unconfig:
55 -umount -f ${MOUNT_POINT}
56 -vnconfig -u ${VND_DEV}
57 -/bin/rm -f ${IMAGE}
59 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
60 ${TOOL_CRUNCHGEN} -D ${TOP}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
62 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
63 ${MAKE} -f ${CBIN}.mk all
65 clean cleandir:
66 /bin/rm -f ${AUXCLEAN} *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.cro *.c
68 .include <bsd.obj.mk>
69 .include <bsd.subdir.mk>