1# $NetBSD: Makefile,v 1.8 2003/07/10 10:34:06 lukem Exp $ 2 3TOP= ${.CURDIR}/.. 4WARNS=1 5DBG= -Os 6 7.include "${TOP}/Makefile.inc" 8IMAGE= ramdisk.fs 9 10CBIN= ramdiskbin 11 12MOUNT_POINT?= /mnt 13# DEV/RDEV file system device, CDEV/RDEV vnconfig device 14VND?= vnd0 15VND_DEV= /dev/${VND}a 16VND_RDEV= /dev/r${VND}a 17VND_CDEV= /dev/${VND}d 18VND_CRDEV= /dev/r${VND}d 19IMAGE?= xxx.fs 20MDEC= ${DESTDIR}/usr/mdec 21 22DISKLABEL?= disklabel 23MOUNT?= mount 24NEWFS?= newfs 25UMOUNT?= umount 26VNCONFIG?= vnconfig 27 28LISTS= ${.CURDIR}/../ramdiskcommon/list 29CRUNCHCONF= ../ramdiskcommon/${CBIN}.conf 30MTREECONF= ../ramdiskcommon/mtree.conf 31 32RAMDISKSPC= 128 33RAMDISKCYLS= 54 34RAMDISKSIZE!= expr ${RAMDISKSPC} \* ${RAMDISKCYLS} 35 36realall: ${IMAGE} 37 38${IMAGE}: ${CBIN} ${MTREECONF} ${LISTS} 39 rm -f ${IMAGE}.tmp 40 dd if=/dev/zero of=${IMAGE}.tmp count=${RAMDISKSIZE} 41 ${VNCONFIG} -v -c ${VND_CDEV} ${IMAGE}.tmp \ 42 512/${RAMDISKSPC}/1/${RAMDISKCYLS} 43 -${DISKLABEL} ${VND_CDEV} >tmplabel 44 ${DISKLABEL} -r -R ${VND_CDEV} tmplabel 45 ${NEWFS} -B le -m 0 -o space ${VND_RDEV} 46 ${MOUNT} ${VND_DEV} ${MOUNT_POINT} 47 ${TOOL_MTREE} -def ${.CURDIR}/${MTREECONF} -p ${MOUNT_POINT}/ -U 48 TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ 49 KERNOBJDIR=${KERNOBJDIR} TARGDIR=${MOUNT_POINT} ${HOST_SH} \ 50 ${NETBSDSRCDIR}/distrib/common/runlist.sh ${LISTS} 51 @echo "" 52 @df -i ${MOUNT_POINT} 53 @echo "" 54 ${UMOUNT} ${MOUNT_POINT} 55 ${VNCONFIG} -u ${VND_CDEV} 56 mv -f ${IMAGE}.tmp ${IMAGE} 57 58unconfig: 59 -${UMOUNT} -f ${MOUNT_POINT} 60 -${VNCONFIG} -u ${VND_DEV} 61 -/bin/rm -f ${IMAGE}.tmp 62 63${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} 64 ${TOOL_CRUNCHGEN} -D ${TOP}/../../.. -L ${.CURDIR} ${.ALLSRC} 65 66${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c 67 ${MAKE} -f ${CBIN}.mk all 68 69# Use stubs to eliminate some large stuff from libc 70HACKSRC= ${DISTRIBDIR}/utils/libhack 71HACKOBJS= gethost.o 72.include "${HACKSRC}/Makefile.inc" 73${CBIN}: libhack.o 74 75mount: 76 ${VNCONFIG} -v -c ${VND_CDEV} ${IMAGE} \ 77 512/${RAMDISKSPC}/1/${RAMDISKCYLS} 78 ${MOUNT} ${VND_DEV} ${MOUNT_POINT} 79 80clean cleandir distclean: 81 /bin/rm -f ${AUXCLEAN} *.core ${IMAGE} ${IMAGE}.tmp ${CBIN} \ 82 ${CBIN}.mk ${CBIN}.cache *.o *.cro *.c tmplabel 83 84.include <bsd.own.mk> 85.include <bsd.obj.mk> 86.include <bsd.subdir.mk> 87.include <bsd.sys.mk> 88