Makefile revision 1.3
11.3Ssimonb#	$NetBSD: Makefile,v 1.3 1999/04/16 14:12:14 simonb Exp $
21.1Sjonathan
31.1SjonathanTOP?=		${.CURDIR}/..
41.1SjonathanARCHDIR?=        ${.CURDIR}/../../${MACHINE}/miniroot
51.1Sjonathan
61.1Sjonathan.include "${TOP}/Makefile.inc"
71.1SjonathanIMAGE=		ramdisk.fs
81.3SsimonbDISKIMAGE=	diskimage.tgz
91.1Sjonathan
101.1SjonathanCBIN=		ramdiskbin
111.1Sjonathan#CSIZE?=	6144
121.1SjonathanCSIZE?=		4096
131.1SjonathanMOUNT_POINT?=	/mnt
141.1Sjonathan# DEV/RDEV file system device, CDEV/RDEV vnconfig device
151.1SjonathanVND?=		vnd0
161.1SjonathanVND_DEV=	/dev/${VND}a
171.1SjonathanVND_RDEV=	/dev/r${VND}a
181.1SjonathanVND_CDEV=	/dev/${VND}c
191.1SjonathanVND_CRDEV=	/dev/r${VND}c
201.1SjonathanIMAGE?=		xxx.fs
211.1SjonathanMDEC=		${DESTDIR}/usr/mdec
221.1Sjonathan
231.1SjonathanLISTS=		list
241.1SjonathanCRUNCHCONF=	${CBIN}.conf
251.1SjonathanMTREE=		mtree.conf
261.1Sjonathan
271.1Sjonathanall: ${CBIN} 
281.1Sjonathan	dd if=/dev/zero of=${IMAGE} count=${CSIZE}
291.1Sjonathan	vnconfig -v -c ${VND_CDEV} ${IMAGE}
301.1Sjonathan#	disklabel -rw ${VND_CDEV} ${DISKTYPE}
311.1Sjonathan	-(disklabel ${VND_CDEV} > /tmp/proto; disklabel -R -r ${VND_CDEV} /tmp/proto)
321.2Swrstuden	-newfs -B le -m 0 -o space -i 5120 ${VND_RDEV}
331.1Sjonathan	mount ${VND_DEV} ${MOUNT_POINT}
341.1Sjonathan	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
351.1Sjonathan	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} ARCHDIR=${ARCHDIR} \
361.1Sjonathan	    TARGDIR=${MOUNT_POINT} sh ${TOP}/src/runlist.sh ${.CURDIR}/${LISTS}
371.1Sjonathan	@echo ""
381.1Sjonathan	@df -i ${MOUNT_POINT}
391.3Ssimonb	@echo ""
401.3Ssimonb	@echo Building diskimage tar file...
411.3Ssimonb	tar cf - -C ${MOUNT_POINT} . | gzip -9 > ${DISKIMAGE}
421.1Sjonathan	@echo ""
431.1Sjonathan	umount ${MOUNT_POINT}
441.1Sjonathan	vnconfig -u ${VND_CDEV}
451.1Sjonathan
461.1Sjonathanunconfig:
471.1Sjonathan	-umount -f ${MOUNT_POINT}
481.1Sjonathan	-vnconfig -u ${VND_DEV}
491.1Sjonathan	-/bin/rm -f ${IMAGE}
501.1Sjonathan
511.1Sjonathan${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
521.1Sjonathan	crunchgen -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
531.1Sjonathan
541.1Sjonathan${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
551.1Sjonathan	make -f ${CBIN}.mk all
561.1Sjonathan
571.1Sjonathanclean cleandir distclean:
581.1Sjonathan	/bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c
591.1Sjonathan
601.1Sjonathan.include <bsd.own.mk>
611.1Sjonathan.include <bsd.obj.mk>
621.1Sjonathan.include <bsd.subdir.mk>
63