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