Makefile revision 1.12
1#	$NetBSD: Makefile,v 1.12 1999/03/04 20:32:21 wrstuden 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/INSTALL/netbsd
19KERNEL3X= ${SRCSYSDIR}/arch/sun3/compile/INSTALL3X/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
33all: ${IMAGE}.gz
34
35${IMAGE}.gz: ${TREE} ${LISTS} install.sub
36	-newfs -B be ${NEWFSARGS} -s ${NBLKS} ${CDEV} ${DISKTYPE}
37	mount ${BDEV} ${MOUNT_POINT}
38	mtree -def ${TREE} -p ${MOUNT_POINT}/ -u
39	cp ${KERNEL3}  ${MOUNT_POINT}/netbsd.sun3
40	cp ${KERNEL3X} ${MOUNT_POINT}/netbsd.sun3x
41	TOPDIR=${TOP} CURDIR=${.CURDIR} \
42	  OBJDIR=${.OBJDIR} TARGDIR=${MOUNT_POINT} \
43	  sh ${TOP}/common/RunList.sh ${LISTS}
44	sync ; sleep 1 ; sync
45	cd ${MOUNT_POINT} ;\
46	  usr/mdec/installboot -v ufsboot usr/mdec/bootxx ${CDEV}
47	sync
48	@echo ""
49	@df -i ${MOUNT_POINT}
50	@echo ""
51	-umount ${MOUNT_POINT}
52	dd if=${CDEV} bs=16b count=`expr ${NBLKS} / 16` |\
53	  gzip > ${IMAGE}.tmp
54	-mv -f ${IMAGE}.tmp ${IMAGE}.gz
55
56# Do not delete this if I change my mind and kill make...
57.PRECIOUS: ${IMAGE}.gz
58
59install.sub : ${TOP}/../miniroot/install.sub
60	sed -e "/^VERSION=/s/=.*/=${REV}/" < $? > $@
61
62clean cleandir distclean:
63	-rm -f a.out core *.core *.o
64	-rm -f ${CLEANFILES}
65
66# Standard rules needed by the above...
67.include <bsd.obj.mk>
68