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