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