Makefile revision 1.8
1# $NetBSD: Makefile,v 1.8 2002/03/28 04:33:24 lukem Exp $ 2 3TOP= ${.CURDIR}/.. 4 5# This include just sets DISTRIBREV=XX 6.include "${TOP}/Makefile.inc" 7.include <bsd.own.mk> 8 9IMAGE= ramdisk 10CBIN= rd_bin 11 12TREE= ${TOP}/common/${IMAGE}.tree 13 14LISTS= ${TOP}/common/${CBIN}.list \ 15 ${TOP}/common/${IMAGE}.list 16 17KERNEL = ${KERNOBJDIR}/RAMDISK/netbsd 18 19MOUNT_POINT?= /mnt 20VND?= vnd1 21VND_DEV?= /dev/${VND}a 22VND_RDEV?= /dev/r${VND}a 23 24# These are all the parameters for the root fs: 25DISKTYPE= rdroot 26SIZE= 400k 27# bigendian, minfree, opt, b/i , cpg 28NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20 29MDSETIMAGE?= mdsetimage 30MTREE?= mtree 31 32KERNELS= netbsd.RAMDISK 33CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp 34 35all: $(KERNELS) 36 37netbsd.RAMDISK : ${IMAGE}.fs 38 cp ${KERNEL} netbsd-tmp 39 ${MDSETIMAGE} -v netbsd-tmp ${IMAGE}.fs 40 -mv -f netbsd-tmp $@ 41 42${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN} 43 dd if=/dev/zero of=${IMAGE}.fs bs=${SIZE} count=1 44 vnconfig -f ${DESTDIR}/etc/disktab -t ${DISKTYPE} -v \ 45 -c ${VND} ${IMAGE}.fs 46 disklabel -rw -f ${DESTDIR}/etc/disktab ${VND} ${DISKTYPE} 47 newfs ${NEWFSARGS} ${VND_RDEV} 48 mount ${VND_DEV} ${MOUNT_POINT} 49 ${MTREE} -def ${TREE} -p ${MOUNT_POINT}/ -u 50 TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \ 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=${VND_DEV} of=${IMAGE}-tmp.fs bs=${SIZE} count=1 59 vnconfig -u ${VND} 60 mv ${IMAGE}-tmp.fs ${IMAGE}.fs 61 62unconfig: 63 -umount -f ${MOUNT_POINT} 64 -vnconfig -u ${VND} 65 -/bin/rm -f ${IMAGE}.fs 66 67# Do not delete this if I change my mind and kill make... 68.PRECIOUS: ${IMAGE}.fs 69 70# Rules for making ${CBIN} ... 71.include "${TOP}/common/Make.crunch" 72 73 74# Use stubs to eliminate some large stuff from libc 75HACKSRC= ${DISTRIBDIR}/utils/libhack 76HACKOBJS= gethost.o 77.include "${HACKSRC}/Makefile.inc" 78${CBIN}: libhack.o 79CPPFLAGS+=-I${DESTDIR}/usr/include 80 81clean cleandir distclean: 82 -rm -f a.out core *.core *.o *.cro *.c 83 -rm -f ${CLEANFILES} 84 85.if !defined(RELEASEDIR) 86release: 87 @echo setenv RELEASEDIR before doing that! 88 @false 89.else # RELEASEDIR 90release: $(KERNELS) 91.for x in ${KERNELS} 92 gzip -c -9 < ${x} > \ 93 ${RELEASEDIR}/binary/kernel/${x}.gz 94.endfor # KERNELS 95.endif # RELEASEDIR 96 97# Standard rules needed by the above... 98.include <bsd.obj.mk> 99.include <bsd.sys.mk> 100.include <bsd.subdir.mk> 101