Makefile revision 4233
1#	$Id: Makefile,v 1.22 1994/11/07 05:02:42 phk 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 
18
19CPIO2=  etc/services
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	cp ${.CURDIR}/../sys/compile/GENERIC/kernel ${MNT}/kernel
53	cp ${DESTDIR}/usr/mdec/sdboot ${DESTDIR}/usr/mdec/bootsd ${MNT}/stand
54	( cd ${DESTDIR}/dev ; \
55		ls console tty ttyv1 null zero \
56		sd[0123][a-h] wd[0123][a-h] fd[01] \
57		rsd[0123][a-h] rwd[0123][a-h] rfd[01] \
58	| cpio -dumpv ${MNT}/dev \
59	)
60	gzip -9 < boot_flp > ${MNT}/stand/sysinstall
61	chmod 755 ${MNT}/stand/sysinstall
62	ln ${MNT}/stand/sysinstall ${MNT}/stand/newfs
63	ln ${MNT}/stand/sysinstall ${MNT}/stand/gzip
64	install -m 400 -c ${.CURDIR}/../COPYRIGHT ${MNT}/COPYRIGHT
65	install -m 400 -c ${.CURDIR}/../README ${MNT}/README
66	install -m 400 -c ${.CURDIR}/../share/FAQ/DISKSPACE.FAQ \
67		${MNT}/DISKSPACE.FAQ
68	install -m 400 -c ${.CURDIR}/../share/FAQ/RELNOTES.FreeBSD \
69		${MNT}/RELNOTES.FreeBSD
70	touch ${MNT}/this_is_boot_flp
71	-umount ${MNT}
72	fsck /dev/r${FLOPPY}
73	dd if=/dev/r${FLOPPY} bs=${DDBS} count=${DDCOUNT} of=boot.flp
74	gzip -9 -v < boot_.flp > boot_.flp.gz
75	df -k /dev/r${FLOPPY}
76
77cpio.flp:
78	for i in ${CPIO1} ; do rm -f ./$$i ; ln cpio_flp_1 ./$$i ; done
79	( cd /${DESTDIR} ; ls ${CPIO2} | cpio -H newc -oa ) | cpio -ivd
80	( cd ${.CURDIR} ; ls ${CPIO3} | cpio -H newc -oa ) | cpio -ivd
81	ls ${CPIO1} ${CPIO2} ${CPIO3} | cpio -H newc -oa | gzip -9 > cpio.flp
82	gzip -9 -v < cpio.flp > cpio.flp.gz
83	ls -l cpio.flp*
84
85crunch:
86	crunchgen ${.CURDIR}/boot_flp.conf
87	${MAKE} -f boot_flp.mk objs exe
88	crunchgen ${.CURDIR}/cpio_flp_1.conf
89	${MAKE} -f cpio_flp_1.mk objs exe
90
91floppies: crunch boot.flp cpio.flp
92
93release20: 
94	( cd ${.CURDIR} ; ${MAKE} clean)
95	-mkdir ${RELEASEDIR}
96	chflags -R noschg ${RELEASEDIR}/.
97	rm -rf ${RELEASEDIR}/*
98	( cd ${.CURDIR}/.. ;  \
99		${MAKE} world NOCRYPT=yes)
100	( cd ${.CURDIR}/../etc ;  \
101		${MAKE} release-dirs )
102	( cd ${.CURDIR} ; ${MAKE} obj)
103	( cd ${.CURDIR} ;  \
104		${MAKE} kernel DESTDIR=${RELEASEDIR}/filesys )
105	install ${COPY} -m 644 ${.CURDIR}/../sys/compile/GENERIC/kernel \
106		${RELEASEDIR}/filesys/kernel
107	( cd ${.CURDIR} ;  \
108		${MAKE} hierarchy DESTDIR=${RELEASEDIR}/filesys )
109	( cd ${.CURDIR}/../etc ; \
110		${MAKE} distribution DESTDIR=${RELEASEDIR}/filesys \
111			NOCRYPT=yes SHARED=copies)
112	( cd ${.CURDIR}/../etc ; \
113		${MAKE} bin-tarball DESTDIR=${RELEASEDIR}/filesys )
114	( cd ${.CURDIR} ;  \
115		${MAKE} floppies )
116
117.include <bsd.prog.mk>
118