1 # $NetBSD: Makefile,v 1.3 1998/09/05 14:46:18 lukem Exp $ 2 3 TOP= ${.CURDIR}/.. 4 5 # This include just sets REV=XX 6 .include "${TOP}/Makefile.inc" 7 8 IMAGE= ramdisk-${REV}.fs 9 CBIN= rd_bin 10 11 TREE= mtree.conf 12 LISTS= list 13 CRUNCHCONF= ${CBIN}.conf 14 15 KERNEL= ${SRCSYSDIR}/arch/mvme68k/compile/RAMDISK/netbsd 16 17 MOUNT_POINT?= /mnt 18 # DEV/RDEV file system device, CDEV/RDEV vnconfig device 19 VND?= vnd0 20 VND_CDEV= /dev/${VND}c 21 VND_CRDEV= /dev/r${VND}c 22 23 # These are all the parameters for the root fs: (384K) 24 # NOTE: If you change NBLKS, you *must* also edit the 25 # rdroot entry in /etc/disktab 26 DISKTYPE= rdroot 27 NBLKS= 768 28 29 CLEANFILES= netbsd-rd ${IMAGE} 30 31 netbsd-rd: ${IMAGE} 32 cp ${KERNEL} netbsd-tmp 33 mdsetimage netbsd-tmp ${IMAGE} 34 -mv -f netbsd-tmp $@ 35 36 ${IMAGE}: ${TREE} ${LISTS} ${CBIN} 37 dd if=/dev/zero of=${IMAGE} count=${NBLKS} 38 vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE} 39 newfs -m 0 -o space -i 2048 ${VND_CRDEV} ${DISKTYPE} 40 mount ${VND_CDEV} ${MOUNT_POINT} 41 mtree -def ${.CURDIR}/${TREE} -p ${MOUNT_POINT}/ -u 42 TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \ 43 TARGDIR=${MOUNT_POINT} sh ${.CURDIR}/runlist.sh ${.CURDIR}/${LISTS} 44 @echo "" 45 @df -i ${MOUNT_POINT} 46 @echo "" 47 umount ${MOUNT_POINT} 48 vnconfig -u ${VND_CDEV} 49 50 unconfig: 51 -umount -f ${MOUNT_POINT} 52 -vnconfig -u ${VND_CDEV} 53 -/bin/rm -f ${IMAGE} 54 55 # Do not delete this if I change my mind and kill make... 56 .PRECIOUS: ${IMAGE} 57 58 CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms 59 CLEANFILES+= *.lo *_stub.o *_stub.c 60 61 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF} 62 crunchgen -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF} 63 64 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c 65 make -f ${CBIN}.mk all 66 67 # This is listed in rd_bin.conf but is built here. 68 ${CBIN} : libhack.o 69 70 # Use stubs to eliminate some large stuff from libc 71 HACKSRC=${TOP}/../utils/libhack 72 .include "${HACKSRC}/Makefile.inc" 73 74 clean cleandir distclean: 75 -rm -f a.out core *.core *.o 76 -rm -f ${CLEANFILES} 77 78 # Standard rules needed by the above... 79 .include <bsd.obj.mk> 80