Home | History | Annotate | Line # | Download | only in ramdisk
Makefile revision 1.1
      1 #	$NetBSD: Makefile,v 1.1 1997/12/17 22:13:32 scw 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 	cat /*bin/* > /dev/null
     50 
     51 unconfig:
     52 	-umount -f ${MOUNT_POINT}     
     53 	-vnconfig -u ${VND_CDEV}      
     54 	-/bin/rm -f ${IMAGE}
     55 	cat /*bin/* > /dev/null
     56 
     57 # Do not delete this if I change my mind and kill make...
     58 .PRECIOUS: ${IMAGE}
     59 
     60 CLEANFILES+= ${CBIN} ${CBIN}.c ${CBIN}.cache ${CBIN}.mk ${CBIN}.syms
     61 CLEANFILES+= *.lo *_stub.o *_stub.c
     62 
     63 ${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
     64 	crunchgen -D ${BSDSRCDIR} -L ${DESTDIR}/usr/lib ${CRUNCHCONF}
     65 
     66 ${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
     67 	make -f ${CBIN}.mk all
     68 
     69 # This is listed in rd_bin.conf but is built here.
     70 ${CBIN} : libhack.o
     71 
     72 # Use stubs to eliminate some large stuff from libc
     73 HACKSRC=${TOP}/../utils/libhack
     74 .include "${HACKSRC}/Makefile.inc"
     75 
     76 clean cleandir:
     77 	-rm -f a.out core *.core *.o
     78 	-rm -f ${CLEANFILES}
     79 
     80 # Standard rules needed by the above...
     81 .include <bsd.obj.mk>
     82