Home | History | Annotate | Line # | Download | only in ramdisk
Makefile revision 1.17
      1  1.17      chs #	$NetBSD: Makefile,v 1.17 2001/07/30 00:09:08 chs Exp $
      2   1.1      gwr 
      3   1.1      gwr TOP=		${.CURDIR}/..
      4   1.1      gwr 
      5   1.1      gwr # This include just sets REV=XX
      6   1.1      gwr .include "${TOP}/Makefile.inc"
      7   1.1      gwr 
      8   1.1      gwr IMAGE=	ramdisk
      9   1.1      gwr CBIN=	rd_bin
     10   1.1      gwr 
     11   1.1      gwr TREE=	${TOP}/common/${IMAGE}.tree
     12   1.1      gwr 
     13   1.1      gwr LISTS=	${TOP}/common/${CBIN}.list \
     14   1.1      gwr 	${TOP}/common/${IMAGE}.list
     15   1.1      gwr 
     16   1.9      gwr KERNEL3  = ${KERNOBJDIR}/RAMDISK/netbsd
     17   1.9      gwr KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/netbsd
     18   1.3      gwr 
     19   1.9      gwr MOUNT_POINT?=	/mnt
     20  1.12  tsutsui VND?=		vnd1
     21  1.12  tsutsui VND_DEV?=	/dev/${VND}a
     22  1.12  tsutsui VND_RDEV?=	/dev/r${VND}a
     23   1.1      gwr 
     24  1.12  tsutsui # These are all the parameters for the root fs:
     25   1.3      gwr DISKTYPE=	rdroot
     26  1.17      chs SIZE=		500k
     27  1.12  tsutsui # bigendian, minfree, opt, b/i , cpg
     28  1.12  tsutsui NEWFSARGS= -B be -m 0 -o space -i 4096 -c 20
     29   1.1      gwr 
     30  1.14  tsutsui KERNELS= netbsd.RAMDISK netbsd.RAMDISK3X
     31  1.12  tsutsui CLEANFILES= $(KERNELS) ${IMAGE}.fs netbsd-tmp
     32   1.1      gwr 
     33  1.11      gwr all: $(KERNELS)
     34   1.5      gwr 
     35  1.14  tsutsui netbsd.RAMDISK : ${IMAGE}.fs
     36   1.5      gwr 	cp ${KERNEL3} netbsd-tmp
     37  1.12  tsutsui 	mdsetimage -v netbsd-tmp ${IMAGE}.fs
     38   1.5      gwr 	-mv -f netbsd-tmp $@
     39   1.5      gwr 
     40  1.14  tsutsui netbsd.RAMDISK3X : ${IMAGE}.fs
     41   1.5      gwr 	cp ${KERNEL3X} netbsd-tmp
     42  1.12  tsutsui 	mdsetimage -v netbsd-tmp ${IMAGE}.fs
     43   1.1      gwr 	-mv -f netbsd-tmp $@
     44   1.1      gwr 
     45   1.3      gwr ${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
     46  1.12  tsutsui 	dd if=/dev/zero of=${IMAGE}.fs bs=${SIZE} count=1
     47  1.12  tsutsui 	vnconfig -t ${DISKTYPE} -v -c ${VND} ${IMAGE}.fs
     48  1.12  tsutsui 	disklabel -rw ${VND} ${DISKTYPE}
     49  1.12  tsutsui 	newfs ${NEWFSARGS} ${VND_RDEV}
     50  1.12  tsutsui 	mount ${VND_DEV} ${MOUNT_POINT}
     51   1.3      gwr 	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
     52  1.13  tsutsui 	TOPDIR=${TOP} CURDIR=${.CURDIR} DESTDIR=${DESTDIR} \
     53   1.3      gwr 	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
     54   1.3      gwr 	  sh ${TOP}/common/RunList.sh ${LISTS}
     55   1.3      gwr 	sync
     56   1.3      gwr 	@echo ""
     57   1.3      gwr 	@df -i ${MOUNT_POINT}
     58   1.3      gwr 	@echo ""
     59  1.12  tsutsui 	umount ${MOUNT_POINT}
     60  1.12  tsutsui 	vnconfig -u ${VND}
     61  1.15      jmc 
     62  1.15      jmc unconfig:
     63  1.15      jmc 	-umount -f ${MOUNT_POINT}
     64  1.15      jmc 	-vnconfig -u ${VND_DEV}
     65  1.15      jmc 	-/bin/rm -f ${IMAGE}.fs
     66   1.1      gwr 
     67   1.2      gwr # Do not delete this if I change my mind and kill make...
     68   1.2      gwr .PRECIOUS: ${IMAGE}.fs
     69   1.2      gwr 
     70   1.1      gwr # Rules for making ${CBIN} ...
     71   1.1      gwr .include "${TOP}/common/Make.crunch"
     72   1.1      gwr 
     73   1.3      gwr # This is listed in rd_bin.conf but is built here.
     74   1.1      gwr ${CBIN} : libhack.o
     75   1.1      gwr 
     76   1.1      gwr # Use stubs to eliminate some large stuff from libc
     77   1.1      gwr HACKSRC=${TOP}/../utils/libhack
     78   1.1      gwr .include "${HACKSRC}/Makefile.inc"
     79   1.1      gwr 
     80   1.6    lukem clean cleandir distclean:
     81  1.13  tsutsui 	-rm -f a.out core *.core *.o *.cro *.c
     82   1.2      gwr 	-rm -f ${CLEANFILES}
     83   1.1      gwr 
     84  1.11      gwr .if !defined(RELEASEDIR)
     85  1.11      gwr release:
     86  1.11      gwr 	@echo setenv RELEASEDIR before doing that!
     87  1.11      gwr 	@false
     88  1.11      gwr .else	# RELEASEDIR
     89  1.11      gwr release: $(KERNELS)
     90  1.11      gwr .for x in ${KERNELS}
     91  1.11      gwr 	gzip -c -9 < ${x} > \
     92  1.11      gwr 	 ${RELEASEDIR}/binary/kernel/${x}.gz
     93  1.11      gwr .endfor # KERNELS
     94  1.11      gwr .endif	# RELEASEDIR
     95  1.13  tsutsui 
     96  1.13  tsutsui # Standard rules needed by the above...
     97  1.13  tsutsui .include <bsd.obj.mk>
     98  1.16      chs .include <bsd.sys.mk>
     99  1.13  tsutsui .include <bsd.subdir.mk>
    100