Makefile revision 1.6
1# $NetBSD: Makefile,v 1.6 2002/03/25 07:43:47 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# This is listed in rd_bin.conf but is built here. 74${CBIN} : libhack.o 75 76# Use stubs to eliminate some large stuff from libc 77HACKSRC=${TOP}/../utils/libhack 78CPPFLAGS+=-I${DESTDIR}/usr/include 79.include "${HACKSRC}/Makefile.inc" 80HACKOBJS+= gethost.o 81 82clean cleandir distclean: 83 -rm -f a.out core *.core *.o *.cro *.c 84 -rm -f ${CLEANFILES} 85 86.if !defined(RELEASEDIR) 87release: 88 @echo setenv RELEASEDIR before doing that! 89 @false 90.else # RELEASEDIR 91release: $(KERNELS) 92.for x in ${KERNELS} 93 gzip -c -9 < ${x} > \ 94 ${RELEASEDIR}/binary/kernel/${x}.gz 95.endfor # KERNELS 96.endif # RELEASEDIR 97 98# Standard rules needed by the above... 99.include <bsd.obj.mk> 100.include <bsd.sys.mk> 101.include <bsd.subdir.mk> 102