Makefile revision 3993
1#	$Id: Makefile,v 1.6 1994/10/28 06:42:38 jkh Exp $
2#
3
4FLOPPY=		fd0
5FDLABEL=	fd1200
6DDBS=		15k
7DDCOUNT=	80
8MNT=		/mnt
9
10CPIO1= cat chmod cp date dd df echo ed expr hostname kill ln ls mkdir
11CPIO1+= mt mv pwd rcp rm rmdir sh sleep stty sync test [ -sh
12CPIO1+= badsect chown clri disklabel dump dmesg fdisk fsck ifconfig init
13CPIO1+= mknod mount newfs ping reboot restore swapon umount route
14CPIO1+= rdump rrestore halt
15CPIO1+= ftp rsh sed telnet rlogin 
16
17CPIO2=  etc/services
18
19# Somewhat on the rough side...
20CLEANFILES=	*.o *.c *.cache *.mk *.lo ${CPIO1} *.flp *.gz
21
22MTREE_DIR=	${.CURDIR}/../etc/mtree
23
24hierarchy:
25	mtree -deU -f ${MTREE_DIR}/BSD.root.dist  -p ${DESTDIR}/
26	mtree -deU -f ${MTREE_DIR}/BSD.var.dist   -p ${DESTDIR}/var
27	mtree -deU -f ${MTREE_DIR}/BSD.usr.dist   -p ${DESTDIR}/usr
28.if defined(MAKE_LOCAL)
29	mtree -deU -f ${MTREE_DIR}/BSD.local.dist -p ${DESTDIR}/usr/local
30.endif
31	rm -f ${DESTDIR}/sys
32	ln -s usr/src/sys ${DESTDIR}/sys
33
34kernel:	${.CURDIR}/../sys/i386/conf/GENERIC
35	(cd ${.CURDIR}/../sys/i386/conf; config GENERIC)
36	(cd ${.CURDIR}/../sys/compile/GENERIC; ${MAKE} depend; ${MAKE} all; )
37
38boot.flp:
39	-umount ${MNT}
40	-umount /dev/${FLOPPY}
41	echo y | fdformat ${FLOPPY}
42	disklabel -w -B \
43		-b ${DESTDIR}/usr/mdec/fdboot -s ${DESTDIR}/usr/mdec/bootfd \
44		/dev/r${FLOPPY} ${FDLABEL}
45	newfs -c 80 -b 4096 -f 512 /dev/r${FLOPPY}
46	mount -o async /dev/${FLOPPY} ${MNT}
47	mkdir ${MNT}/dev ${MNT}/stand ${MNT}/mnt
48	cp ${.CURDIR}/../sys/compile/GENERIC/kernel ${MNT}/kernel
49	cp ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd ${MNT}/stand
50	( cd ${DESTDIR}/dev ; \
51		ls console tty ttyv1 null zero \
52		sd[0123][a-h] wd[0123][a-h] fd[01] \
53		rsd[0123][a-h] rwd[0123][a-h] rfd[01] \
54	| cpio -dumpv ${MNT}/dev \
55	)
56	gzip -9 < boot_flp > ${MNT}/stand/sysinstall
57	chmod 755 ${MNT}/stand/sysinstall
58	ln ${MNT}/stand/sysinstall ${MNT}/stand/newfs
59	install -c -m 400 ${.CURDIR}/../COPYRIGHT ${MNT}/COPYRIGHT
60	install -c -m 400 ${.CURDIR}/../README ${MNT}/README
61	touch ${MNT}/this_is_boot_flp
62	-umount ${MNT}
63	fsck /dev/r${FLOPPY}
64	dd if=/dev/r${FLOPPY} bs=${DDBS} count=${DDCOUNT} of=boot.flp
65	gzip -9 -v < boot.flp > boot.flp.gz
66	ls -l boot.flp*
67
68cpio.flp:
69	( cd /${DESTDIR} ; ls ${CPIO2} | cpio -H newc -oa ) | cpio -ivd
70	for i in ${CPIO1} ; do rm -f ./$$i ; ln cpio_flp_1 ./$$i ; done
71	ls ${CPIO1} ${CPIO2} | cpio -H newc -oa | gzip -9 > cpio.flp
72	gzip -9 -v < cpio.flp > cpio.flp.gz
73	ls -l cpio.flp*
74
75crunch:
76	crunchgen ${.CURDIR}/boot_flp.conf
77	${MAKE} -f boot_flp.mk objs exe
78	crunchgen ${.CURDIR}/cpio_flp_1.conf
79	${MAKE} -f cpio_flp_1.mk objs exe
80
81floppies: crunch boot.flp cpio.flp
82
83release20: 
84	-mkdir ${RELEASEDIR}
85	chflags -R noschg ${RELEASEDIR}/.
86	rm -rf ${RELEASEDIR}/*
87	( cd ${.CURDIR}/.. ;  \
88		${MAKE} world NOCRYPT=yes)
89	( cd ${.CURDIR}/../etc ;  \
90		${MAKE} release-dirs )
91	( cd ${.CURDIR} ;  \
92		${MAKE} kernel DESTDIR=${RELEASEDIR}/filesys )
93	install ${COPY} -m 644 ${.CURDIR}/../sys/compile/GENERIC/kernel \
94		${RELEASEDIR}/filesys/kernel
95	( cd ${.CURDIR} ;  \
96		${MAKE} hierarchy DESTDIR=${RELEASEDIR}/filesys )
97	( cd ${.CURDIR}/../etc ; \
98		${MAKE} distribution DESTDIR=${RELEASEDIR}/filesys \
99			NOCRYPT=yes SHARED=copies)
100	( cd ${.CURDIR}/../etc ; \
101		${MAKE} bin-tarball DESTDIR=${RELEASEDIR}/filesys )
102	( cd ${.CURDIR} ;  \
103		${MAKE} floppies )
104
105.include <bsd.prog.mk>
106