Home | History | Annotate | Line # | Download | only in ramdisk
Makefile revision 1.3
      1 #	$NetBSD: Makefile,v 1.3 1995/11/21 21:19:14 gwr 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 KERNEL=${SRCSYSDIR}/arch/sun3/compile/RAMDISK/netbsd
     17 
     18 MOUNT_POINT=	/mnt
     19 BDEV=		/dev/rd0
     20 CDEV=		/dev/rd0
     21 
     22 # These are all the parameters for the root fs: (256K)
     23 DISKTYPE=	rdroot
     24 NBLKS=		512
     25 # old format, minfree, opt, b/i  trks, sects, cpg
     26 NEWFSARGS= -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16
     27 
     28 CLEANFILES= netbsd-rd rdsetroot ${IMAGE}.fs
     29 
     30 netbsd-rd : rdsetroot ${IMAGE}.fs
     31 	cp ${KERNEL} netbsd-tmp
     32 	./rdsetroot  netbsd-tmp < ${IMAGE}.fs
     33 	-mv -f netbsd-tmp $@
     34 
     35 rdsetroot: ${TOP}/common/rdsetroot.c
     36 	$(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c
     37 
     38 ${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
     39 	-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
     40 	mount ${BDEV} ${MOUNT_POINT}
     41 	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
     42 	TOPDIR=${TOP} CURDIR=${.CURDIR} \
     43 	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
     44 	  sh ${TOP}/common/RunList.sh ${LISTS}
     45 	sync
     46 	@echo ""
     47 	@df -i ${MOUNT_POINT}
     48 	@echo ""
     49 	-umount ${MOUNT_POINT}
     50 	dd if=${CDEV} of=$@ count=${NBLKS}
     51 
     52 # Do not delete this if I change my mind and kill make...
     53 .PRECIOUS: ${IMAGE}.fs
     54 
     55 # Rules for making ${CBIN} ...
     56 .include "${TOP}/common/Make.crunch"
     57 
     58 # This is listed in rd_bin.conf but is built here.
     59 ${CBIN} : libhack.o
     60 
     61 # Use stubs to eliminate some large stuff from libc
     62 HACKSRC=${TOP}/../utils/libhack
     63 .include "${HACKSRC}/Makefile.inc"
     64 
     65 clean cleandir:
     66 	-rm -f a.out core *.core *.o
     67 	-rm -f ${CLEANFILES}
     68 
     69 # Standard rules needed by the above...
     70 .include <bsd.obj.mk>
     71