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