Makefile revision 1.8
1#	$NetBSD: Makefile,v 1.8 1998/02/12 19:55:14 gwr Exp $
2
3TOP=		${.CURDIR}/..
4
5# This include just sets REV=XX
6.include "${TOP}/Makefile.inc"
7
8IMAGE=	miniroot
9#CBIN=	mini_usr
10
11TREE=	${TOP}/common/${IMAGE}.tree
12
13LISTS=	${TOP}/common/${IMAGE}.list \
14	${TOP}/common/mini_sbin.list \
15	${TOP}/common/mini_bin.list \
16	${TOP}/common/mini_usr.list
17
18KERNEL3 = ${SRCSYSDIR}/arch/sun3/compile/GENERIC/netbsd
19KERNEL3X= ${SRCSYSDIR}/arch/sun3/compile/GENERIC3X/netbsd
20
21MOUNT_POINT=	/mnt
22BDEV=		/dev/sd1b
23CDEV=		/dev/rsd1b
24
25# These are all the parameters for the miniroot: (8MB)
26DISKTYPE=	miniroot
27NBLKS=		16384
28# old format, minfree, opt, b/i  trks, sects, cpg
29NEWFSARGS= -O -m 0 -o space -i 8192 -t 8 -u 32 -c 16
30
31CLEANFILES= ${IMAGE}.gz install.sub
32
33${IMAGE}.gz: ${TREE} ${LISTS} install.sub
34	-newfs ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
35	mount ${BDEV} ${MOUNT_POINT}
36	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
37	cp ${KERNEL3}  ${MOUNT_POINT}/netbsd.sun3
38	cp ${KERNEL3X} ${MOUNT_POINT}/netbsd.sun3x
39	TOPDIR=${TOP} CURDIR=${.CURDIR} \
40	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
41	  sh ${TOP}/common/RunList.sh ${LISTS}
42	sync ; sleep 1 ; sync
43	cd ${MOUNT_POINT} ;\
44	  usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${CDEV}
45	sync
46	@echo ""
47	@df -i ${MOUNT_POINT}
48	@echo ""
49	-umount ${MOUNT_POINT}
50	dd if=${CDEV} bs=16b count=`expr ${NBLKS} / 16` |\
51	  gzip > ${IMAGE}.tmp
52	-mv -f ${IMAGE}.tmp ${IMAGE}.gz
53
54# Do not delete this if I change my mind and kill make...
55.PRECIOUS: ${IMAGE}.gz
56
57install.sub : ${TOP}/../miniroot/install.sub
58	sed -e "/^VERSION=/s/=.*/=${REV}/" < $? > $@
59
60clean cleandir:
61	-rm -f a.out core *.core *.o
62	-rm -f ${CLEANFILES}
63
64# Standard rules needed by the above...
65.include <bsd.obj.mk>
66