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