Makefile revision 1782
117680Spst#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
239300Sfenner#	$Id: Makefile,v 1.74 1994/06/28 05:37:04 jkh Exp $
317680Spst
417680Spst# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
517680Spst# -rw-r--r--
617680SpstBINOWN= root
717680SpstBINGRP= wheel
817680SpstBIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
917680Spst	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
1017680Spst	inetd.conf login.access motd myname netstart \
1117680Spst	networks phones printcap protocols rc rc.local remote \
1217680Spst	security services shells skey.access \
1317680Spst	syslog.conf ttys etc.${MACHINE}/disktab rpc make.conf \
1417680Spst	${.CURDIR}/../gnu/usr.bin/man/manpath/manpath.config \
1517680Spst	${.CURDIR}/../usr.bin/mail/misc/mail.rc
1617680Spst
1717680Spst# -rw-rw-rw-
1817680SpstBIN2=	motd
1917680Spst
2017680Spst# -rwxr-xr-x root.wheel, for the new cron root.wheel
2117680SpstBIN3=	daily weekly monthly
2256896Sfenner
2356896SfennerCLEANFILES+= *.o *.lo *.c *.cache *.mk kcopy filesystem
2417680Spst
2526183SfennerZIPNSPLIT=	gzip --no-name -9 -c | split -b 240640 -
2617680Spst
27127675SbmsMTREE=	BSD.local.dist BSD.root.dist BSD.usr.dist BSD.var.dist
28127675SbmsNAMEDB=	localhost.rev named.boot root.cache
2917680SpstPCS=	pcs750.bin
3017680SpstWCS1=	wcs fppwcs poc poc1 poc2 fppoc
3156896SfennerWCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
3256896Sfenner
3356896Sfenner# Special top level files for FreeBSD
3456896SfennerCOPYRIGHT=	COPYRIGHT.386BSD COPYRIGHT.FreeBSD
35127675SbmsFREEBSD=	CONTRIB.386BSD CONTRIB.FreeBSD ROSTER.FreeBSD
3617680SpstFREEBSD+=	MIRROR.SITES PERSONAL.ACKS RELNOTES.FreeBSD SUPPORT.TXT
3717680SpstFREEBSD+=	${COPYRIGHT}
3817680Spst#
3917680Spst# Floppy drive name and files for building FreeBSD Floppies
4098527SfennerFLOPPY?=	fd0
4117680SpstMOUNT?=		/mnt
4217680SpstFLOPPY_TYPE?=	fd1200
4317680Spst#
4417680SpstMDEC=		usr/mdec/bootfd usr/mdec/fdboot
4517680SpstMDEC+=		usr/mdec/bootsd usr/mdec/sdboot
4617680SpstMDEC+=		usr/mdec/bootwd usr/mdec/wdboot
4717680Spst#
4817680SpstKC_DIRS=	bin dev mnt sbin
4917680SpstKC_FILES=	${COPYRIGHT}
5017680SpstKC_LINKS=	bin/[ bin/cp bin/echo bin/sh bin/test
5117680SpstKC_LINKS+=	sbin/fsck sbin/halt sbin/init
5217680SpstKC_LINKS+=	sbin/mount sbin/mount_isofs
5317680SpstKC_LINKS+=	sbin/umount
5417680Spst#
5517680SpstCD_DIRS=	etc usr
5617680Spst#
5717680SpstFILESYSTEM_DIRS=	bin dev etc mnt proc sbin usr usr/bin usr/mdec usr/sbin
5817680SpstFILESYSTEM_TREES=	dev
5975118SfennerFILESYSTEM_FILES=	${COPYRIGHT}
6075118SfennerFILESYSTEM_FILES+=	dev/MAKEDEV
6175118SfennerFILESYSTEM_FILES+=	etc/group
6275118SfennerFILESYSTEM_FILES+=	etc/master.passwd etc/passwd etc/pwd.db
6375118SfennerFILESYSTEM_FILES+=	${MDEC}
6475118SfennerFILESYSTEM_LINKS=	bin/[ bin/expr bin/ls bin/mkdir bin/rm
6575118SfennerFILESYSTEM_LINKS+=	bin/sh bin/sync bin/test
6617680SpstFILESYSTEM_LINKS+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
6717680SpstFILESYSTEM_LINKS+=	sbin/mount sbin/mount_pcfs
6817680SpstFILESYSTEM_LINKS+=	sbin/newfs
6917680SpstFILESYSTEM_LINKS+=	sbin/umount
7017680SpstFILESYSTEM_LINKS+=	usr/bin/cpio
7117680SpstFILESYSTEM_LINKS+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
7217680SpstFILESYSTEM_LINKS+=	usr/sbin/bad144
7317680SpstFILESYSTEM_CPIO=	.profile
7417680SpstFILESYSTEM_CPIO+=	root/.profile
7517680SpstFILESYSTEM_CPIO+=	bin/[
7617680SpstFILESYSTEM_CPIO+=	bin/chmod bin/cat bin/cp bin/df bin/expr bin/ls
7717680SpstFILESYSTEM_CPIO+=	bin/ln bin/mkdir bin/mv bin/rm bin/sync
7817680SpstFILESYSTEM_CPIO+=	bin/test
7917680SpstFILESYSTEM_CPIO+=	etc/spwd.db
8017680SpstFILESYSTEM_CPIO+=	sbin/disklabel sbin/fdisk sbin/halt sbin/init
8117680SpstFILESYSTEM_CPIO+=	sbin/mount sbin/mount_pcfs
8217680SpstFILESYSTEM_CPIO+=	sbin/newfs
8317680SpstFILESYSTEM_CPIO+=	sbin/umount
8498527SfennerFILESYSTEM_CPIO_DIRS=	root
8598527Sfenner
86127675SbmsCPIO_FILES=	${COPYRIGHT}
87127675SbmsCPIO_CPIO=	bin/dd bin/ps bin/pwd bin/stty
8898527SfennerCPIO_CPIO+=	etc/protocols etc/remote etc/services
89127675SbmsCPIO_CPIO+=	etc/termcap
9098527SfennerCPIO_CPIO+=	sbin/dmesg
9198527SfennerCPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod sbin/mount_isofs
9298527SfennerCPIO_CPIO+=	sbin/mount_procfs
9375118SfennerCPIO_CPIO+=	sbin/reboot sbin/route sbin/slattach
9417680SpstCPIO_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/cpio usr/bin/ex usr/bin/ftp
95127675SbmsCPIO_CPIO+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip
9675118SfennerCPIO_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
9717680SpstCPIO_CPIO+=	usr/bin/vi usr/bin/view usr/bin/zcat
9817680SpstCPIO_CPIO+=	usr/lib/libc.so.1.1
9917680SpstCPIO_CPIO+=	usr/lib/libcurses.so.1.1
10017680SpstCPIO_CPIO+=	usr/lib/libgcc.so.1.1
10117680SpstCPIO_CPIO+=	usr/lib/libm.so.1.1
102127675SbmsCPIO_CPIO+=	usr/lib/libtermlib.so.1.1
10317680SpstCPIO_CPIO+=	usr/lib/libtermcap.so.1.1
10417690SpstCPIO_CPIO+=	usr/lib/libutil.so.1.1
105111729SfennerCPIO_CPIO+=	usr/libexec/ld.so
106111729SfennerCPIO_CPIO+=	usr/sbin/bad144 usr/sbin/chown
107111729SfennerCPIO_CPIO+=	usr/share/misc/termcap
108111729SfennerCPIO_CPIO_DIRS=		tmp usr/lib usr/libexec usr/share usr/share/misc
109111729SfennerCPIO_CPIO_DIRS+=	var var/tmp var/run var/spool var/spool/lock
110111729Sfenner
111111729SfennerCRYPT_LIB=	lib/libcrypt
112111729SfennerCRYPT_SRCS=	bin/ed bin/rcp
11398527SfennerCRYPT_SRCS+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
11417680SpstCRYPT_SRCS+=	libexec/rshd libexec/telnetd libexec/uucpd
11517680SpstCRYPT_SRCS+=	sbin/init.bsdi
11617690SpstCRYPT_SRCS+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
11717690SpstCRYPT_SRCS+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
11817690SpstCRYPT_DIRS=	bin sbin usr usr/bin usr/lib usr/libexec 
11917690Spst
12017690Spstall depend etc install lint:
12117690Spst
122127675Sbmscrypt:
12317680Spst	rm -f ${LIBCRYPT};
12417680Spst	(cd ${.CURDIR}/../${CRYPT_LIB}; \
12517680Spst		${MAKE} cleandir obj depend all install)
12617680Spst	for i in ${CRYPT_SRCS}; do \
12717680Spst		cd ${.CURDIR}/../$$i; \
128127675Sbms		${MAKE} cleandir obj depend all; \
12917680Spst	done
13017680Spst	
13117680Spstnon-crypt:
13217680Spst	rm -f ${LIBCRYPT}
13317680Spst	for i in ${CRYPT_SRCS}; do \
13417680Spst		cd ${.CURDIR}/../$$i; \
13517680Spst		${MAKE} cleandir obj depend all; \
13617680Spst	done
137127675Sbms	
13817680Spstdistribution: distrib-dirs
13917680Spst	(cd ${.CURDIR}; \
14017680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc; \
14117680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc; \
14217680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 ${BIN3} ${DESTDIR}/etc; \
14317680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 644 crontab ${DESTDIR}/etc; \
144127675Sbms	install -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
14517680Spst	    ${DESTDIR}/var/cron/log; \
14617680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 600 \
14717680Spst	    master.passwd ${DESTDIR}/etc; \
14817680Spst	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd; \
14917680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
15017680Spst	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev )
15117680Spst.if defined(CDROMDIST)
15217680Spst	(cd ${DESTDIR}/dev; sh MAKEDEV all) ;
15317680Spst.endif
15417680Spst	(cd ${.CURDIR}/root; \
155127675Sbms		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.cshrc \
15617680Spst		    ${DESTDIR}/root/.cshrc; \
15717680Spst		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.klogin \
15817680Spst		    ${DESTDIR}/root/.klogin; \
15917680Spst		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.login \
16017680Spst		    ${DESTDIR}/root/.login; \
16117680Spst		install -c -o ${BINOWN} -g ${BINGRP} -m 644 dot.profile \
16217680Spst		    ${DESTDIR}/root/.profile; \
16317680Spst		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
16417680Spst		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
16517680Spst		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
16617680Spst	cd ${.CURDIR}/mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
16717680Spst	    ${MTREE} ${DESTDIR}/etc/mtree
16817680Spst	cd ${.CURDIR}/namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 \
16917680Spst	    ${NAMEDB} ${DESTDIR}/etc/namedb
170127675Sbms	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
17117680Spst	    ${DESTDIR}/etc/dumpdates
17217680Spst	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
17375118Sfenner	    ${DESTDIR}/var/db/locate.database
17475118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
17575118Sfenner	    ${DESTDIR}/var/log/lpd-errs
17675118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
17775118Sfenner	    ${DESTDIR}/var/log/maillog
17875118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
17975118Sfenner	    ${DESTDIR}/var/log/lastlog
18075118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
18175118Sfenner	    ${DESTDIR}/var/log/messages
18275118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
18375118Sfenner	    ${DESTDIR}/var/log/wtmp
18475118Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
18598527Sfenner	    ${DESTDIR}/var/run/utmp
18698527Sfenner	install -c -o ${BINOWN} -g ${BINGRP} -m 664 ${.CURDIR}/minfree \
18775118Sfenner	    ${DESTDIR}/var/crash
18875118Sfenner	(cd ${.CURDIR}/etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} \
18975118Sfenner	    -m 444 fstab.* ${DESTDIR}/etc)
19075118Sfenner.if defined(NOCRYPT)
19175118Sfenner	(cd ${.CURDIR}; ${MAKE} non-crypt)
19275118Sfenner	(cd ${.CURDIR}/..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
19375118Sfenner.else
19475118Sfenner	(cd ${.CURDIR}; ${MAKE} crypt)
19575118Sfenner	(cd ${.CURDIR}/..; ${MAKE} install)
19675118Sfenner.endif
19775118Sfenner	(cd ${.CURDIR}/../usr.sbin/sendmail/src; \
19875118Sfenner	    ${MAKE} install; \
19975118Sfenner	 cd ../cf/cf; \
20017680Spst	    ${MAKE} obj; \
20117680Spst	    ${MAKE} freefall.cf; \
20217680Spst	    install -o ${BINOWN} -g ${BINGRP} -m 644 obj/freefall.cf \
20317680Spst	        ${DESTDIR}/etc/sendmail.cf)
20417680Spst	(cd ${.CURDIR}/..; \
20517680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${FREEBSD} ${DESTDIR}/)
20617680Spst	(cd ${.CURDIR}/..; ${MAKE} mdec; )
20717680Spst	(cd ${.CURDIR}/../share/man; ${MAKE} makedb; )
20817680Spst.if ${MACHINE} == "tahoe"
20917680Spst	(cd ${.CURDIR}/etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} \
210127675Sbms	    -m 444 ${WCS1} ${DESTDIR}/)
211127675Sbms.endif
21217680Spst.if ${MACHINE} == "vax"
213127675Sbms	(cd ${.CURDIR}/etc.vax; install -c -o ${BINOWN} -g ${BINGRP} \
21417680Spst	    -m 444 ${PCS} ${DESTDIR}/)
21517680Spst.endif
21617680Spst
21717680Spstcrunch:
21817680Spst	crunchgen ${.CURDIR}/../contrib/crunch/examples/kcopy.conf
21917680Spst	${MAKE} -f kcopy.mk objs exe
22017680Spst	crunchgen ${.CURDIR}/../contrib/crunch/examples/filesystem.conf
22117680Spst	${MAKE} -f filesystem.mk objs exe
22217690Spst
22317680Spstextract:
22417680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
22517680Spst	    ${.CURDIR}/etc.i386/EXTRACT_bin.sh ${RELEASEDIR}/tarballs/bindist
22617680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
22717680Spst	    ${.CURDIR}/etc.i386/EXTRACT_src.sh ${RELEASEDIR}/tarballs/srcdist
22817680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
22917680Spst	    ${.CURDIR}/etc.i386/EXTRACT_secr.sh ${RELEASEDIR}/tarballs/secrdist
23075118Sfenner
231127675Sbmshcx9-distribution:
232127675Sbms	(cd ${.CURDIR}/etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} \
23317680Spst	    -m 444 ${WCS2} ${DESTDIR}/)
23417680Spst
23575118Sfennerkcopy-kernels: ${.CURDIR}/../sys/i386/conf/GENERICAH ${.CURDIR}/../sys/i386/conf/GENERICBT
23675118Sfenner	(cd ${.CURDIR}/../sys/compile; rm -rf GENERICAH GENERICBT)
23775118Sfenner	(cd ${.CURDIR}/../sys/i386/conf; config GENERICAH; config GENERICBT)
23817680Spst	(cd ${.CURDIR}/../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
23917680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd \
24017680Spst	        ${DESTDIR}/386bsd.GENERICAH)
24117680Spst	(cd ${.CURDIR}/../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
24217680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd \
24317680Spst	        ${DESTDIR}/386bsd.GENERICBT)
24417680Spst
24517680Spstkcopy-floppy:
24617680Spst	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
24717680Spst		${DESTDIR}/usr/mdec/fdboot ${DESTDIR}/usr/mdec/bootfd
24817680Spst	newfs -b 4096 -c 80 -f 512 -i 8192 -m 0 -o space \
24917680Spst		r${FLOPPY} ${FLOPPY_TYPE}
25017680Spst	mount /dev/${FLOPPY} ${MOUNT}
25117680Spst	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
25217680Spst	chmod 755 ${MOUNT}/.
25317680Spst	(cd ${DESTDIR}/; \
25417680Spst	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
25517680Spst	(cd ${MOUNT}/dev; \
25617680Spst	    sh ${DESTDIR}/dev/MAKEDEV std; \
25717680Spst	    rm -rf fd; \
25817680Spst	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 wd1 sd0 sd1; \
25917680Spst	    rm -rf fd0?* rfd0?* fd1?* rfd1?*; \
26017680Spst	    sh ${DESTDIR}/dev/MAKEDEV cd0 mcd0 mcd1; \
26117680Spst	    rm -rf rmcd*)
26217680Spst	(cd ${DESTDIR}/; \
26317680Spst	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
26417680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
26517680Spst	    ${.CURDIR}/etc.i386/kc.profile ${MOUNT}/.profile
26617680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
26717680Spst	    kcopy ${MOUNT}/bin/kcopy
26817680Spst	(cd ${MOUNT}/; \
26917680Spst	    for i in ${KC_LINKS}; do \
27017680Spst		ln bin/kcopy $$i; \
27117680Spst	    done)
27217680Spst
27317680Spstkcopy_ah.flp:
27417680Spst	${MAKE} kcopy-floppy
27517680Spst	(cd ${.CURDIR}/../sys/compile/GENERICAH; \
27617680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd ${MOUNT}/)
27717680Spst	df -ik ${MOUNT}
27817680Spst	umount /dev/${FLOPPY}
27917680Spst	fsck /dev/r${FLOPPY}
28017680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/kcopy_ah.flp \
28117680Spst		bs=15b count=160
28217680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy_ah.flp \
28317680Spst		>${RELEASEDIR}/floppies/kcopy_ah.flp.gz &
28417680Spst
28517680Spstkcopy_bt.flp:
28617680Spst	${MAKE} kcopy-floppy
28717680Spst	(cd ${.CURDIR}/../sys/compile/GENERICBT; \
28817680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd ${MOUNT}/)
28917680Spst	df -ik ${MOUNT}
29017680Spst	umount /dev/${FLOPPY}
29117680Spst	fsck /dev/r${FLOPPY}
29217680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/kcopy_bt.flp \
29317680Spst		bs=15b count=160
29417680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy_bt.flp \
29517680Spst		>${RELEASEDIR}/floppies/kcopy_bt.flp.gz &
29617680Spst
29717680Spstcdins-floppy:
29817680Spst	${MAKE} kcopy-floppy
29917680Spst	(cd ${DESTDIR}/; \
30017680Spst	    ls -d ${CD_DIRS} | cpio -pdamuv ${MOUNT})
30117680Spst	(cd ${MOUNT}/usr; \
30217680Spst	    ln -s /cdrom/filesys/usr/libexec libexec; \
30317680Spst	    ln -s /cdrom/filesys/usr/lib lib)
30417680Spst	mkdir ${MOUNT}/cdrom
30517680Spst	chown ${BINOWN}.${BINGRP} ${MOUNT}/cdrom
30617680Spst	chmod 755 ${MOUNT}/cdrom
30717680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
30817680Spst	    ${.CURDIR}/etc.i386/cdinst1.profile ${MOUNT}/.profile
30917680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
31017680Spst	    ${.CURDIR}/etc.i386/cdinst1.install ${MOUNT}/install
31117680Spst	
31217680Spstcdins_ah.flp:
31317680Spst	${MAKE} cdins-floppy
31417680Spst	(cd ${.CURDIR}/../sys/compile/GENERICAH; \
31517680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd ${MOUNT}/)
31617680Spst	df -ik ${MOUNT}
31717680Spst	umount /dev/${FLOPPY}
31817680Spst	fsck /dev/r${FLOPPY}
31917680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cdins_ah.flp \
32017680Spst		bs=15b count=160
32117680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cdins_ah.flp \
32217680Spst		>${RELEASEDIR}/floppies/cdins_ah.flp.gz &
32317680Spst
32417680Spstcdins_bt.flp:
32517680Spst	${MAKE} cdins-floppy
32617680Spst	(cd ${.CURDIR}/../sys/compile/GENERICBT; \
32717680Spst	    install -c -o ${BINOWN} -g ${BINGRP} -m 755 386bsd ${MOUNT}/)
32817680Spst	df -ik ${MOUNT}
32917680Spst	umount /dev/${FLOPPY}
33017680Spst	fsck /dev/r${FLOPPY}
33117680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cdins_bt.flp \
33217680Spst		bs=15b count=160
33317680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cdins_bt.flp \
33417680Spst		>${RELEASEDIR}/floppies/cdins_bt.flp.gz &
33517680Spst
33617680Spstfilesyst.flp:
33717680Spst	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
33817680Spst		${DESTDIR}/usr/mdec/fdboot ${DESTDIR}/usr/mdec/bootfd
33917680Spst	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space \
34017680Spst		r${FLOPPY}  ${FLOPPY_TYPE}
34117680Spst	mount /dev/${FLOPPY}  ${MOUNT}
34217680Spst	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
34317680Spst	chmod 755 ${MOUNT}/.
34417680Spst	(cd ${DESTDIR}/; \
34517680Spst	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
34617680Spst	(cd ${MOUNT}/dev; \
34717680Spst	    sh ${DESTDIR}/dev/MAKEDEV std; \
34817680Spst	    rm -rf fd; \
34917680Spst	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 sd0 sd1; \
35017680Spst	    rm -f fd0?* fd1?* rfd0?* rfd1?*)
35117680Spst	(cd ${DESTDIR}/; \
35217680Spst	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT}; \
35317680Spst	    (find ${FILESYSTEM_CPIO}; ls -d ${FILESYSTEM_CPIO_DIRS}) | \
35417680Spst		cpio -H newc --block-size=16 -oav | \
35517680Spst		gzip -9 >${MOUNT}/inst1.cpio.gz)
35617680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
35717680Spst	    ${.CURDIR}/etc.i386/inst1.profile ${MOUNT}/.profile
35817680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
35917680Spst	    ${.CURDIR}/etc.i386/inst1.install ${MOUNT}/install
36017680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
36117680Spst	    filesystem ${MOUNT}/bin/filesystem
36217680Spst	(cd ${MOUNT}/; \
36317680Spst	    for i in ${FILESYSTEM_LINKS}; do \
36417680Spst		ln bin/filesystem $$i; \
36517680Spst	    done)
36617680Spst	(cd ${MOUNT}/; \
36717680Spst	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
36817680Spst	    ls ${FILESYSTEM_LINKS} >>/tmp/filelist; \
36917680Spst	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
37017680Spst	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
37117680Spst	    sort -u -r /tmp/filelist >filelist; \
37217680Spst	    rm /tmp/filelist)
37317680Spst	df -ik ${MOUNT}
37417680Spst	umount /dev/${FLOPPY}
37517680Spst	fsck /dev/r${FLOPPY}
37617680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/filesyst.flp \
37717680Spst		bs=15b count=160
37817680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesyst.flp \
37917680Spst		>${RELEASEDIR}/floppies/filesyst.flp.gz &
38017680Spst
38117680Spstcpio.flp:
38217680Spst	disklabel -w -r ${FLOPPY} ${FLOPPY_TYPE} \
38317680Spst		${DESTDIR}/usr/mdec/fdboot ${DESTDIR}/usr/mdec/bootfd
38417680Spst	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space \
38517680Spst			r${FLOPPY}  ${FLOPPY_TYPE}
38617680Spst	mount /dev/${FLOPPY} ${MOUNT}
38798527Sfenner	chown ${BINOWN}.${BINGRP} ${MOUNT}/.
38817680Spst	chmod 755 ${MOUNT}/.
38917680Spst	(cd ${DESTDIR}/; \
39017680Spst		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
391111729Sfenner	# This ugliness is because the default termcap file is simply too
392111729Sfenner	# big and we don't need such a hugh one for the initial installation,
393111729Sfenner	# yet we want the symlink in /etc to point to the right place so we
394111729Sfenner	# need to install the smaller one in the same location.  Same goes
395111729Sfenner	# for the elvis hackery; just trying to bum as many bytes as we can
39617680Spst	# here, and that's rarely a very pretty process.
39717680Spst	mv ${DESTDIR}/usr/share/misc/termcap ${DESTDIR}/usr/share/misc/otermcap
39817680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
39917680Spst	    ${.CURDIR}/termcap.small ${DESTDIR}/usr/share/misc/termcap
40017680Spst	# Use cp so we don't destroy the links.
40117680Spst	cp ${DESTDIR}/usr/bin/ex ${DESTDIR}/usr/bin/ex.bak
40217680Spst	cp ${DESTDIR}/usr/bin/elvis ${DESTDIR}/usr/bin/ex
40317680Spst	(cd ${DESTDIR}/; \
40417680Spst	    (find ${CPIO_CPIO}; ls -d ${CPIO_CPIO_DIRS}) | \
40517680Spst		cpio -H newc --block-size=16 -oav | \
40617680Spst		gzip -9 >${MOUNT}/inst2.cpio.gz)
40717680Spst	# cpio is done, put everything back in shape for the bindist.
40817680Spst	mv ${DESTDIR}/usr/share/misc/otermcap ${DESTDIR}/usr/share/misc/termcap
40917680Spst	cp ${DESTDIR}/usr/bin/ex.bak ${DESTDIR}/usr/bin/ex
41017680Spst	rm ${DESTDIR}/usr/bin/ex.bak
41117680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
41217680Spst	    ${.CURDIR}/etc.i386/cpio.rc ${MOUNT}/rc
41317680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
41417680Spst	    ${.CURDIR}/etc.i386/cpio.install ${MOUNT}/install
41517680Spst	install -c -o ${BINOWN} -g ${BINGRP} -m 755 \
41617680Spst	    ${.CURDIR}/etc.i386/cpio.magic ${MOUNT}/magic
41717680Spst	df -ik ${MOUNT}
41817680Spst	umount /dev/${FLOPPY}
41917680Spst	fsck /dev/r${FLOPPY}
42017680Spst	dd if=/dev/r${FLOPPY} of=${RELEASEDIR}/floppies/cpio.flp \
42117680Spst		bs=15b count=160
42217680Spst	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio.flp \
42317680Spst		>${RELEASEDIR}/floppies/cpio.flp.gz &
42417680Spst
42517680Spstbin-tarball:
42617680Spst	(cd ${DESTDIR}; \
42717680Spst		tar cf - . | \
42817680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/bindist/bin_tgz.)
42917680Spst
43017680Spstsrc-clean:
43117680Spst	(cd ${DESTDIR}/usr/src; make cleandist)
43217680Spst	chown -R bin:bin ${DESTDIR}/usr/src
43317680Spst	chmod -R og-w ${DESTDIR}/usr/src
43417680Spst
43517680Spstsrcbase-tarball:
43617680Spst	(cd ${DESTDIR}; \
43717680Spst		tar --exclude CVS -cf - usr/src/[A-Z]* | \
43817680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/base.)
43917680Spst
44017680Spstsrcbin-tarball:
44117680Spst	(cd ${DESTDIR}; \
44217680Spst		tar --exclude CVS -cf - usr/src/bin | \
44317680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/bin.)
44417680Spst
44517680Spstsrccontrib-tarball:
44617680Spst	(cd ${DESTDIR}; \
44717680Spst		tar --exclude CVS -cf - usr/src/contrib | \
44817680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/contrib.)
44917680Spst
45017680Spstsrcetc-tarball:
45117680Spst	(cd ${DESTDIR}; \
45217680Spst		tar --exclude CVS -cf - usr/src/etc | \
45317680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/etc.)
45417680Spst
45517680Spstsrcgames-tarball:
45617680Spst	(cd ${DESTDIR}; \
45717680Spst		tar --exclude CVS -cf - usr/src/games | \
45817680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/games.)
45917680Spst
46017680Spstsrcgnu-tarball:
46117680Spst	(cd ${DESTDIR}; \
46217680Spst		tar --exclude CVS -cf - usr/src/gnu | \
46339300Sfenner		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/gnu.)
46439300Sfenner
46517680Spstsrcinclude-tarball:
46617680Spst	(cd ${DESTDIR}; \
46739300Sfenner		tar --exclude CVS -cf - usr/src/include | \
46898527Sfenner		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/include.)
46917680Spst
47017680Spstsrclib-tarball:
47117680Spst	(cd ${DESTDIR}; \
47217680Spst		tar --exclude usr/src/${CRYPT_LIB} --exclude CVS -cf - \
47317680Spst		usr/src/lib | \
47417680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/lib.)
47517680Spst
47617680Spstsrclibcrypt-tarball:
47717680Spst	(cd ${DESTDIR}; \
47817680Spst		tar --exclude CVS -cf - usr/src/${CRYPT_LIB} | \
47917680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/secrdist/libcrypt.)
48017680Spst
48117680Spstsrclibexec-tarball:
48217680Spst	(cd ${DESTDIR}; \
48317680Spst		tar --exclude CVS -cf - usr/src/libexec | \
48417680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/libexec.)
48517680Spst
48617680Spstsrcsbin-tarball:
48717680Spst	(cd ${DESTDIR}; \
48817680Spst		tar --exclude CVS -cf - usr/src/sbin | \
48917680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/sbin.)
49017680Spst
49117680Spstsrcshare-tarball:
49217680Spst	(cd ${DESTDIR}; \
49317680Spst		tar --exclude CVS -cf - usr/src/share | \
49417680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/share.)
49517680Spst
49617680Spstsrcsys-tarball:
49717680Spst	(cd ${DESTDIR}; \
49817680Spst		tar --exclude CVS -cf - usr/src/sys | \
49917680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/sys.)
50017680Spst
50117680Spstsrcusrbin-tarball:
50217680Spst	(cd ${DESTDIR}; \
50317680Spst		tar --exclude CVS -cf - usr/src/usr.bin | \
50417680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/usrbin.)
50517680Spst
50617680Spstsrcusrsbin-tarball:
50717680Spst	(cd ${DESTDIR}; \
50817680Spst		tar --exclude CVS -cf - usr/src/usr.sbin | \
50917680Spst		${ZIPNSPLIT} ${RELEASEDIR}/tarballs/srcdist/usrsbin.)
51017680Spst
51117680Spstsrc-tarball: src-clean srcbase-tarball srcbin-tarball srccontrib-tarball \
51217680Spst	srcetc-tarball srcgames-tarball srcgnu-tarball srcinclude-tarball \
51317680Spst	srclib-tarball srclibcrypt-tarball srclibexec-tarball srcsbin-tarball \
51417680Spst	srcshare-tarball srcsys-tarball srcusrbin-tarball srcusrsbin-tarball
51517680Spst
51617680Spstdes-tarball:
51717680Spst	rm -rf ${RELEASEDIR}/tmpdes
51817680Spst	mkdir ${RELEASEDIR}/tmpdes
51917680Spst	for i in ${CRYPT_DIRS}; do \
52017680Spst		cd ${RELEASEDIR}/tmpdes; \
52117680Spst		mkdir $$i; \
52217680Spst		chown ${BINOWN}.${GRPOWN} $$i; \
52317680Spst		chmod 755 $$i; \
52417680Spst	done
52517680Spst	# This is ugly, it force installs a /usr/lib/libcrypt.a so
52617680Spst	# that the other makes will be built with des.
52717680Spst	#
52817680Spst	(cd ${.CURDIR}/../${CRYPT_LIB}; \
52917680Spst		unset NOCRYPT; \
53017680Spst		DESTDIR=; export DESTDIR; \
53117680Spst		${MAKE} cleandir obj depend all install; \
53217680Spst		NOMAN=noman; export NOMAN; \
53317680Spst		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
53417680Spst		${MAKE} cleandir obj depend all install)
53517680Spst	for i in ${CRYPT_SRCS}; do \
53617680Spst		unset NOCRYPT; \
53717680Spst		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
53817680Spst		NOMAN=noman; export NOMAN; \
53917680Spst		cd ${.CURDIR}/../$$i; \
54017680Spst		${MAKE} cleandir obj depend all install; \
54117680Spst	done
54217680Spst	(cd ${RELEASEDIR}/tmpdes; \
54317680Spst		tar cf - . | \
54417680Spst			${ZIPNSPLIT} ${RELEASEDIR}/tarballs/secrdist/des_tgz.)
54566644Skris	rm -rf ${RELEASEDIR}/tmpdes
54617680Spst
54717680Spstdistrib-dirs:
54817680Spst	mtree -u -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/
54917680Spst	mtree -u -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var
55017680Spst	mtree -u -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr
55117680Spst.if defined(CDROMDIST)
55217680Spst	mtree -u -f ${.CURDIR}/mtree/BSD.local.dist -p ${DESTDIR}/usr/local
55317680Spst.endif
55417680Spst	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
55517680Spst
55675118Sfennerfloppies:	kcopy_ah.flp kcopy_bt.flp filesyst.flp cpio.flp \
55717680Spst		cdins_ah.flp cdins_bt.flp
55817680Spst
55917680Spstrelease:	release-dirs distribution crunch extract kcopy-kernels \
56017680Spst		floppies bin-tarball des-tarball clean
56175118Sfenner
56275118Sfennerrelease-dirs:
56317680Spst	rm -rf ${RELEASEDIR}/filesys
56475118Sfenner	mkdir ${RELEASEDIR}/filesys
56575118Sfenner	chown ${BINOWN}.${BINGRP} ${RELEASEDIR}/filesys
56675118Sfenner	chmod 755 ${RELEASEDIR}/filesys
56717680Spst	rm -rf ${RELEASEDIR}/tarballs
56875118Sfenner	mkdir ${RELEASEDIR}/tarballs
56917680Spst	mkdir ${RELEASEDIR}/tarballs/bindist
57017680Spst	mkdir ${RELEASEDIR}/tarballs/objdist
57117680Spst	mkdir ${RELEASEDIR}/tarballs/secrdist
57218241Spst	mkdir ${RELEASEDIR}/tarballs/srcdist
57317680Spst	chown -R ${BINOWN}.${BINGRP} ${RELEASEDIR}/tarballs
57417680Spst	chmod -R 755 ${RELEASEDIR}/tarballs
57518241Spst	rm -rf ${RELEASEDIR}/floppies
57617680Spst	mkdir ${RELEASEDIR}/floppies
57798527Sfenner	chown ${BINOWN}.${BINGRP} ${RELEASEDIR}/floppies
57817680Spst	chmod 755 ${RELEASEDIR}/floppies
57917680Spst
58017680Spst.include <bsd.prog.mk>
58117680Spst