Makefile revision 1.22
11.22Sgarbled#	$NetBSD: Makefile,v 1.22 2000/10/26 04:53:57 garbled Exp $
21.21Spk#
31.21Spk# ramdisk.fs is the microroot filesystem intended for use with
41.21Spk# the INSTALL kernel. It provides just enough tools to extract the
51.21Spk# miniroot-based `instfs' filesystem into an MFS mount point
61.21Spk# and start the installation scripts from there (see dot.profile).
71.21Spk#
81.1Smrg
91.1SmrgTOP=		${.CURDIR}/..
101.6SmrgMINIROOT=	${.CURDIR}/../../miniroot
111.1Smrg
121.1Smrg.include "${TOP}/Makefile.inc"
131.1Smrg
141.1SmrgCBIN=		ramdiskbin
151.1Smrg
161.1SmrgMOUNT_POINT?=	/mnt
171.1Smrg# DEV/RDEV file system device, CDEV/RDEV vnconfig device
181.1SmrgVND?=		vnd0
191.1SmrgVND_DEV=	/dev/${VND}a
201.1SmrgVND_RDEV=	/dev/r${VND}a
211.1SmrgVND_CDEV=	/dev/${VND}c
221.1SmrgVND_CRDEV=	/dev/r${VND}c
231.1SmrgMDEC=		${DESTDIR}/usr/mdec
241.15SpkIMAGE?=		ramdisk.fs
251.1Smrg
261.1SmrgLISTS=		list
271.1SmrgMTREE=		mtree.conf
281.1Smrg
291.21Spk# image size in 512-byte blocks
301.21SpkSIZE=		1360
311.21Spk#DISKTYPE=	instfs
321.21SpkGEOM=		512/1/${SIZE}/1
331.21SpkINO_BYTES=	2048
341.1Smrg
351.11Smrgall: ${CBIN}
361.21Spk	dd if=/dev/zero of=${IMAGE} bs=${SIZE}b count=1
371.17Scjs	#vnconfig -t ${DISKTYPE} -v -c ${VND_CDEV} ${IMAGE}
381.17Scjs	vnconfig -v -c ${VND_CDEV} ${IMAGE} ${GEOM}
391.17Scjs	#disklabel -rw ${VND_CDEV} ${DISKTYPE}
401.17Scjs	#disklabel -W ${VND_CDEV}
411.17Scjs	newfs -B be -m 0 -o space -i ${INO_BYTES} ${VND_RDEV}
421.1Smrg	mount ${VND_DEV} ${MOUNT_POINT}
431.1Smrg	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
441.6Smrg	TOPDIR=${TOP} CURDIR=${MINIROOT} REALCURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
451.18Ssjg	    KERNOBJDIR=${KERNOBJDIR} \
461.6Smrg	    TARGDIR=${MOUNT_POINT} sh ${MINIROOT}/runlist.sh ${.CURDIR}/${LISTS}
471.1Smrg	@echo ""
481.1Smrg	@df -i ${MOUNT_POINT}
491.1Smrg	@echo ""
501.1Smrg	umount ${MOUNT_POINT}
511.1Smrg	vnconfig -u ${VND_CDEV}
521.1Smrg
531.1Smrgunconfig:
541.1Smrg	-umount -f ${MOUNT_POINT}
551.1Smrg	-vnconfig -u ${VND_DEV}
561.1Smrg	-/bin/rm -f ${IMAGE}
571.1Smrg
581.11Smrg${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CBIN}.conf
591.2Smrg	crunchgen -D ${TOP}/../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}
601.1Smrg
611.11Smrg${CBIN}.conf: ${LISTS}
621.13Smycroft	awk -f ${MINIROOT}/makeconf.awk CBIN=${CBIN} ${.CURDIR}/${LISTS} > ${CBIN}.conf
631.11Smrg
641.1Smrg${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
651.22Sgarbled	${MAKE} -f ${CBIN}.mk all
661.6Smrg
671.6Smrg# This is listed in ramdiskbin.conf but is built here.
681.6Smrg${CBIN}: libhack.o
691.6Smrg
701.6Smrg# Use stubs to eliminate some large stuff from libc
711.11SmrgNOLIBHACKOPENDIR=1
721.6SmrgHACKSRC=${TOP}/../utils/libhack
731.6Smrg.include "${HACKSRC}/Makefile.inc"
741.1Smrg
751.4Slukemclean cleandir distclean:
761.14Spk	/bin/rm -f *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache \
771.14Spk	${CBIN}.conf *.o *.cro *.c
781.12Spk
791.12Spk.ifndef RELEASEDIR
801.12Spkrelease:
811.12Spk	@echo setenv RELEASEDIR first
821.12Spk	@false
831.12Spk.else
841.12Spkrelease: $(IMAGE)
851.21Spk	gzip -c -9 < $(.OBJDIR)/ramdisk.fs \
861.21Spk		> $(RELEASEDIR)/installation/bootfs/ramdisk.fs.gz
871.12Spk.endif	# RELEASEDIR check
881.1Smrg
891.1Smrg.include <bsd.obj.mk>
901.1Smrg.include <bsd.subdir.mk>
91