Home | History | Annotate | Line # | Download | only in ramdisk
Makefile revision 1.7.2.1
      1 #	$NetBSD: Makefile,v 1.7.2.1 1999/06/21 03:19:34 perry Exp $
      2 
      3 TOP=		${.CURDIR}/..
      4 
      5 # This include just sets REV=XX
      6 .include "${TOP}/Makefile.inc"
      7 
      8 IMAGE=	ramdisk
      9 CBIN=	rd_bin
     10 
     11 TREE=	${TOP}/common/${IMAGE}.tree
     12 
     13 LISTS=	${TOP}/common/${CBIN}.list \
     14 	${TOP}/common/${IMAGE}.list
     15 
     16 KERNEL3  = ${KERNOBJDIR}/RAMDISK/netbsd
     17 KERNEL3X = ${KERNOBJDIR}/RAMDISK3X/netbsd
     18 
     19 MOUNT_POINT?=	/mnt
     20 BDEV?=		/dev/sd1b
     21 CDEV?=		/dev/rsd1b
     22 
     23 # These are all the parameters for the root fs: (320K)
     24 DISKTYPE=	rdroot
     25 NBLKS=		640
     26 # bigendian, old format, minfree, opt, b/i  trks, sects, cpg
     27 NEWFSARGS= -B be -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16
     28 
     29 KERNELS= netbsd-RAMDISK netbsd-RAMDISK3X
     30 CLEANFILES= $(KERNELS) rdsetroot ${IMAGE}.fs
     31 
     32 all: $(KERNELS)
     33 
     34 netbsd-RAMDISK : rdsetroot ${IMAGE}.fs
     35 	cp ${KERNEL3} netbsd-tmp
     36 	./rdsetroot  netbsd-tmp < ${IMAGE}.fs
     37 	-mv -f netbsd-tmp $@
     38 
     39 netbsd-RAMDISK3X : rdsetroot ${IMAGE}.fs
     40 	cp ${KERNEL3X} netbsd-tmp
     41 	./rdsetroot  netbsd-tmp < ${IMAGE}.fs
     42 	-mv -f netbsd-tmp $@
     43 
     44 rdsetroot: ${TOP}/common/rdsetroot.c
     45 	$(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c
     46 
     47 ${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
     48 	-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
     49 	mount ${BDEV} ${MOUNT_POINT}
     50 	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
     51 	TOPDIR=${TOP} CURDIR=${.CURDIR} \
     52 	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
     53 	  sh ${TOP}/common/RunList.sh ${LISTS}
     54 	sync
     55 	@echo ""
     56 	@df -i ${MOUNT_POINT}
     57 	@echo ""
     58 	-umount ${MOUNT_POINT}
     59 	dd if=${CDEV} of=$@ bs=16b \
     60 	  count=`expr ${NBLKS} / 16`
     61 
     62 # Do not delete this if I change my mind and kill make...
     63 .PRECIOUS: ${IMAGE}.fs
     64 
     65 # Rules for making ${CBIN} ...
     66 .include "${TOP}/common/Make.crunch"
     67 
     68 # This is listed in rd_bin.conf but is built here.
     69 ${CBIN} : libhack.o
     70 
     71 # Use stubs to eliminate some large stuff from libc
     72 HACKSRC=${TOP}/../utils/libhack
     73 .include "${HACKSRC}/Makefile.inc"
     74 
     75 clean cleandir distclean:
     76 	-rm -f a.out core *.core *.o
     77 	-rm -f ${CLEANFILES}
     78 
     79 # Standard rules needed by the above...
     80 .include <bsd.obj.mk>
     81 
     82 .if !defined(RELEASEDIR)
     83 release:
     84 	@echo setenv RELEASEDIR before doing that!
     85 	@false
     86 .else	# RELEASEDIR
     87 release: $(KERNELS)
     88 .for x in ${KERNELS}
     89 	gzip -c -9 < ${x} > \
     90 	 ${RELEASEDIR}/binary/kernel/${x}.gz
     91 .endfor # KERNELS
     92 .endif	# RELEASEDIR
     93