Makefile revision 4191
1#	$Id: Makefile,v 1.15 1994/11/06 00:21:39 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 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 ncftp newfs ping pwd
14CPIO1+= reboot 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 -i 4096 -m 0 -o space /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	gzip -9 -c ${.CURDIR}/../COPYRIGHT > ${MNT}/COPYRIGHT.gz
62	gzip -9 -c ${.CURDIR}/../README > ${MNT}/README.gz
63	gzip -9 -c ${.CURDIR}/../share/FAQ/DISKSPACE.FAQ > \
64		${MNT}/DISKSPACE.FAQ.gz
65	gzip -9 -c ${.CURDIR}/../share/FAQ/RELNOTES.FreeBSD > \
66		${MNT}/RELNOTES.FreeBSD.gz
67	touch ${MNT}/this_is_boot_flp
68	-umount ${MNT}
69	fsck /dev/r${FLOPPY}
70	dd if=/dev/r${FLOPPY} bs=${DDBS} count=${DDCOUNT} of=boot.flp
71	gzip -9 -v < boot.flp > boot.flp.gz
72	ls -l boot.flp*
73
74cpio.flp:
75	( cd /${DESTDIR} ; ls ${CPIO2} | cpio -H newc -oa ) | cpio -ivd
76	for i in ${CPIO1} ; do rm -f ./$$i ; ln cpio_flp_1 ./$$i ; done
77	ls ${CPIO1} ${CPIO2} | cpio -H newc -oa | gzip -9 > cpio.flp
78	gzip -9 -v < cpio.flp > cpio.flp.gz
79	ls -l cpio.flp*
80
81crunch:
82	crunchgen ${.CURDIR}/boot_flp.conf
83	${MAKE} -f boot_flp.mk objs exe
84	crunchgen ${.CURDIR}/cpio_flp_1.conf
85	${MAKE} -f cpio_flp_1.mk objs exe
86
87floppies: crunch boot.flp cpio.flp
88
89release20: 
90	( cd ${.CURDIR} ; ${MAKE} cleandist)
91	( cd ${.CURDIR} ; ${MAKE} obj)
92	-mkdir ${RELEASEDIR}
93	chflags -R noschg ${RELEASEDIR}/.
94	rm -rf ${RELEASEDIR}/*
95	( cd ${.CURDIR}/.. ;  \
96		${MAKE} world NOCRYPT=yes)
97	( cd ${.CURDIR}/../etc ;  \
98		${MAKE} release-dirs )
99	( cd ${.CURDIR} ;  \
100		${MAKE} kernel DESTDIR=${RELEASEDIR}/filesys )
101	install ${COPY} -m 644 ${.CURDIR}/../sys/compile/GENERIC/kernel \
102		${RELEASEDIR}/filesys/kernel
103	( cd ${.CURDIR} ;  \
104		${MAKE} hierarchy DESTDIR=${RELEASEDIR}/filesys )
105	( cd ${.CURDIR}/../etc ; \
106		${MAKE} distribution DESTDIR=${RELEASEDIR}/filesys \
107			NOCRYPT=yes SHARED=copies)
108	( cd ${.CURDIR}/../etc ; \
109		${MAKE} bin-tarball DESTDIR=${RELEASEDIR}/filesys )
110	( cd ${.CURDIR} ;  \
111		${MAKE} floppies )
112
113.include <bsd.prog.mk>
114