Makefile revision 355
137Srgrimes#	@(#)Makefile	5.11 (Berkeley) 5/21/91
237Srgrimes
337SrgrimesNOOBJ=	oobj
437Srgrimes
537Srgrimes# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
637Srgrimes# -rw-r--r--
7147SrgrimesBINOWN= root
8147SrgrimesBINGRP= wheel
9147SrgrimesBIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
10207Snate	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
11258Srgrimes	inetd.conf motd myname netstart phones \
12147Srgrimes	printcap protocols rc rc.local remote security services shells \
13147Srgrimes	syslog.conf ttys etc.${MACHINE}/disktab rpc
1437Srgrimes
1537Srgrimes# -rw-rw-rw-
1637SrgrimesBIN2=	motd
1737Srgrimes
18147Srgrimes# -rwxr-xr-x root.wheel, for the new f***ing cron root.wheel
19147SrgrimesBIN3=	daily weekly monthly
20147Srgrimes
2137SrgrimesMTREE=	BSD.root.dist BSD.usr.dist BSD.var.dist
2237SrgrimesNAMEDB=	localhost.rev named.boot root.cache
2337SrgrimesPCS=	pcs750.bin
2437SrgrimesWCS1=	wcs fppwcs poc poc1 poc2 fppoc
2537SrgrimesWCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
2637Srgrimes
27263Srgrimes# Special top level files for FreeBSD
28284SrgrimesCOPYRIGHT= COPYRIGHT
29355SrgrimesFREEBSD= CONTRIB.386BSD CONTRIB.FreeBSD RELNOTES.FreeBSD ${COPYRIGHT}
30277Srgrimes#
31277Srgrimes# Floppy drive name and files for building FreeBSD Floppies
32284SrgrimesFLOPPY?=	fd0
33284SrgrimesMOUNT=		/mnt
34284Srgrimes#
35284SrgrimesMDEC=		usr/mdec/bootfd usr/mdec/fdboot
36284SrgrimesMDEC+=		usr/mdec/bootsd usr/mdec/sdboot
37284SrgrimesMDEC+=		usr/mdec/bootwd usr/mdec/wdboot
38284Srgrimes#
39284SrgrimesKC_DIRS=	dev mnt
40284SrgrimesKC_FILES=	${COPYRIGHT}
41284SrgrimesKC_FILES+=	bin/[ bin/cp bin/echo bin/sh bin/test
42284SrgrimesKC_FILES+=	sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
43284Srgrimes#
44333SrgrimesINST1_DIRS=	bin dev etc mnt sbin usr usr/bin usr/mdec usr/sbin
45333SrgrimesINST1_TREES=	dev
46284SrgrimesINST1_FILES=	${COPYRIGHT}
47333SrgrimesINST1_FILES+=	bin/[ bin/cat bin/expr bin/ls bin/mkdir
48333Srgrimes#INST1_FILES+=	bin/df
49284SrgrimesINST1_FILES+=	bin/sh bin/sync bin/test
50284SrgrimesINST1_FILES+=	dev/MAKEDEV dev/MAKEDEV.local
51333Srgrimes#INST1_FILES+=	etc/disktab
52333SrgrimesINST1_FILES+=	etc/group etc/master.passwd etc/passwd
53284SrgrimesINST1_FILES+=	etc/pwd.db etc/spwd.db
54284SrgrimesINST1_FILES+=	sbin/disklabel sbin/halt sbin/init sbin/mount sbin/umount
55333SrgrimesINST1_FILES+=	sbin/mount_pcfs sbin/newfs sbin/reboot
56284SrgrimesINST1_FILES+=	usr/bin/cpio
57284SrgrimesINST1_FILES+=	${MDEC}
58284SrgrimesINST1_FILES+=	usr/sbin/bad144
59263Srgrimes
60284SrgrimesINST2_FILES=	${COPYRIGHT}
61284SrgrimesINST2_FILES+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
62284SrgrimesINST2_CPIO=	bin/chmod bin/cp bin/dd bin/mv bin/pwd bin/rm bin/stty
63284SrgrimesINST2_CPIO+=	etc/protocols etc/services
64284SrgrimesINST2_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod
65284Srgrimes#INST2_CPIO+=	sbin/mount_pcfs sbin/mount_isofs
66284SrgrimesINST2_CPIO+=	sbin/route sbin/shutdown sbin/slattach
67284SrgrimesINST2_CPIO+=	tmp
68284SrgrimesINST2_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/ftp
69333SrgrimesINST2_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
70284SrgrimesINST2_CPIO+=	usr/bin/elvis usr/bin/ex usr/bin/vi usr/bin/view
71284Srgrimes#INST2_CPIO+=	usr/local/bin/mread usr/local/bin/rz
72284SrgrimesINST2_CPIO+=	usr/sbin/update usr/sbin/chown
73284SrgrimesINST2_CPIO+=	var
74284Srgrimes
75347SrgrimesCRYPT_LIB=	lib/libcrypt
76347SrgrimesCRYPT_FILES=	bin/ed bin/rcp
77347SrgrimesCRYPT_FILES+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
78347SrgrimesCRYPT_FILES+=	libexec/rshd libexec/telnetd libexec/uucpd
79347SrgrimesCRYPT_FILES+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
80347SrgrimesCRYPT_FILES+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
81347Srgrimes
8237Srgrimesall clean cleandir depend etc install lint:
8337Srgrimes
84347Srgrimescrypt:
85347Srgrimes	rm -f ${LIBCRYPT};
86347Srgrimes	(cd ${.CURDIR}/../${CRYPT_LIB}; \
87355Srgrimes		${MAKE} cleandir obj depend all install)
88347Srgrimes	for i in ${CRYPT_FILES}; do \
89347Srgrimes		cd ${.CURDIR}/../$$i; \
90355Srgrimes		${MAKE} cleandir obj depend all; \
91347Srgrimes	done
92347Srgrimes	
93347Srgrimesnon-crypt:
94347Srgrimes	rm -f ${LIBCRYPT}
95347Srgrimes	for i in ${CRYPT_FILES}; do \
96347Srgrimes		cd ${.CURDIR}/../$$i; \
97355Srgrimes		${MAKE} cleandir obj depend all; \
98347Srgrimes	done
99347Srgrimes	
100147Srgrimesdistribution: distrib-dirs
10137Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
10237Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
103147Srgrimes	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
104147Srgrimes	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
105238Sroot	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
10637Srgrimes	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
107163Srgrimes	#
108238Sroot	# This is broken, it always does /etc. It IGNORES the ${DESTDIR} for 
109163Srgrimes	# where to write the spwd.db pwd.db files.  
110163Srgrimes	#(cd ${DESTDIR}/etc; pwd_mkdb -p master.passwd)
111163Srgrimes	#
112163Srgrimes	# Work around for above problem.
113163Srgrimes	install -c -o root -g wheel -m 644 pwd.db ${DESTDIR}/etc
114163Srgrimes	install -c -o root -g wheel -m 600 spwd.db ${DESTDIR}/etc
115284Srgrimes	install -c -o root -g wheel -m 644 passwd ${DESTDIR}/etc
11637Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
11737Srgrimes	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
118347Srgrimes.if defined(CDROMDIST)
119147Srgrimes	(cd ${DESTDIR}/dev; sh MAKEDEV all)
120347Srgrimes.endif
12137Srgrimes	(cd root; \
12237Srgrimes		install -c -o root -g wheel -m 644 dot.cshrc \
12337Srgrimes		    ${DESTDIR}/root/.cshrc; \
12437Srgrimes		install -c -o root -g wheel -m 644 dot.klogin \
12537Srgrimes		    ${DESTDIR}/root/.klogin; \
12637Srgrimes		install -c -o root -g wheel -m 644 dot.login \
12737Srgrimes		    ${DESTDIR}/root/.login; \
12837Srgrimes		install -c -o root -g wheel -m 644 dot.profile \
12937Srgrimes		    ${DESTDIR}/root/.profile; \
13037Srgrimes		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
13137Srgrimes		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
13237Srgrimes		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
13337Srgrimes	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
13437Srgrimes	    ${DESTDIR}/etc/mtree
13537Srgrimes	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
13637Srgrimes	    ${DESTDIR}/etc/namedb
13737Srgrimes	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
13837Srgrimes	    ${DESTDIR}/etc/dumpdates
139147Srgrimes	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
140147Srgrimes	    ${DESTDIR}/var/db/locate.database
14137Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
142147Srgrimes	    ${DESTDIR}/var/log/lpd-errs
14337Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
14437Srgrimes	    ${DESTDIR}/var/log/maillog
14537Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
146288Srgrimes	    ${DESTDIR}/var/log/lastlog
147288Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
148147Srgrimes	    ${DESTDIR}/var/log/messages
14937Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
150147Srgrimes	    ${DESTDIR}/var/log/wtmp
151147Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
15237Srgrimes	    ${DESTDIR}/var/run/utmp
15337Srgrimes	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
154147Srgrimes	    fstab.* ${DESTDIR}/etc)
155347Srgrimes.if defined(NOCRYPT)
156355Srgrimes	${MAKE} non-crypt
157355Srgrimes	(cd ..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
158347Srgrimes.else
159355Srgrimes	${MAKE} crypt
160355Srgrimes	(cd ..; ${MAKE} install)
161347Srgrimes.endif
162277Srgrimes	(cd ../usr.sbin/sendmail/src; \
163355Srgrimes	    ${MAKE} install; \
164277Srgrimes	 cd ../cf/cf; \
165355Srgrimes	    ${MAKE} tcpproto.cf; \
166238Sroot	    install -o root -g wheel -m 644 tcpproto.cf \
167238Sroot	        ${DESTDIR}/etc/sendmail.cf)
168277Srgrimes	(cd ../; \
169277Srgrimes	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
170355Srgrimes	(cd ..; ${MAKE} mdec; )
171333Srgrimes.if ${MACHINE} == "tahoe"
172333Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
173333Srgrimes	    ${DESTDIR}/)
174168Srgrimes.endif
175333Srgrimes.if ${MACHINE} == "vax"
176333Srgrimes	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
177333Srgrimes	    ${DESTDIR}/)
178333Srgrimes.endif
17937Srgrimes
18037Srgrimeshcx9-distribution:
18137Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
18237Srgrimes	    ${DESTDIR}/)
18337Srgrimes
184320Srgrimeskc-kernels: ../sys/i386/conf/GENERICAH ../sys/i386/conf/GENERICBT
185320Srgrimes	(cd ../sys/compile; rm -rf GENERICAH GENERICBT)
186320Srgrimes	(cd ../sys/i386/conf; config GENERICAH; config GENERICBT)
187355Srgrimes	(cd ../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
188320Srgrimes	    install -c -o root -g wheel -m 755 386bsd \
189320Srgrimes	        ${DESTDIR}/386bsd.GENERICAH)
190355Srgrimes	(cd ../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
191320Srgrimes	    install -c -o root -g wheel -m 755 386bsd \
192320Srgrimes	        ${DESTDIR}/386bsd.GENERICBT)
193320Srgrimes
194320Srgrimeskc-floppy:
195277Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
196277Srgrimes	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
197277Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
198333Srgrimes	chown root.wheel ${MOUNT}/.
199333Srgrimes	chmod 755 ${MOUNT}/.
200284Srgrimes	(cd ${DESTDIR}/; \
201320Srgrimes	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
202277Srgrimes	(cd ${MOUNT}/dev; \
203277Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
204277Srgrimes	    rm -rf fd; \
205333Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
206284Srgrimes	(cd ${DESTDIR}/; \
207320Srgrimes	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
208277Srgrimes	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
209277Srgrimes	    ${MOUNT}/.profile
210320Srgrimes
211320Srgrimeskc-ah-floppy: kc-floppy
212320Srgrimes	(cd ../sys/compile/GENERICAH; \
213277Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
214277Srgrimes	df -ik ${MOUNT}
215277Srgrimes	umount /dev/${FLOPPY}a
216277Srgrimes	fsck /dev/r${FLOPPY}a
217277Srgrimes
218320Srgrimeskc-bt-floppy: kc-floppy
219320Srgrimes	(cd ../sys/compile/GENERICBT; \
220320Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
221320Srgrimes	df -ik ${MOUNT}
222320Srgrimes	umount /dev/${FLOPPY}a
223320Srgrimes	fsck /dev/r${FLOPPY}a
224320Srgrimes
225284Srgrimesinst1-floppy:
226284Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
227284Srgrimes	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
228284Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
229333Srgrimes	chown root.wheel ${MOUNT}/.
230333Srgrimes	chmod 755 ${MOUNT}/.
231284Srgrimes	(cd ${DESTDIR}/; \
232320Srgrimes	    ls -d ${INST1_DIRS} | cpio -pdamuv ${MOUNT})
233284Srgrimes	(cd ${MOUNT}/dev; \
234284Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
235284Srgrimes	    rm -rf fd; \
236333Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
237284Srgrimes	(cd ${DESTDIR}/; \
238320Srgrimes	    ls ${INST1_FILES} | cpio -pdamuv ${MOUNT})
239284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
240284Srgrimes	    ${MOUNT}/.profile
241284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
242284Srgrimes	    ${MOUNT}/install
243284Srgrimes	(cd ${MOUNT}/; \
244284Srgrimes	    ls ${INST1_FILES} >/tmp/filelist; \
245333Srgrimes	    ls -d ${INST1_DIRS} >>/tmp/filelist; \
246333Srgrimes	    find ${INST1_TREES} >>/tmp/filelist; \
247333Srgrimes	    sort -u /tmp/filelist >filelist; \
248333Srgrimes	    rm /tmp/filelist)
249284Srgrimes	df -ik ${MOUNT}
250284Srgrimes	umount /dev/${FLOPPY}a
251284Srgrimes	fsck /dev/r${FLOPPY}a
252284Srgrimes
253284Srgrimesinst2-floppy:
254284Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
255284Srgrimes	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
256284Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
257333Srgrimes	chown root.wheel ${MOUNT}/.
258333Srgrimes	chmod 755 ${MOUNT}/.
259284Srgrimes	(cd ${DESTDIR}/; \
260320Srgrimes	    ls ${INST2_FILES} | cpio -pdamuv ${MOUNT})
261284Srgrimes	(cd ${DESTDIR}/; \
262333Srgrimes	    find ${INST2_CPIO} | cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
263284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
264284Srgrimes	    ${MOUNT}/.profile
265284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
266284Srgrimes	    ${MOUNT}/install
267284Srgrimes	df -ik ${MOUNT}
268284Srgrimes	umount /dev/${FLOPPY}a
269284Srgrimes	fsck /dev/r${FLOPPY}a
270284Srgrimes
271147Srgrimesdistrib-dirs:
272238Sroot	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
273147Srgrimes	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
274147Srgrimes	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
275147Srgrimes	(cd ${DESTDIR}; rm -f ${DESTDIR}/sys; \
276196Snate	    ln -s usr/src/sys sys )
277147Srgrimes
27837Srgrimes.include <bsd.prog.mk>
279