Makefile revision 9247
1290650Shselasky#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
2329200Shselasky#	$Id: Makefile,v 1.117 1995/05/30 03:57:47 rgrimes Exp $
3290650Shselasky
4290650Shselasky# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
5290650Shselasky# -rw-r--r--
6290650ShselaskyBINOWN= root
7290650ShselaskyBINGRP= wheel
8290650ShselaskyBIN1=   aliases csh.cshrc csh.login csh.logout dm.conf \
9290650Shselasky	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
10290650Shselasky	inetd.conf login.access motd modems netstart \
11290650Shselasky	networks phones printcap profile protocols \
12290650Shselasky	rc rc.local rc.serial etc.${MACHINE}/rc.${MACHINE} \
13290650Shselasky	remote security services sysconfig shells \
14290650Shselasky	syslog.conf ttys etc.${MACHINE}/disktab rpc make.conf \
15290650Shselasky	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
16290650Shselasky	${.CURDIR}/../usr.bin/mail/misc/mail.rc
17290650Shselasky
18290650Shselasky# -rw-rw-rw-
19290650ShselaskyBIN2=	motd
20290650Shselasky
21290650Shselasky# -rwxr-xr-x root.wheel, for the new cron root.wheel
22290650ShselaskyBIN3=	daily weekly monthly
23290650Shselasky
24290650ShselaskyCLEANFILES+=	*.c *.o *.lo
25290650ShselaskyCLEANFILES+=	filesystem filesystem.cache filesystem.mk
26290650ShselaskyCLEANFILES+=	kcopy kcopy.cache kcopy.mk
27290650Shselasky
28300676ShselaskyMAKEDEVS=	(cd ${MOUNT}/dev; \
29300676Shselasky		    sh ${DESTDIR}/dev/MAKEDEV std; \
30290650Shselasky		    rm -rf fd; \
31290650Shselasky		    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1; \
32290650Shselasky		    rm -rf fd0?* rfd0?* fd1?* rfd1?*; \
33290650Shselasky		    sh ${DESTDIR}/dev/MAKEDEV wd0 wd1 sd0 sd1 cd0 mcd0 mcd1; \
34290650Shselasky		    rm -rf *wd[01][ijklm] rmcd*)
35290650Shselasky
36290650ShselaskyNEWFS=		newfs -b 4096 -c 80 -f 512 -m 0 -o space -u 0 -t 0
37290650ShselaskyZIPNSPLIT=	gzip --no-name -9 -c | split -b 240640 -
38290650Shselasky
39290650ShselaskyMTREE=	BSD.local.dist BSD.root.dist BSD.usr.dist BSD.var.dist
40290650ShselaskyNAMEDB=	PROTO.localhost.rev named.boot named.root make-localhost
41290650ShselaskyPPPCNF= ppp.conf.filter.sample ppp.conf.iij ppp.conf.sample \
42290650Shselasky	ppp.linkup.sample ppp.secret.sample
43290650ShselaskyPCS=	pcs750.bin
44290650ShselaskyWCS1=	wcs fppwcs poc poc1 poc2 fppoc
45329200ShselaskyWCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
46290650Shselasky
47290650Shselasky# Special top level files for FreeBSD
48290650ShselaskyCOPYRIGHT=	COPYRIGHT
49290650ShselaskyFREEBSD=
50290650ShselaskyFREEBSD+=	${COPYRIGHT}
51290650Shselasky#
52290650Shselasky# Floppy drive name, mount point, type and parameters for building Floppies
53290650ShselaskyFLOPPY?=	fd0
54290650ShselaskyMOUNT?=		/mnt
55290650ShselaskyFLOPPY_TYPE?=	fd1440
56290650ShselaskyFLOPPY_BS?=	18b
57290650ShselaskyFLOPPY_TRACKS?=	160
58290650Shselasky#
59290650ShselaskyMDEC=		usr/mdec/bootfd usr/mdec/fdboot
60290650ShselaskyMDEC+=		usr/mdec/bootsd usr/mdec/sdboot
61290650ShselaskyMDEC+=		usr/mdec/bootwd usr/mdec/wdboot
62290650Shselasky#
63290650ShselaskyKC_DIRS=	bin dev mnt sbin etc
64341931ShselaskyKC_FILES=	${COPYRIGHT}
65341931ShselaskyKC_LINKS=	bin/[ bin/cp bin/echo bin/sh bin/test
66290650ShselaskyKC_LINKS+=	sbin/fsck sbin/halt sbin/init
67290650ShselaskyKC_LINKS+=	sbin/mount sbin/mount_cd9660
68290650ShselaskyKC_LINKS+=	sbin/umount
69290650Shselasky#
70290650ShselaskyCD_DIRS=	etc usr
71290650Shselasky#
72290650ShselaskyFILESYSTEM_DIRS=	bin dev etc mnt proc sbin usr usr/bin usr/mdec usr/sbin
73290650ShselaskyFILESYSTEM_TREES=	dev
74290650ShselaskyFILESYSTEM_FILES=	${COPYRIGHT}
75290650ShselaskyFILESYSTEM_FILES+=	dev/MAKEDEV
76290650ShselaskyFILESYSTEM_FILES+=	etc/group
77290650ShselaskyFILESYSTEM_FILES+=	etc/master.passwd etc/passwd etc/pwd.db
78329209ShselaskyFILESYSTEM_FILES+=	${MDEC}
79329209ShselaskyFILESYSTEM_LINKS=	bin/[ bin/expr bin/ls bin/mkdir bin/rm
80329209ShselaskyFILESYSTEM_LINKS+=	bin/sh bin/sync bin/test
81329209ShselaskyFILESYSTEM_LINKS+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
82329209ShselaskyFILESYSTEM_LINKS+=	sbin/mount
83290650ShselaskyFILESYSTEM_LINKS+=	sbin/newfs
84290650ShselaskyFILESYSTEM_LINKS+=	sbin/umount
85290650ShselaskyFILESYSTEM_LINKS+=	usr/bin/cpio
86290650ShselaskyFILESYSTEM_LINKS+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
87290650ShselaskyFILESYSTEM_LINKS+=	usr/sbin/bad144
88290650ShselaskyFILESYSTEM_CPIO=	.profile
89290650ShselaskyFILESYSTEM_CPIO+=	root/.profile
90290650ShselaskyFILESYSTEM_CPIO+=	bin/[
91290650ShselaskyFILESYSTEM_CPIO+=	bin/chmod bin/cat bin/cp bin/df bin/expr bin/ls
92290650ShselaskyFILESYSTEM_CPIO+=	bin/ln bin/mkdir bin/mv bin/rm bin/sync
93290650ShselaskyFILESYSTEM_CPIO+=	bin/test
94290650ShselaskyFILESYSTEM_CPIO+=	etc/spwd.db
95290650ShselaskyFILESYSTEM_CPIO+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
96290650ShselaskyFILESYSTEM_CPIO+=	sbin/mount
97290650ShselaskyFILESYSTEM_CPIO+=	sbin/newfs
98290650ShselaskyFILESYSTEM_CPIO+=	sbin/umount
99290650ShselaskyFILESYSTEM_CPIO_DIRS=	root
100290650Shselasky
101290650ShselaskyCPIO_FILES=	${COPYRIGHT}
102290650ShselaskyCPIO_CPIO=	bin/dd bin/ps bin/pwd bin/stty
103290650ShselaskyCPIO_CPIO+=	etc/protocols etc/remote etc/services
104290650ShselaskyCPIO_CPIO+=	etc/termcap
105290650ShselaskyCPIO_CPIO+=	sbin/dmesg
106290650ShselaskyCPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod sbin/mount_cd9660
107290650ShselaskyCPIO_CPIO+=	sbin/mount_procfs
108290650ShselaskyCPIO_CPIO+=	sbin/reboot sbin/route sbin/slattach
109290650ShselaskyCPIO_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/cpio usr/bin/ex usr/bin/ftp
110290650ShselaskyCPIO_CPIO+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip
111290650ShselaskyCPIO_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
112290650ShselaskyCPIO_CPIO+=	usr/bin/vi usr/bin/view usr/bin/zcat
113290650ShselaskyCPIO_CPIO+=	usr/lib/libc.so.*
114290650ShselaskyCPIO_CPIO+=	usr/lib/libcurses.so.*
115290650ShselaskyCPIO_CPIO+=	usr/lib/libgcc.so.*
116290650ShselaskyCPIO_CPIO+=	usr/lib/libm.so.*
117290650ShselaskyCPIO_CPIO+=	usr/lib/libtermcap.so.*
118290650ShselaskyCPIO_CPIO+=	usr/lib/libutil.so.*
119290650ShselaskyCPIO_CPIO+=	usr/libexec/ld.so
120290650ShselaskyCPIO_CPIO+=	usr/sbin/bad144 usr/sbin/chown
121290650ShselaskyCPIO_CPIO+=	usr/share/misc/termcap
122290650ShselaskyCPIO_CPIO_DIRS=		tmp usr/lib usr/libexec usr/share usr/share/misc
123290650ShselaskyCPIO_CPIO_DIRS+=	var var/tmp var/run var/spool var/spool/lock
124290650Shselasky
125290650ShselaskySCRYPT_LIB=	lib/libcrypt
126290650ShselaskyDESCRYPT_LIB=	secure/lib/libcrypt
127290650ShselaskyCRYPT_SRCS=	bin/ed bin/rcp
128290650ShselaskyCRYPT_SRCS+=	sbin/init
129290650Shselasky.if !defined(NOCRYPT)
130290650ShselaskyCRYPT_SRCS+=	secure
131290650Shselasky.endif
132290650ShselaskyCRYPT_DIRS=	bin sbin usr usr/bin usr/lib
133290650Shselasky
134290650ShselaskyLATIN1LINKS = \
135290650Shselasky	da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES fi_FI \
136290650Shselasky	fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE nl_NL no_NO \
137290650Shselasky	pt_PT sv_SE
138290650Shselasky
139290650Shselaskyall depend etc install lint:
140290650Shselasky
141290650Shselaskyscrypt:
142290650Shselasky	rm -f ${LIBCRYPT};
143290650Shselasky	(cd ${.CURDIR}/../${SCRYPT_LIB}; \
144290650Shselasky		${MAKE} cleandir obj depend all install)
145290650Shselasky	for i in ${CRYPT_SRCS}; do \
146290650Shselasky		cd ${.CURDIR}/../$$i; \
147290650Shselasky		${MAKE} cleandir obj depend all; \
148290650Shselasky	done
149290650Shselasky
150290650Shselaskydescrypt:
151290650Shselasky	rm -f ${LIBCRYPT};
152290650Shselasky	(cd ${.CURDIR}/../${DESCRYPT_LIB}; \
153290650Shselasky		${MAKE} cleandir obj depend all install)
154290650Shselasky	for i in ${CRYPT_SRCS}; do \
155290650Shselasky		cd ${.CURDIR}/../$$i; \
156290650Shselasky		${MAKE} cleandir obj depend all; \
157290650Shselasky	done
158290650Shselasky
159290650Shselaskydistribute:
160290650Shselasky	cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/bin
161290650Shselasky
162290650Shselaskydistribution:
163290650Shselasky	(cd ${.CURDIR}; \
164290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc; \
165290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc; \
166290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 ${BIN3} ${DESTDIR}/etc; \
167290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 644 crontab ${DESTDIR}/etc; \
168290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
169290650Shselasky	    ${DESTDIR}/var/cron/log; \
170290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 600 \
171290650Shselasky	    master.passwd ${DESTDIR}/etc; \
172290650Shselasky	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd; \
173290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
174290650Shselasky	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev )
175290650Shselasky	(cd ${DESTDIR}/dev; sh MAKEDEV all) ;
176290650Shselasky	(cd ${.CURDIR}/root; \
177290650Shselasky		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.cshrc \
178290650Shselasky		    ${DESTDIR}/root/.cshrc; \
179290650Shselasky		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.klogin \
180290650Shselasky		    ${DESTDIR}/root/.klogin; \
181290650Shselasky		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.login \
182290650Shselasky		    ${DESTDIR}/root/.login; \
183290650Shselasky		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.profile \
184290650Shselasky		    ${DESTDIR}/root/.profile; \
185290650Shselasky		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
186290650Shselasky		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
187290650Shselasky		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
188290650Shselasky	cd ${.CURDIR}/mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
189290650Shselasky	    ${MTREE} ${DESTDIR}/etc/mtree
190331580Shselasky	cd ${.CURDIR}/namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 \
191331580Shselasky	    ${NAMEDB} ${DESTDIR}/etc/namedb
192331580Shselasky	cd ${.CURDIR}/ppp; install -c -o ${BINOWN} -g ${BINGRP} -m 644 \
193331580Shselasky	    ${PPPCNF} ${DESTDIR}/etc/ppp
194331580Shselasky	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
195331580Shselasky	    ${DESTDIR}/etc/dumpdates
196331580Shselasky	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
197331580Shselasky	    ${DESTDIR}/var/db/locate.database
198331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
199331580Shselasky	    ${DESTDIR}/var/log/lpd-errs
200331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
201331580Shselasky	    ${DESTDIR}/var/log/maillog
202331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
203331580Shselasky	    ${DESTDIR}/var/log/lastlog
204331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
205331580Shselasky	    ${DESTDIR}/var/log/messages
206331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
207331580Shselasky	    ${DESTDIR}/var/log/wtmp
208331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
209331580Shselasky	    ${DESTDIR}/var/run/utmp
210331580Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 664 ${.CURDIR}/minfree \
211331580Shselasky	    ${DESTDIR}/var/crash
212331580Shselasky	(cd ${.CURDIR}/etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} \
213331580Shselasky	    -m 444 fstab.* ${DESTDIR}/etc)
214331580Shselasky	(cd ${.CURDIR}/../usr.sbin/sendmail/src; \
215331580Shselasky	    ${MAKE} obj; \
216331580Shselasky	    ${MAKE} all; \
217331580Shselasky	    ${MAKE} install; \
218290650Shselasky	 cd ../cf/cf; \
219290650Shselasky	    ${MAKE} obj; \
220290650Shselasky	    ${MAKE} freefall.cf; \
221290650Shselasky	    install -o ${BINOWN} -g ${BINGRP} -m 644 obj/freefall.cf \
222290650Shselasky	        ${DESTDIR}/etc/sendmail.cf)
223290650Shselasky	(cd ${.CURDIR}/..; \
224290650Shselasky	    install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FREEBSD} ${DESTDIR}/)
225290650Shselasky	(cd ${.CURDIR}/../share/man; ${MAKE} makedb; )
226290650Shselasky
227290650Shselaskycrunch:
228290650Shselasky	crunchgen ${.CURDIR}/../usr.sbin/crunch/examples/kcopy.conf
229290650Shselasky	${MAKE} -f kcopy.mk objs exe
230290650Shselasky	crunchgen ${.CURDIR}/../usr.sbin/crunch/examples/filesystem.conf
231290650Shselasky	${MAKE} -f filesystem.mk objs exe
232290650Shselasky
233290650Shselaskyextract:
234290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
235290650Shselasky	    ${.CURDIR}/etc.i386/EXTRACT_bin.sh \
236290650Shselasky	    ${RELEASEDIR}/tarballs/bin/EXTRACT.sh
237290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
238290650Shselasky	    ${.CURDIR}/etc.i386/EXTRACT_src.sh \
239290650Shselasky	    ${RELEASEDIR}/tarballs/bin/EXTRACT.sh
240290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
241290650Shselasky	    ${.CURDIR}/etc.i386/EXTRACT_secr.sh \
242290650Shselasky	    ${RELEASEDIR}/tarballs/bin/EXTRACT.sh
243290650Shselasky
244338554Shselaskyhcx9-distribution:
245337112Shselasky	(cd ${.CURDIR}/etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} \
246290650Shselasky	    -m 444 ${WCS2} ${DESTDIR}/)
247290650Shselasky
248337112Shselaskykcopy-kernels: ${.CURDIR}/../sys/i386/conf/GENERIC
249337112Shselasky	(cd ${.CURDIR}/../sys/compile; rm -rf GENERIC)
250337112Shselasky	(cd ${.CURDIR}/../sys/i386/conf; config GENERIC)
251337112Shselasky	(cd ${.CURDIR}/../sys/compile/GENERIC; ${MAKE} depend; ${MAKE} all; \
252337112Shselasky	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 kernel \
253290650Shselasky	        ${DESTDIR}/kernel.GENERIC)
254290650Shselasky
255290650Shselaskykcopy-floppy:
256290650Shselasky	echo y | fdformat ${FLOPPY}
257290650Shselasky	disklabel -w -r -B -b ${DESTDIR}/usr/mdec/fdboot \
258290650Shselasky		-s ${DESTDIR}/usr/mdec/bootfd ${FLOPPY} ${FLOPPY_TYPE}
259290650Shselasky	${NEWFS} -i 8192 r${FLOPPY} ${FLOPPY_TYPE}
260290650Shselasky	mount /dev/${FLOPPY} ${MOUNT}
261290650Shselasky	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
262290650Shselasky	chmod 755 ${MOUNT}/.
263290650Shselasky	(cd ${DESTDIR}/; \
264290650Shselasky	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
265290650Shselasky	${MAKEDEVS}
266290650Shselasky	(cd ${DESTDIR}/; \
267290650Shselasky	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
268290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
269290650Shselasky	    ${.CURDIR}/etc.i386/kc.profile ${MOUNT}/etc/rc
270290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
271290650Shselasky	    kcopy ${MOUNT}/bin/kcopy
272290650Shselasky	(cd ${MOUNT}/; \
273290650Shselasky	    for i in ${KC_LINKS}; do \
274290650Shselasky		ln bin/kcopy $$i; \
275290650Shselasky	    done)
276290650Shselasky
277290650Shselaskykcopy.flp:
278290650Shselasky	(cd ${.CURDIR}; ${MAKE} kcopy-floppy)
279290650Shselasky	(cd ${.CURDIR}/../sys/compile/GENERIC; \
280290650Shselasky	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 kernel ${MOUNT}/)
281290650Shselasky	df -ik ${MOUNT}
282290650Shselasky	# XXX umount is returning 1 for some reason :-(
283290650Shselasky	-umount /dev/${FLOPPY}
284290650Shselasky	fsck /dev/r${FLOPPY}
285290650Shselasky	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/kcopy.flp \
286290650Shselasky		bs=${FLOPPY_BS} count=${FLOPPY_TRACKS}
287290650Shselasky	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy.flp \
288290650Shselasky		>${RELEASEDIR}/floppies/kcopy.flp.gz &
289290650Shselasky
290290650Shselaskycdins-floppy:
291290650Shselasky	(cd ${.CURDIR}; ${MAKE} kcopy-floppy)
292290650Shselasky	(cd ${DESTDIR}/; \
293290650Shselasky	    ls -d ${CD_DIRS} | cpio -pdamuv ${MOUNT})
294306233Shselasky	(cd ${MOUNT}/usr; \
295306233Shselasky	    ln -s /cdrom/filesys/usr/libexec libexec; \
296290650Shselasky	    ln -s /cdrom/filesys/usr/lib lib)
297290650Shselasky	mkdir ${MOUNT}/cdrom
298290650Shselasky	chown ${BINOWN}.${BINGRP} ${MOUNT}/cdrom
299290650Shselasky	chmod 755 ${MOUNT}/cdrom
300290650Shselasky	#install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
301290650Shselasky	#    ${.CURDIR}/etc.i386/cdinst1.profile ${MOUNT}/.profile
302290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
303290650Shselasky	    ${.CURDIR}/etc.i386/cdinst1.install ${MOUNT}/install
304290650Shselasky	ln ${MOUNT}/install ${MOUNT}/etc/rc
305290650Shselasky
306290650Shselaskycdins.flp:
307290650Shselasky	(cd ${.CURDIR}; ${MAKE} kcopy-floppy)
308290650Shselasky	(cd ${.CURDIR}/../sys/compile/GENERIC; \
309290650Shselasky	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 kernel ${MOUNT}/)
310290650Shselasky	df -ik ${MOUNT}
311290650Shselasky	# XXX umount is returning 1 for some reason :-(
312290650Shselasky	-umount /dev/${FLOPPY}
313290650Shselasky	fsck /dev/r${FLOPPY}
314290650Shselasky	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cdins.flp \
315290650Shselasky		bs=${FLOPPY_BS} count=${FLOPPY_TRACKS}
316290650Shselasky	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cdins.flp \
317290650Shselasky		>${RELEASEDIR}/floppies/cdins.flp.gz &
318290650Shselasky
319331807Shselaskyfilesyst.flp:
320331807Shselasky	echo y | fdformat ${FLOPPY}
321331807Shselasky	disklabel -w -r -B -b ${DESTDIR}/usr/mdec/fdboot \
322290650Shselasky		-s ${DESTDIR}/usr/mdec/bootfd ${FLOPPY} ${FLOPPY_TYPE}
323290650Shselasky	${NEWFS} -i 10240 r${FLOPPY}  ${FLOPPY_TYPE}
324290650Shselasky	mount /dev/${FLOPPY}  ${MOUNT}
325290650Shselasky	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
326290650Shselasky	chmod 755 ${MOUNT}/.
327290650Shselasky	(cd ${DESTDIR}/; \
328290650Shselasky	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
329290650Shselasky	${MAKEDEVS}
330290650Shselasky	(cd ${DESTDIR}/; \
331290650Shselasky	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT}; \
332290650Shselasky	    (find ${FILESYSTEM_CPIO}; ls -d ${FILESYSTEM_CPIO_DIRS}) | \
333290650Shselasky		cpio -H newc --block-size=16 -oav | \
334290650Shselasky		gzip -9 >${MOUNT}/inst1.cpio.gz)
335290650Shselasky	#install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
336290650Shselasky	#    ${.CURDIR}/etc.i386/inst1.profile ${MOUNT}/.profile
337290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
338290650Shselasky	    ${.CURDIR}/etc.i386/inst1.install ${MOUNT}/install
339290650Shselasky	ln ${MOUNT}/install ${MOUNT}/etc/rc
340290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
341290650Shselasky	    filesystem ${MOUNT}/bin/filesystem
342290650Shselasky	(cd ${MOUNT}/; \
343290650Shselasky	    for i in ${FILESYSTEM_LINKS}; do \
344290650Shselasky		ln bin/filesystem $$i; \
345290650Shselasky	    done)
346290650Shselasky	(cd ${MOUNT}/; \
347290650Shselasky	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
348290650Shselasky	    ls ${FILESYSTEM_LINKS} >>/tmp/filelist; \
349290650Shselasky	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
350290650Shselasky	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
351290650Shselasky	    sort -u -r /tmp/filelist >filelist; \
352290650Shselasky	    rm /tmp/filelist)
353290650Shselasky	df -ik ${MOUNT}
354290650Shselasky	# XXX umount is returning 1 for some reason :-(
355290650Shselasky	-umount /dev/${FLOPPY}
356290650Shselasky	fsck /dev/r${FLOPPY}
357290650Shselasky	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/filesyst.flp \
358290650Shselasky		bs=${FLOPPY_BS} count=${FLOPPY_TRACKS}
359290650Shselasky	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesyst.flp \
360290650Shselasky		>${RELEASEDIR}/floppies/filesyst.flp.gz &
361290650Shselasky
362290650Shselaskycpio.flp:
363290650Shselasky	echo y | fdformat ${FLOPPY}
364290650Shselasky	disklabel -w -r -B -b ${DESTDIR}/usr/mdec/fdboot \
365331807Shselasky		-s ${DESTDIR}/usr/mdec/bootfd ${FLOPPY} ${FLOPPY_TYPE}
366331807Shselasky	${NEWFS} -i 65536 r${FLOPPY}  ${FLOPPY_TYPE}
367331807Shselasky	mount /dev/${FLOPPY} ${MOUNT}
368331807Shselasky	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
369331807Shselasky	chmod 755 ${MOUNT}/.
370331807Shselasky	(cd ${DESTDIR}/; \
371331807Shselasky		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
372331807Shselasky	#
373331807Shselasky	# XXX This ugliness is because the default termcap file is simply too
374331807Shselasky	# big and we don't need such a hugh one for the initial installation,
375331807Shselasky	# yet we want the symlink in /etc to point to the right place so we
376290650Shselasky	# need to install the smaller one in the same location.
377290650Shselasky	#
378331807Shselasky	mv ${DESTDIR}/usr/share/misc/termcap ${DESTDIR}/usr/share/misc/otermcap
379290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
380290650Shselasky	    ${.CURDIR}/termcap.small ${DESTDIR}/usr/share/misc/termcap
381290650Shselasky	(cd ${DESTDIR}/; \
382331807Shselasky	    (find ${CPIO_CPIO}; ls -d ${CPIO_CPIO_DIRS}) | \
383290650Shselasky		cpio -H newc --block-size=16 -oav | \
384290650Shselasky		gzip -9 >${MOUNT}/inst2.cpio.gz)
385290650Shselasky	# XXX cpio is done, put everything back in shape for the bindist.
386290650Shselasky	mv ${DESTDIR}/usr/share/misc/otermcap ${DESTDIR}/usr/share/misc/termcap
387290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
388290650Shselasky	    ${.CURDIR}/etc.i386/cpio.rc ${MOUNT}/rc
389290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
390290650Shselasky	    ${.CURDIR}/etc.i386/cpio.install ${MOUNT}/install
391290650Shselasky	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
392290650Shselasky	    ${.CURDIR}/etc.i386/cpio.magic ${MOUNT}/magic
393290650Shselasky	df -ik ${MOUNT}
394290650Shselasky	# XXX umount is returning 1 for some reason :-(
395331807Shselasky	-umount /dev/${FLOPPY}
396290650Shselasky	fsck /dev/r${FLOPPY}
397290650Shselasky	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cpio.flp \
398290650Shselasky		bs=${FLOPPY_BS} count=${FLOPPY_TRACKS}
399290650Shselasky	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio.flp \
400290650Shselasky		>${RELEASEDIR}/floppies/cpio.flp.gz &
401290650Shselasky
402290650Shselaskybin-tarball:
403290650Shselasky	(cd ${DESTDIR}; \
404290650Shselasky		mkdir -p ${RELEASEDIR}/tarballs/bin; \
405290650Shselasky		tar cf - . | \
406290650Shselasky		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/bin/bin.)
407290650Shselasky
408290650Shselaskydes-tarball:
409290650Shselasky	rm -rf ${RELEASEDIR}/tmpdes
410290650Shselasky	mkdir ${RELEASEDIR}/tmpdes
411290650Shselasky	for i in ${CRYPT_DIRS}; do \
412290650Shselasky		cd ${RELEASEDIR}/tmpdes; \
413290650Shselasky		mkdir $$i; \
414290650Shselasky		chown ${BINOWN}.${GRPOWN} $$i; \
415290650Shselasky		chmod 755 $$i; \
416290650Shselasky	done
417290650Shselasky	# This is ugly, it force installs a /usr/lib/libcrypt.a so
418306233Shselasky	# that the other makes will be built with des.
419306233Shselasky	#
420306233Shselasky	(set -x ; cd ${.CURDIR}/../${DESCRYPT_LIB}; \
421290650Shselasky		NOCRYPT=; \
422290650Shselasky		unset NOCRYPT; \
423290650Shselasky		DESTDIR=; export DESTDIR; \
424290650Shselasky		${MAKE} cleandir obj depend all install; \
425290650Shselasky		NOMAN=noman; export NOMAN; \
426290650Shselasky		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
427290650Shselasky		${MAKE} cleandir obj depend all install)
428290650Shselasky	for i in ${CRYPT_SRCS}; do \
429290650Shselasky		NOCRYPT=; \
430329209Shselasky		unset NOCRYPT; \
431329209Shselasky		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
432329209Shselasky		NOMAN=noman; export NOMAN; \
433329209Shselasky		cd ${.CURDIR}/../$$i; \
434329209Shselasky		${MAKE} cleandir obj depend all install; \
435329209Shselasky	done
436329209Shselasky	(cd ${RELEASEDIR}/tmpdes; \
437329209Shselasky		tar cf - . | \
438329209Shselasky			${ZIPNSPLIT} ${RELEASEDIR}/tarballs/des/des_tgz.)
439331807Shselasky	rm -rf ${RELEASEDIR}/tmpdes
440329209Shselasky
441329209Shselaskydistrib-dirs:
442329209Shselasky	mtree -deU -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
443329209Shselasky	mtree -deU -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
444329209Shselasky	mtree -deU -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
445329209Shselasky	mtree -deU -f ${.CURDIR}/mtree/BSD.include.dist \
446329209Shselasky		-p ${DESTDIR}/usr/include
447329209Shselasky.if defined(MAKE_LOCAL)
448329209Shselasky	mtree -deU -f ${.CURDIR}/mtree/BSD.local.dist -p ${DESTDIR}/usr/local
449329209Shselasky.endif
450329209Shselasky	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
451329209Shselasky	cd ${DESTDIR}/usr/share/locale; \
452329209Shselasky	for l in ${LATIN1LINKS} ; do \
453329209Shselasky		rm -f $$l.ISO_8859-1; \
454329209Shselasky		ln -s lt_LN.ISO_8859-1 $$l.ISO_8859-1; \
455329209Shselasky	done
456329209Shselasky
457329209Shselaskyfloppies:	kcopy.flp filesyst.flp cpio.flp cdins.flp
458329209Shselasky
459329209Shselaskyrelease:	release-dirs distribution crunch extract kcopy-kernels \
460329209Shselasky		floppies bin-tarball des-tarball clean
461329209Shselasky
462329209Shselaskyrelease-dirs:
463329209Shselasky	chflags -R noschg ${RELEASEDIR}/
464329209Shselasky	rm -rf ${RELEASEDIR}/*
465329209Shselasky	mtree -d -U -f ${.CURDIR}/mtree/BSD.release.dist -p ${RELEASEDIR}
466329209Shselasky
467329209Shselasky.include <bsd.prog.mk>
468329209Shselasky