1 # $NetBSD: Makefile,v 1.10 1999/05/18 07:31:56 gwr Exp $ 2 3 TOP= ${.CURDIR}/.. 4 5 # This include just sets REV=XX 6 .include "${TOP}/Makefile.inc" 7 8 IMAGE= ramdisk 9 CBIN= rd_bin 10 11 TREE= ${TOP}/common/${IMAGE}.tree 12 13 LISTS= ${TOP}/common/${CBIN}.list \ 14 ${TOP}/common/${IMAGE}.list 15 16 KERNEL3 = ${KERNOBJDIR}/RAMDISK/netbsd 17 KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/netbsd 18 19 MOUNT_POINT?= /mnt 20 BDEV?= /dev/sd1b 21 CDEV?= /dev/rsd1b 22 23 # These are all the parameters for the root fs: (320K) 24 DISKTYPE= rdroot 25 NBLKS= 640 26 # bigendian, old format, minfree, opt, b/i trks, sects, cpg 27 NEWFSARGS= -B be -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16 28 29 CLEANFILES= netbsd-rd.sun3 netbsd-rd.sun3x rdsetroot ${IMAGE}.fs 30 31 all: netbsd-rd.sun3 netbsd-rd.sun3x 32 33 netbsd-rd.sun3 : rdsetroot ${IMAGE}.fs 34 cp ${KERNEL3} netbsd-tmp 35 ./rdsetroot netbsd-tmp < ${IMAGE}.fs 36 -mv -f netbsd-tmp $@ 37 38 netbsd-rd.sun3x : rdsetroot ${IMAGE}.fs 39 cp ${KERNEL3X} netbsd-tmp 40 ./rdsetroot netbsd-tmp < ${IMAGE}.fs 41 -mv -f netbsd-tmp $@ 42 43 rdsetroot: ${TOP}/common/rdsetroot.c 44 $(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c 45 46 ${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN} 47 -newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE} 48 mount ${BDEV} ${MOUNT_POINT} 49 mtree -def ${TREE} -p ${MOUNT_POINT}/ -u 50 TOPDIR=${TOP} CURDIR=${.CURDIR} \ 51 OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \ 52 sh ${TOP}/common/RunList.sh ${LISTS} 53 sync 54 @echo "" 55 @df -i ${MOUNT_POINT} 56 @echo "" 57 -umount ${MOUNT_POINT} 58 dd if=${CDEV} of=$@ bs=16b \ 59 count=`expr ${NBLKS} / 16` 60 61 # Do not delete this if I change my mind and kill make... 62 .PRECIOUS: ${IMAGE}.fs 63 64 # Rules for making ${CBIN} ... 65 .include "${TOP}/common/Make.crunch" 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