Makefile revision 1285
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
21285Srgrimes#	$Id: Makefile,v 1.54 1994/03/07 00:42:56 rgrimes Exp $
337Srgrimes
4358SrgrimesNOOBJ=	noobj
537Srgrimes
637Srgrimes# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
737Srgrimes# -rw-r--r--
8147SrgrimesBINOWN= root
9147SrgrimesBINGRP= wheel
10147SrgrimesBIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
11207Snate	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
12377Srgrimes	inetd.conf motd myname netstart networks phones \
13147Srgrimes	printcap protocols rc rc.local remote security services shells \
14147Srgrimes	syslog.conf ttys etc.${MACHINE}/disktab rpc
1537Srgrimes
1637Srgrimes# -rw-rw-rw-
1737SrgrimesBIN2=	motd
1837Srgrimes
19147Srgrimes# -rwxr-xr-x root.wheel, for the new f***ing cron root.wheel
20147SrgrimesBIN3=	daily weekly monthly
21147Srgrimes
22491SrgrimesMTREE=	BSD.local.dist BSD.root.dist BSD.usr.dist BSD.var.dist
2337SrgrimesNAMEDB=	localhost.rev named.boot root.cache
2437SrgrimesPCS=	pcs750.bin
2537SrgrimesWCS1=	wcs fppwcs poc poc1 poc2 fppoc
2637SrgrimesWCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
2737Srgrimes
28263Srgrimes# Special top level files for FreeBSD
291130SrgrimesCOPYRIGHT=	COPYRIGHT.386BSD COPYRIGHT.FreeBSD
30993SrgrimesFREEBSD=	CONTRIB.386BSD CONTRIB.FreeBSD
311126SrgrimesFREEBSD+=	MIRROR.SITES PERSONAL.ACKS RELNOTES.FreeBSD SUPPORT.TXT
32993SrgrimesFREEBSD+=	${COPYRIGHT}
33277Srgrimes#
34277Srgrimes# Floppy drive name and files for building FreeBSD Floppies
35284SrgrimesFLOPPY?=	fd0
36463SrgrimesMOUNT?=		/mnt
371205SrgrimesFLOPPY_TYPE?=	fd1200
38284Srgrimes#
39284SrgrimesMDEC=		usr/mdec/bootfd usr/mdec/fdboot
40284SrgrimesMDEC+=		usr/mdec/bootsd usr/mdec/sdboot
41284SrgrimesMDEC+=		usr/mdec/bootwd usr/mdec/wdboot
42284Srgrimes#
431285SrgrimesKC_DIRS=	bin dev mnt sbin
44284SrgrimesKC_FILES=	${COPYRIGHT}
451194SrgrimesKC_FILES+=	bin/sh					# XXX Crunch is broken!
461285SrgrimesKC_FILES+=	sbin/mount sbin/mount_isofs		# XXX Crunch is broken!
471194SrgrimesKC_LINKS=	bin/[ bin/cp bin/echo bin/test
481285SrgrimesKC_LINKS+=	sbin/fsck sbin/halt sbin/init
491285SrgrimesKC_LINKS+=	sbin/umount
50284Srgrimes#
511194SrgrimesFILESYSTEM_DIRS=	bin dev etc mnt proc sbin usr usr/bin usr/mdec usr/sbin
52358SrgrimesFILESYSTEM_TREES=	dev
53358SrgrimesFILESYSTEM_FILES=	${COPYRIGHT}
541194SrgrimesFILESYSTEM_FILES+=	bin/sh				# XXX Crunch is broken!
55412SalmFILESYSTEM_FILES+=	dev/MAKEDEV
56358SrgrimesFILESYSTEM_FILES+=	etc/group
57452SrgrimesFILESYSTEM_FILES+=	etc/master.passwd etc/passwd etc/pwd.db
58358SrgrimesFILESYSTEM_FILES+=	${MDEC}
591194SrgrimesFILESYSTEM_LINKS=	bin/[ bin/expr bin/ls bin/mkdir bin/rm
601194SrgrimesFILESYSTEM_LINKS+=	bin/sync bin/test
611194SrgrimesFILESYSTEM_LINKS+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
621194SrgrimesFILESYSTEM_LINKS+=	sbin/mount sbin/mount_pcfs
631194SrgrimesFILESYSTEM_LINKS+=	sbin/newfs
641194SrgrimesFILESYSTEM_LINKS+=	sbin/umount
651194SrgrimesFILESYSTEM_LINKS+=	usr/bin/cpio
661194SrgrimesFILESYSTEM_LINKS+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
671194SrgrimesFILESYSTEM_LINKS+=	usr/sbin/bad144
681194SrgrimesFILESYSTEM_CPIO=	.profile
691194SrgrimesFILESYSTEM_CPIO+=	root/.profile
701194SrgrimesFILESYSTEM_CPIO+=	bin/[
711194SrgrimesFILESYSTEM_CPIO+=	bin/chmod bin/cat bin/cp bin/df bin/expr bin/ls
721194SrgrimesFILESYSTEM_CPIO+=	bin/ln bin/mkdir bin/mv bin/rm bin/sync
731194SrgrimesFILESYSTEM_CPIO+=	bin/test
741194SrgrimesFILESYSTEM_CPIO+=	etc/spwd.db
751194SrgrimesFILESYSTEM_CPIO+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
761194SrgrimesFILESYSTEM_CPIO+=	sbin/mount sbin/mount_pcfs
771194SrgrimesFILESYSTEM_CPIO+=	sbin/newfs
781194SrgrimesFILESYSTEM_CPIO+=	sbin/umount
791243SrgrimesFILESYSTEM_CPIO_DIRS=	root
80263Srgrimes
81358SrgrimesCPIO_FILES=	${COPYRIGHT}
821194SrgrimesCPIO_CPIO=	bin/dd bin/ps bin/pwd bin/stty
831194SrgrimesCPIO_CPIO+=	etc/protocols etc/remote etc/services
841194SrgrimesCPIO_CPIO+=	etc/termcap
851194SrgrimesCPIO_CPIO+=	sbin/dmesg
86452SrgrimesCPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod sbin/mount_isofs
871194SrgrimesCPIO_CPIO+=	sbin/mount_procfs
88452SrgrimesCPIO_CPIO+=	sbin/reboot sbin/route sbin/slattach
891194SrgrimesCPIO_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/cpio usr/bin/ex usr/bin/ftp
901194SrgrimesCPIO_CPIO+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip
91358SrgrimesCPIO_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
921194SrgrimesCPIO_CPIO+=	usr/bin/vi usr/bin/view usr/bin/zcat
931194SrgrimesCPIO_CPIO+=	usr/lib/libc.so.1.0
941194SrgrimesCPIO_CPIO+=	usr/lib/libcurses.so.1.0
951194SrgrimesCPIO_CPIO+=	usr/lib/libgcc.so.1.0
961194SrgrimesCPIO_CPIO+=	usr/lib/libm.so.1.0
971194SrgrimesCPIO_CPIO+=	usr/lib/libtermlib.so.1.0
981194SrgrimesCPIO_CPIO+=	usr/lib/libtermcap.so.1.0
991194SrgrimesCPIO_CPIO+=	usr/lib/libutil.so.1.0
1001243SrgrimesCPIO_CPIO+=	usr/libexec/ld.so
1011194SrgrimesCPIO_CPIO+=	usr/sbin/bad144 usr/sbin/chown
1021194SrgrimesCPIO_CPIO+=	usr/share/misc/termcap
1031243SrgrimesCPIO_CPIO_DIRS=		tmp usr/lib usr/libexec usr/share usr/share/misc
1041243SrgrimesCPIO_CPIO_DIRS+=	var var/tmp var/run var/spool var/spool/lock
105284Srgrimes
106347SrgrimesCRYPT_LIB=	lib/libcrypt
107372SrgrimesCRYPT_SRCS=	bin/ed bin/rcp
108372SrgrimesCRYPT_SRCS+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
109372SrgrimesCRYPT_SRCS+=	libexec/rshd libexec/telnetd libexec/uucpd
1101126SrgrimesCRYPT_SRCS+=	sbin/init.bsdi
111372SrgrimesCRYPT_SRCS+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
112372SrgrimesCRYPT_SRCS+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
1131126SrgrimesCRYPT_DIRS=	bin sbin usr usr/bin usr/lib usr/libexec 
114347Srgrimes
11537Srgrimesall clean cleandir depend etc install lint:
11637Srgrimes
117347Srgrimescrypt:
118347Srgrimes	rm -f ${LIBCRYPT};
119347Srgrimes	(cd ${.CURDIR}/../${CRYPT_LIB}; \
120355Srgrimes		${MAKE} cleandir obj depend all install)
121372Srgrimes	for i in ${CRYPT_SRCS}; do \
122347Srgrimes		cd ${.CURDIR}/../$$i; \
123355Srgrimes		${MAKE} cleandir obj depend all; \
124347Srgrimes	done
125347Srgrimes	
126347Srgrimesnon-crypt:
127347Srgrimes	rm -f ${LIBCRYPT}
128372Srgrimes	for i in ${CRYPT_SRCS}; do \
129347Srgrimes		cd ${.CURDIR}/../$$i; \
130355Srgrimes		${MAKE} cleandir obj depend all; \
131347Srgrimes	done
132347Srgrimes	
133147Srgrimesdistribution: distrib-dirs
13437Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
13537Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
136147Srgrimes	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
1371014Snate	install -c -o root -g wheel -m 644 crontab ${DESTDIR}/etc
138238Sroot	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
13937Srgrimes	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
140358Srgrimes	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
14137Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
14237Srgrimes	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
143347Srgrimes.if defined(CDROMDIST)
144147Srgrimes	(cd ${DESTDIR}/dev; sh MAKEDEV all)
145347Srgrimes.endif
14637Srgrimes	(cd root; \
14737Srgrimes		install -c -o root -g wheel -m 644 dot.cshrc \
14837Srgrimes		    ${DESTDIR}/root/.cshrc; \
14937Srgrimes		install -c -o root -g wheel -m 644 dot.klogin \
15037Srgrimes		    ${DESTDIR}/root/.klogin; \
15137Srgrimes		install -c -o root -g wheel -m 644 dot.login \
15237Srgrimes		    ${DESTDIR}/root/.login; \
15337Srgrimes		install -c -o root -g wheel -m 644 dot.profile \
15437Srgrimes		    ${DESTDIR}/root/.profile; \
15537Srgrimes		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
15637Srgrimes		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
15737Srgrimes		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
15837Srgrimes	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
15937Srgrimes	    ${DESTDIR}/etc/mtree
16037Srgrimes	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
16137Srgrimes	    ${DESTDIR}/etc/namedb
16237Srgrimes	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
16337Srgrimes	    ${DESTDIR}/etc/dumpdates
164147Srgrimes	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
165147Srgrimes	    ${DESTDIR}/var/db/locate.database
16637Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
167147Srgrimes	    ${DESTDIR}/var/log/lpd-errs
16837Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
16937Srgrimes	    ${DESTDIR}/var/log/maillog
17037Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
171288Srgrimes	    ${DESTDIR}/var/log/lastlog
172288Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
173147Srgrimes	    ${DESTDIR}/var/log/messages
17437Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
175147Srgrimes	    ${DESTDIR}/var/log/wtmp
176147Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
17737Srgrimes	    ${DESTDIR}/var/run/utmp
17837Srgrimes	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
179147Srgrimes	    fstab.* ${DESTDIR}/etc)
180347Srgrimes.if defined(NOCRYPT)
181355Srgrimes	${MAKE} non-crypt
182355Srgrimes	(cd ..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
183347Srgrimes.else
184355Srgrimes	${MAKE} crypt
185355Srgrimes	(cd ..; ${MAKE} install)
186347Srgrimes.endif
187277Srgrimes	(cd ../usr.sbin/sendmail/src; \
188355Srgrimes	    ${MAKE} install; \
189277Srgrimes	 cd ../cf/cf; \
1901126Srgrimes	    ${MAKE} obj; \
1911126Srgrimes	    ${MAKE} freefall.cf; \
1921133Srgrimes	    install -o root -g wheel -m 644 obj/freefall.cf \
193238Sroot	        ${DESTDIR}/etc/sendmail.cf)
194277Srgrimes	(cd ../; \
195277Srgrimes	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
196355Srgrimes	(cd ..; ${MAKE} mdec; )
197644Srgrimes	(cd ../share/man; ${MAKE} makedb; )
198333Srgrimes.if ${MACHINE} == "tahoe"
199333Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
200333Srgrimes	    ${DESTDIR}/)
201168Srgrimes.endif
202333Srgrimes.if ${MACHINE} == "vax"
203333Srgrimes	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
204333Srgrimes	    ${DESTDIR}/)
205333Srgrimes.endif
20637Srgrimes
20737Srgrimeshcx9-distribution:
20837Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
20937Srgrimes	    ${DESTDIR}/)
21037Srgrimes
211358Srgrimeskcopy-kernels: ../sys/i386/conf/GENERICAH ../sys/i386/conf/GENERICBT
212320Srgrimes	(cd ../sys/compile; rm -rf GENERICAH GENERICBT)
213320Srgrimes	(cd ../sys/i386/conf; config GENERICAH; config GENERICBT)
214355Srgrimes	(cd ../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
215320Srgrimes	    install -c -o root -g wheel -m 755 386bsd \
216320Srgrimes	        ${DESTDIR}/386bsd.GENERICAH)
217355Srgrimes	(cd ../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
218320Srgrimes	    install -c -o root -g wheel -m 755 386bsd \
219320Srgrimes	        ${DESTDIR}/386bsd.GENERICBT)
220320Srgrimes
221358Srgrimeskcopy-floppy:
222568Srgrimes	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
223568Srgrimes		/usr/mdec/fdboot /usr/mdec/bootfd
2241285Srgrimes	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space \
2251027Sache		r${FLOPPY} ${FLOPPY_TYPE}
2261027Sache	mount /dev/${FLOPPY} ${MOUNT}
227333Srgrimes	chown root.wheel ${MOUNT}/.
228333Srgrimes	chmod 755 ${MOUNT}/.
229284Srgrimes	(cd ${DESTDIR}/; \
230320Srgrimes	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
231277Srgrimes	(cd ${MOUNT}/dev; \
232277Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
233277Srgrimes	    rm -rf fd; \
2341285Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 wd1 sd0 sd1 cd0 mcd0; \
2351285Srgrimes	    rm -rf fd0?* rfd0?* fd1?* rfd1?*;)
236284Srgrimes	(cd ${DESTDIR}/; \
237320Srgrimes	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
238277Srgrimes	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
239277Srgrimes	    ${MOUNT}/.profile
2401194Srgrimes	install -c -o root -g wheel -m 755 ${RELEASEDIR}/distbin/kcopy \
2411194Srgrimes	    ${MOUNT}/bin/kcopy
2421194Srgrimes	(cd ${MOUNT}/; \
2431194Srgrimes	    for i in ${KC_LINKS}; do \
2441194Srgrimes		ln bin/kcopy $$i; \
2451194Srgrimes	    done)
246320Srgrimes
2471205Srgrimeskcopy_ah.flp:
248372Srgrimes	${MAKE} kcopy-floppy
249320Srgrimes	(cd ../sys/compile/GENERICAH; \
250277Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
251277Srgrimes	df -ik ${MOUNT}
2521027Sache	umount /dev/${FLOPPY}
2531027Sache	fsck /dev/r${FLOPPY}
2541205Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/kcopy_ah.flp \
255358Srgrimes		bs=15b count=160
2561205Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy_ah.flp \
2571205Srgrimes		>${RELEASEDIR}/floppies/kcopy_ah.flp.gz
258277Srgrimes
2591205Srgrimeskcopy_bt.flp:
260372Srgrimes	${MAKE} kcopy-floppy
261320Srgrimes	(cd ../sys/compile/GENERICBT; \
262320Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
263320Srgrimes	df -ik ${MOUNT}
2641027Sache	umount /dev/${FLOPPY}
2651027Sache	fsck /dev/r${FLOPPY}
2661205Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/kcopy_bt.flp \
267358Srgrimes		bs=15b count=160
2681205Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy_bt.flp \
2691205Srgrimes		>${RELEASEDIR}/floppies/kcopy_bt.flp.gz
270320Srgrimes
2711285Srgrimescdins-floppy:
2721285Srgrimes	${MAKE} kcopy-floppy
2731285Srgrimes	mkdir ${MOUNT}/cdrom
2741285Srgrimes	chown root.wheel ${MOUNT}/cdrom
2751285Srgrimes	chmod 755 ${MOUNT}/cdrom
2761285Srgrimes	install -c -o root -g wheel -m 755 etc.i386/cdinst1.profile \
2771285Srgrimes	    ${MOUNT}/.profile
2781285Srgrimes	install -c -o root -g wheel -m 755 etc.i386/cdinst1.install \
2791285Srgrimes	    ${MOUNT}/install
2801285Srgrimes	
2811285Srgrimescdins_ah.flp:
2821285Srgrimes	${MAKE} cdins-floppy
2831285Srgrimes	(cd ../sys/compile/GENERICAH; \
2841285Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
2851285Srgrimes	df -ik ${MOUNT}
2861285Srgrimes	umount /dev/${FLOPPY}
2871285Srgrimes	fsck /dev/r${FLOPPY}
2881285Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cdins_ah.flp \
2891285Srgrimes		bs=15b count=160
2901285Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cdins_ah.flp \
2911285Srgrimes		>${RELEASEDIR}/floppies/cdins_ah.flp.gz
2921285Srgrimes
2931285Srgrimescdins_bt.flp:
2941285Srgrimes	${MAKE} cdins-floppy
2951285Srgrimes	(cd ../sys/compile/GENERICBT; \
2961285Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
2971285Srgrimes	df -ik ${MOUNT}
2981285Srgrimes	umount /dev/${FLOPPY}
2991285Srgrimes	fsck /dev/r${FLOPPY}
3001285Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cdins_bt.flp \
3011285Srgrimes		bs=15b count=160
3021285Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cdins_bt.flp \
3031285Srgrimes		>${RELEASEDIR}/floppies/cdins_bt.flp.gz
3041285Srgrimes
3051205Srgrimesfilesyst.flp:
306568Srgrimes	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
307568Srgrimes		/usr/mdec/fdboot /usr/mdec/bootfd
308568Srgrimes	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space \
3091027Sache		r${FLOPPY}  ${FLOPPY_TYPE}
3101027Sache	mount /dev/${FLOPPY}  ${MOUNT}
311333Srgrimes	chown root.wheel ${MOUNT}/.
312333Srgrimes	chmod 755 ${MOUNT}/.
313284Srgrimes	(cd ${DESTDIR}/; \
314358Srgrimes	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
315284Srgrimes	(cd ${MOUNT}/dev; \
316284Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
317284Srgrimes	    rm -rf fd; \
318435Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 sd0 sd1; \
3191126Srgrimes	    rm -f fd0?* fd1?* rfd0?* rfd1?*)
320284Srgrimes	(cd ${DESTDIR}/; \
3211194Srgrimes	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT}; \
3221243Srgrimes	    (find ${FILESYSTEM_CPIO}; ls -d ${FILESYSTEM_CPIO_DIRS}) | \
3231194Srgrimes		cpio -H newc --block-size=16 -oav | \
3241194Srgrimes		gzip -9 >${MOUNT}/inst1.cpio.gz)
325284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
326284Srgrimes	    ${MOUNT}/.profile
327284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
328284Srgrimes	    ${MOUNT}/install
3291194Srgrimes	install -c -o root -g wheel -m 755 ${RELEASEDIR}/distbin/filesystem \
3301194Srgrimes	    ${MOUNT}/bin/filesystem
331284Srgrimes	(cd ${MOUNT}/; \
3321194Srgrimes	    for i in ${FILESYSTEM_LINKS}; do \
3331194Srgrimes		ln bin/filesystem $$i; \
3341194Srgrimes	    done)
3351194Srgrimes	(cd ${MOUNT}/; \
336358Srgrimes	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
3371194Srgrimes	    ls ${FILESYSTEM_LINKS} >>/tmp/filelist; \
338358Srgrimes	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
339358Srgrimes	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
3401243Srgrimes	    sort -u -r /tmp/filelist >filelist; \
341333Srgrimes	    rm /tmp/filelist)
342284Srgrimes	df -ik ${MOUNT}
3431027Sache	umount /dev/${FLOPPY}
3441027Sache	fsck /dev/r${FLOPPY}
3451205Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/filesyst.flp \
346358Srgrimes		bs=15b count=160
3471205Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesyst.flp \
3481205Srgrimes		>${RELEASEDIR}/floppies/filesyst.flp.gz
349284Srgrimes
3501205Srgrimescpio.flp:
351568Srgrimes	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
352568Srgrimes		/usr/mdec/fdboot /usr/mdec/bootfd
353568Srgrimes	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space \
3541027Sache			r${FLOPPY}  ${FLOPPY_TYPE}
3551027Sache	mount /dev/${FLOPPY} ${MOUNT}
356333Srgrimes	chown root.wheel ${MOUNT}/.
357333Srgrimes	chmod 755 ${MOUNT}/.
358284Srgrimes	(cd ${DESTDIR}/; \
359358Srgrimes		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
360284Srgrimes	(cd ${DESTDIR}/; \
361444Srgrimes	    (find ${CPIO_CPIO}; ls -d ${CPIO_CPIO_DIRS}) | \
3621194Srgrimes		cpio -H newc --block-size=16 -oav | \
3631194Srgrimes		gzip -9 >${MOUNT}/inst2.cpio.gz)
3641194Srgrimes	install -c -o root -g wheel -m 755 etc.i386/cpio.rc \
3651194Srgrimes	    ${MOUNT}/rc
3661194Srgrimes	install -c -o root -g wheel -m 755 etc.i386/cpio.install \
367284Srgrimes	    ${MOUNT}/install
3681194Srgrimes	install -c -o root -g wheel -m 755 etc.i386/cpio.magic \
3691194Srgrimes	    ${MOUNT}/magic
370284Srgrimes	df -ik ${MOUNT}
3711027Sache	umount /dev/${FLOPPY}
3721027Sache	fsck /dev/r${FLOPPY}
3731205Srgrimes	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cpio.flp \
374358Srgrimes		bs=15b count=160
3751205Srgrimes	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio.flp \
3761205Srgrimes		>${RELEASEDIR}/floppies/cpio.flp.gz
377284Srgrimes
378372Srgrimesbin-tarball:
379372Srgrimes	(cd ${DESTDIR}; \
380538Srgrimes		tar cf - . | \
381538Srgrimes		gzip --no-name -9 -c | \
382538Srgrimes		split -b 240640 - \
383538Srgrimes		${RELEASEDIR}/tarballs/bin_tgz.)
384372Srgrimes
385538Srgrimessrcbase-tarball:
386376Srgrimes	(cd ${DESTDIR}; \
387538Srgrimes		tar -cf - usr/src/[A-Z]* | \
388538Srgrimes		gzip --no-name -9 -c | \
389538Srgrimes		split -b 240640 - \
390538Srgrimes		${RELEASEDIR}/tarballs/srcbase_tgz.)
391376Srgrimes
392538Srgrimessrcbin-tarball:
393376Srgrimes	(cd ${DESTDIR}; \
394538Srgrimes		tar -cf - usr/src/bin | \
395538Srgrimes		gzip --no-name -9 -c | \
396538Srgrimes		split -b 240640 - \
397538Srgrimes		${RELEASEDIR}/tarballs/srcbin_tgz.)
398376Srgrimes
399538Srgrimessrccontrib-tarball:
400538Srgrimes	(cd ${DESTDIR}; \
401538Srgrimes		tar -cf - usr/src/contrib | \
402538Srgrimes		gzip --no-name -9 -c | \
403538Srgrimes		split -b 240640 - \
404538Srgrimes		${RELEASEDIR}/tarballs/srccontrib_tgz.)
405538Srgrimes
406538Srgrimessrcetc-tarball:
407538Srgrimes	(cd ${DESTDIR}; \
408538Srgrimes		tar -cf - usr/src/etc | \
409538Srgrimes		gzip --no-name -9 -c | \
410538Srgrimes		split -b 240640 - \
411538Srgrimes		${RELEASEDIR}/tarballs/srcetc_tgz.)
412538Srgrimes
413538Srgrimessrcgames-tarball:
414538Srgrimes	(cd ${DESTDIR}; \
415538Srgrimes		tar -cf - usr/src/games | \
416538Srgrimes		gzip --no-name -9 -c | \
417538Srgrimes		split -b 240640 - \
418538Srgrimes		${RELEASEDIR}/tarballs/srcgames_tgz.)
419538Srgrimes
420538Srgrimessrcgnu-tarball:
421538Srgrimes	(cd ${DESTDIR}; \
422538Srgrimes		tar -cf - usr/src/gnu | \
423538Srgrimes		gzip --no-name -9 -c | \
424538Srgrimes		split -b 240640 - \
425538Srgrimes		${RELEASEDIR}/tarballs/srcgnu_tgz.)
426538Srgrimes
427538Srgrimessrcinclude-tarball:
428538Srgrimes	(cd ${DESTDIR}; \
429538Srgrimes		tar -cf - usr/src/include | \
430538Srgrimes		gzip --no-name -9 -c | \
431538Srgrimes		split -b 240640 - \
432538Srgrimes		${RELEASEDIR}/tarballs/srcinclude_tgz.)
433538Srgrimes
434538Srgrimessrclib-tarball:
435538Srgrimes	(cd ${DESTDIR}; \
436538Srgrimes		tar --exclude usr/src/${CRYPT_LIB} -cf - usr/src/lib | \
437538Srgrimes		gzip --no-name -9 -c | \
438538Srgrimes		split -b 240640 - \
439538Srgrimes		${RELEASEDIR}/tarballs/srclib_tgz.)
440538Srgrimes
441538Srgrimessrclibcrypt-tarball:
442538Srgrimes	(cd ${DESTDIR}; \
443538Srgrimes		tar -cf - usr/src/${CRYPT_LIB} | \
444538Srgrimes		gzip --no-name -9 -c | \
445538Srgrimes		split -b 240640 - \
446538Srgrimes		${RELEASEDIR}/tarballs/srclibcrypt_tgz.)
447538Srgrimes
448538Srgrimessrclibexec-tarball:
449538Srgrimes	(cd ${DESTDIR}; \
450538Srgrimes		tar -cf - usr/src/libexec | \
451538Srgrimes		gzip --no-name -9 -c | \
452538Srgrimes		split -b 240640 - \
453538Srgrimes		${RELEASEDIR}/tarballs/srclibexec_tgz.)
454538Srgrimes
455538Srgrimessrcsbin-tarball:
456538Srgrimes	(cd ${DESTDIR}; \
457538Srgrimes		tar -cf - usr/src/sbin | \
458538Srgrimes		gzip --no-name -9 -c | \
459538Srgrimes		split -b 240640 - \
460538Srgrimes		${RELEASEDIR}/tarballs/srcsbin_tgz.)
461538Srgrimes
462538Srgrimessrcshare-tarball:
463538Srgrimes	(cd ${DESTDIR}; \
464538Srgrimes		tar -cf - usr/src/share | \
465538Srgrimes		gzip --no-name -9 -c | \
466538Srgrimes		split -b 240640 - \
467538Srgrimes		${RELEASEDIR}/tarballs/srcshare_tgz.)
468538Srgrimes
469538Srgrimessrcsys-tarball:
470538Srgrimes	(cd ${DESTDIR}; \
471538Srgrimes		tar -cf - usr/src/sys | \
472538Srgrimes		gzip --no-name -9 -c | \
473538Srgrimes		split -b 240640 - \
474538Srgrimes		${RELEASEDIR}/tarballs/srcsys_tgz.)
475538Srgrimes
476538Srgrimessrcusrbin-tarball:
477538Srgrimes	(cd ${DESTDIR}; \
478538Srgrimes		tar -cf - usr/src/usr.bin | \
479538Srgrimes		gzip --no-name -9 -c | \
480538Srgrimes		split -b 240640 - \
481538Srgrimes		${RELEASEDIR}/tarballs/srcusrbin_tgz.)
482538Srgrimes
483538Srgrimessrcusrsbin-tarball:
484538Srgrimes	(cd ${DESTDIR}; \
485538Srgrimes		tar -cf - usr/src/usr.sbin | \
486538Srgrimes		gzip --no-name -9 -c | \
487538Srgrimes		split -b 240640 - \
488538Srgrimes		${RELEASEDIR}/tarballs/srcusrsbin_tgz.)
489538Srgrimes
490538Srgrimessrc-tarball: srcbase-tarball srcbin-tarball srccontrib-tarball srcetc-tarball \
491538Srgrimes	srcgames-tarball srcgnu-tarball srcinclude-tarball srclib-tarball \
492538Srgrimes	srclibcrypt-tarball srclibexec-tarball srcsbin-tarball \
493538Srgrimes	srcshare-tarball srcsys-tarball srcusrbin-tarball \
494538Srgrimes	srcusrsbin-tarball
495538Srgrimes
496372Srgrimesdes-tarball:
497372Srgrimes	rm -rf ${RELEASEDIR}/tmpdes
498372Srgrimes	mkdir ${RELEASEDIR}/tmpdes
499372Srgrimes	for i in ${CRYPT_DIRS}; do \
500372Srgrimes		cd ${RELEASEDIR}/tmpdes; \
501372Srgrimes		mkdir $$i; \
502372Srgrimes		chown ${BINOWN}.${GRPOWN} $$i; \
503372Srgrimes		chmod 755 $$i; \
504372Srgrimes	done
505372Srgrimes	# This is ugly, it force installs a /usr/lib/libcrypt.a so
506372Srgrimes	# that the other makes will be built with des.
507372Srgrimes	#
508372Srgrimes	(cd ${.CURDIR}/../${CRYPT_LIB}; \
509372Srgrimes		unset NOCRYPT; \
510372Srgrimes		DESTDIR=; export DESTDIR; \
511372Srgrimes		${MAKE} cleandir obj depend all install; \
512372Srgrimes		NOMAN=noman; export NOMAN; \
513372Srgrimes		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
514372Srgrimes		${MAKE} cleandir obj depend all install)
515372Srgrimes	for i in ${CRYPT_SRCS}; do \
516372Srgrimes		unset NOCRYPT; \
517372Srgrimes		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
518372Srgrimes		NOMAN=noman; export NOMAN; \
519372Srgrimes		cd ${.CURDIR}/../$$i; \
520372Srgrimes		${MAKE} cleandir obj depend all install; \
521372Srgrimes	done
522372Srgrimes	(cd ${RELEASEDIR}/tmpdes; \
523538Srgrimes		tar cf - . | \
524538Srgrimes			gzip --no-name -9 -c | \
525372Srgrimes			split -b 240640 - \
526436Srgrimes			${RELEASEDIR}/tarballs/des_tgz.)
527372Srgrimes	rm -rf ${RELEASEDIR}/tmpdes
528372Srgrimes
529147Srgrimesdistrib-dirs:
530238Sroot	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
531147Srgrimes	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
532147Srgrimes	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
533372Srgrimes.if defined(CDROMDIST)
534372Srgrimes	mtree -u -f mtree/BSD.local.dist -p ${DESTDIR}/usr/local
535372Srgrimes.endif
536410Srgrimes	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
537147Srgrimes
5381285Srgrimesfloppies:	kcopy_ah.flp kcopy_bt.flp filesyst.flp cpio.flp \
5391285Srgrimes		cdins_ah.flp cdins_bt.flp
540372Srgrimes
5411285Srgrimesrelease:	release-dirs distribution kcopy-kernels floppies \
5421285Srgrimes		bin-tarball des-tarball
543372Srgrimes	
544372Srgrimesrelease-dirs:
545994Srgrimes	rm -rf ${RELEASEDIR}/filesys
546994Srgrimes	mkdir ${RELEASEDIR}/filesys
547994Srgrimes	chown root.wheel ${RELEASEDIR}/filesys
548994Srgrimes	chmod 755 ${RELEASEDIR}/filesys
549372Srgrimes	rm -rf ${RELEASEDIR}/tarballs
550372Srgrimes	mkdir ${RELEASEDIR}/tarballs
551372Srgrimes	chown root.wheel ${RELEASEDIR}/tarballs
552372Srgrimes	chmod 755 ${RELEASEDIR}/tarballs
553372Srgrimes	rm -rf ${RELEASEDIR}/floppies
554372Srgrimes	mkdir ${RELEASEDIR}/floppies
555372Srgrimes	chown root.wheel ${RELEASEDIR}/floppies
556372Srgrimes	chmod 755 ${RELEASEDIR}/floppies
557372Srgrimes
55837Srgrimes.include <bsd.prog.mk>
559