Makefile revision 1.5
1#	$NetBSD: Makefile,v 1.5 1998/02/12 19:56:25 gwr Exp $
2
3TOP=		${.CURDIR}/..
4
5# This include just sets REV=XX
6.include "${TOP}/Makefile.inc"
7
8IMAGE=	ramdisk
9CBIN=	rd_bin
10
11TREE=	${TOP}/common/${IMAGE}.tree
12
13LISTS=	${TOP}/common/${CBIN}.list \
14	${TOP}/common/${IMAGE}.list
15
16KERNEL3 = ${SRCSYSDIR}/arch/sun3/compile/RAMDISK/netbsd
17KERNEL3X= ${SRCSYSDIR}/arch/sun3/compile/RAMDISK3X/netbsd
18
19MOUNT_POINT=	/mnt
20#BDEV=		/dev/md0
21#CDEV=		/dev/md0
22BDEV=		/dev/sd1b
23CDEV=		/dev/rsd1b
24
25# These are all the parameters for the root fs: (256K)
26DISKTYPE=	rdroot
27NBLKS=		512
28# old format, minfree, opt, b/i  trks, sects, cpg
29NEWFSARGS= -O -m 0 -o space -i 2048 -t 2 -u 16 -c 16
30
31CLEANFILES= netbsd-rd.sun3 netbsd-rd.sun3x rdsetroot ${IMAGE}.fs
32
33all: netbsd-rd.sun3 netbsd-rd.sun3x
34
35netbsd-rd.sun3 : rdsetroot ${IMAGE}.fs
36	cp ${KERNEL3} netbsd-tmp
37	./rdsetroot  netbsd-tmp < ${IMAGE}.fs
38	-mv -f netbsd-tmp $@
39
40netbsd-rd.sun3x : rdsetroot ${IMAGE}.fs
41	cp ${KERNEL3X} netbsd-tmp
42	./rdsetroot  netbsd-tmp < ${IMAGE}.fs
43	-mv -f netbsd-tmp $@
44
45rdsetroot: ${TOP}/common/rdsetroot.c
46	$(CC) -o $@ -DDEBUG ${TOP}/common/rdsetroot.c
47
48${IMAGE}.fs: ${TREE} ${LISTS} ${CBIN}
49	-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
50	mount ${BDEV} ${MOUNT_POINT}
51	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
52	TOPDIR=${TOP} CURDIR=${.CURDIR} \
53	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
54	  sh ${TOP}/common/RunList.sh ${LISTS}
55	sync
56	@echo ""
57	@df -i ${MOUNT_POINT}
58	@echo ""
59	-umount ${MOUNT_POINT}
60	dd if=${CDEV} of=$@ bs=16b \
61	  count=`expr ${NBLKS} / 16`
62
63# Do not delete this if I change my mind and kill make...
64.PRECIOUS: ${IMAGE}.fs
65
66# Rules for making ${CBIN} ...
67.include "${TOP}/common/Make.crunch"
68
69# This is listed in rd_bin.conf but is built here.
70${CBIN} : libhack.o
71
72# Use stubs to eliminate some large stuff from libc
73HACKSRC=${TOP}/../utils/libhack
74.include "${HACKSRC}/Makefile.inc"
75
76clean cleandir:
77	-rm -f a.out core *.core *.o
78	-rm -f ${CLEANFILES}
79
80# Standard rules needed by the above...
81.include <bsd.obj.mk>
82