Makefile revision 284
137Srgrimes#	@(#)Makefile	5.11 (Berkeley) 5/21/91
237Srgrimes
3147SrgrimesLOCALTIME=	US/Pacific
4147SrgrimesTZDIR=/usr/share/zoneinfo
5147Srgrimes
637SrgrimesNOOBJ=	oobj
737Srgrimes
837Srgrimes# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
937Srgrimes# -rw-r--r--
10147SrgrimesBINOWN= root
11147SrgrimesBINGRP= wheel
12147SrgrimesBIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
13207Snate	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
14258Srgrimes	inetd.conf motd myname netstart phones \
15147Srgrimes	printcap protocols rc rc.local remote security services shells \
16147Srgrimes	syslog.conf ttys etc.${MACHINE}/disktab rpc
1737Srgrimes
1837Srgrimes# -rw-rw-rw-
1937SrgrimesBIN2=	motd
2037Srgrimes
21147Srgrimes# -rwxr-xr-x root.wheel, for the new f***ing cron root.wheel
22147SrgrimesBIN3=	daily weekly monthly
23147Srgrimes
2437SrgrimesMTREE=	BSD.root.dist BSD.usr.dist BSD.var.dist
2537SrgrimesNAMEDB=	localhost.rev named.boot root.cache
2637SrgrimesPCS=	pcs750.bin
2737SrgrimesWCS1=	wcs fppwcs poc poc1 poc2 fppoc
2837SrgrimesWCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
2937Srgrimes
30263Srgrimes# Special top level files for FreeBSD
31284SrgrimesCOPYRIGHT= COPYRIGHT
32284SrgrimesFREEBSD= CONTRIB.386BSD CONTRIB.FreeBSD ${COPYRIGHT}
33277Srgrimes#
34277Srgrimes# Floppy drive name and files for building FreeBSD Floppies
35284SrgrimesFLOPPY?=	fd0
36284SrgrimesMOUNT=		/mnt
37284Srgrimes#
38284SrgrimesMDEC=		usr/mdec/bootfd usr/mdec/fdboot
39284SrgrimesMDEC+=		usr/mdec/bootsd usr/mdec/sdboot
40284SrgrimesMDEC+=		usr/mdec/bootwd usr/mdec/wdboot
41284Srgrimes#
42284SrgrimesKC_DIRS=	dev mnt
43284SrgrimesKC_FILES=	${COPYRIGHT}
44284SrgrimesKC_FILES+=	bin/[ bin/cp bin/echo bin/sh bin/test
45284SrgrimesKC_FILES+=	sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
46284Srgrimes#
47284SrgrimesINST1_DIRS=	dev mnt
48284SrgrimesINST1_FILES=	${COPYRIGHT}
49284SrgrimesINST1_FILES+=	bin/[ bin/cat bin/df bin/expr bin/ls bin/mkdir
50284SrgrimesINST1_FILES+=	bin/sh bin/sync bin/test
51284SrgrimesINST1_FILES+=	dev/MAKEDEV dev/MAKEDEV.local
52284SrgrimesINST1_FILES+=	etc/disktab 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
55284SrgrimesINST1_FILES+=	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
69284SrgrimesINST2_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip usr/bin/zcat
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
7537Srgrimesall clean cleandir depend etc install lint:
7637Srgrimes
77147Srgrimesdistribution: distrib-dirs
7837Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
7937Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
80147Srgrimes	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
81147Srgrimes	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
82238Sroot	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
8337Srgrimes	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
84163Srgrimes	#
85238Sroot	# This is broken, it always does /etc. It IGNORES the ${DESTDIR} for 
86163Srgrimes	# where to write the spwd.db pwd.db files.  
87163Srgrimes	#(cd ${DESTDIR}/etc; pwd_mkdb -p master.passwd)
88163Srgrimes	#
89163Srgrimes	# Work around for above problem.
90163Srgrimes	install -c -o root -g wheel -m 644 pwd.db ${DESTDIR}/etc
91163Srgrimes	install -c -o root -g wheel -m 600 spwd.db ${DESTDIR}/etc
92284Srgrimes	install -c -o root -g wheel -m 644 passwd ${DESTDIR}/etc
9337Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
9437Srgrimes	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
95147Srgrimes	(cd ${DESTDIR}/dev; sh MAKEDEV all)
9637Srgrimes	(cd root; \
9737Srgrimes		install -c -o root -g wheel -m 644 dot.cshrc \
9837Srgrimes		    ${DESTDIR}/root/.cshrc; \
9937Srgrimes		install -c -o root -g wheel -m 644 dot.klogin \
10037Srgrimes		    ${DESTDIR}/root/.klogin; \
10137Srgrimes		install -c -o root -g wheel -m 644 dot.login \
10237Srgrimes		    ${DESTDIR}/root/.login; \
10337Srgrimes		install -c -o root -g wheel -m 644 dot.profile \
10437Srgrimes		    ${DESTDIR}/root/.profile; \
10537Srgrimes		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
10637Srgrimes		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
10737Srgrimes		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
10837Srgrimes	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
10937Srgrimes	    ${DESTDIR}/etc/mtree
11037Srgrimes	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
11137Srgrimes	    ${DESTDIR}/etc/namedb
112147Srgrimes	/bin/rm -f ${DESTDIR}/etc/localtime
113147Srgrimes	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
11437Srgrimes	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
11537Srgrimes	    ${DESTDIR}/etc/dumpdates
116147Srgrimes	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
117147Srgrimes	    ${DESTDIR}/var/db/locate.database
11837Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
119147Srgrimes	    ${DESTDIR}/var/log/lpd-errs
12037Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
12137Srgrimes	    ${DESTDIR}/var/log/maillog
12237Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
123284Srgrimes	    ${DESTDIR}/var/log/lastlog
124284Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
125147Srgrimes	    ${DESTDIR}/var/log/messages
12637Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
127147Srgrimes	    ${DESTDIR}/var/log/wtmp
128147Srgrimes	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
12937Srgrimes	    ${DESTDIR}/var/run/utmp
13037Srgrimes	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
131147Srgrimes	    fstab.* ${DESTDIR}/etc)
13237Srgrimes.if ${MACHINE} == "tahoe"
13337Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
13437Srgrimes	    ${DESTDIR}/)
13537Srgrimes.endif
13637Srgrimes.if ${MACHINE} == "vax"
13737Srgrimes	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
13837Srgrimes	    ${DESTDIR}/)
13937Srgrimes.endif
140168Srgrimes.if ${MACHINE} == "i386"
141277Srgrimes	(cd ../sys/i386/boot; \
142277Srgrimes	    make depend all install cleandir)
143284Srgrimes	(cd /; \
144284Srgrimes	    ls ${MDEC} | cpio -pdalmuv ${DESTDIR}/)
145277Srgrimes	(cd ../usr.sbin/sendmail/src; \
146277Srgrimes	    make install; \
147277Srgrimes	 cd ../cf/cf; \
148277Srgrimes	    make tcpproto.cf; \
149238Sroot	    install -o root -g wheel -m 644 tcpproto.cf \
150238Sroot	        ${DESTDIR}/etc/sendmail.cf)
151277Srgrimes	(cd ../; \
152277Srgrimes	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
153168Srgrimes	(cd ..; make install)
154277Srgrimes	(cd ../sys/compile; rm -rf GENERICISA)
155277Srgrimes	(cd ../sys/i386/conf; config GENERICISA)
156277Srgrimes	(cd ../sys/compile/GENERICISA; make depend; make all; \
157277Srgrimes	    install -c -o root -g wheel -m 755 386bsd \
158277Srgrimes	        ${DESTDIR}/386bsd.GENERICISA)
159266Srgrimes	(cd ../include; make copies)
160168Srgrimes.endif
16137Srgrimes
16237Srgrimeshcx9-distribution:
16337Srgrimes	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
16437Srgrimes	    ${DESTDIR}/)
16537Srgrimes
166284Srgrimeskc-ah-floppy:
167277Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
168277Srgrimes	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
169277Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
170284Srgrimes	(cd ${DESTDIR}/; \
171284Srgrimes	    ls -d ${KC_DIRS} | cpio -pdalmuv ${MOUNT})
172277Srgrimes	(cd ${MOUNT}/dev; \
173277Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
174277Srgrimes	    rm -rf fd; \
175277Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0)
176284Srgrimes	(cd ${DESTDIR}/; \
177284Srgrimes	    ls ${KC_FILES} | cpio -pdalmuv ${MOUNT})
178277Srgrimes	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
179277Srgrimes	    ${MOUNT}/.profile
180277Srgrimes	(cd ../sys/compile/GENERICISA; \
181277Srgrimes	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
182277Srgrimes	df -ik ${MOUNT}
183277Srgrimes	umount /dev/${FLOPPY}a
184277Srgrimes	fsck /dev/r${FLOPPY}a
185277Srgrimes
186284Srgrimesinst1-floppy:
187284Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
188284Srgrimes	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
189284Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
190284Srgrimes	(cd ${DESTDIR}/; \
191284Srgrimes	    ls -d ${INST1_DIRS} | cpio -pdalmuv ${MOUNT})
192284Srgrimes	(cd ${MOUNT}/dev; \
193284Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV std; \
194284Srgrimes	    rm -rf fd; \
195284Srgrimes	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0)
196284Srgrimes	(cd ${DESTDIR}/; \
197284Srgrimes	    ls ${INST1_FILES} | cpio -pdalmuv ${MOUNT})
198284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
199284Srgrimes	    ${MOUNT}/.profile
200284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
201284Srgrimes	    ${MOUNT}/install
202284Srgrimes	(cd ${MOUNT}/; \
203284Srgrimes	    ls ${INST1_FILES} >/tmp/filelist; \
204284Srgrimes	    find ${INST1_DIRS} | sort >>/tmp/filelist; \
205284Srgrimes	    sort -u /tmp/filelist >filelist)
206284Srgrimes	df -ik ${MOUNT}
207284Srgrimes	umount /dev/${FLOPPY}a
208284Srgrimes	fsck /dev/r${FLOPPY}a
209284Srgrimes
210284Srgrimesinst2-floppy:
211284Srgrimes	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
212284Srgrimes	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
213284Srgrimes	mount /dev/${FLOPPY}a ${MOUNT}
214284Srgrimes	(cd ${DESTDIR}/; \
215284Srgrimes	    ls ${INST2_FILES} | cpio -pdalmuv ${MOUNT})
216284Srgrimes	(cd ${DESTDIR}/; \
217284Srgrimes	    find ${INST2_CPIO} | cpio -odalmuv | gzip -9 >${MOUNT}/inst2.cpio.gz)
218284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
219284Srgrimes	    ${MOUNT}/.profile
220284Srgrimes	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
221284Srgrimes	    ${MOUNT}/install
222284Srgrimes	df -ik ${MOUNT}
223284Srgrimes	umount /dev/${FLOPPY}a
224284Srgrimes	fsck /dev/r${FLOPPY}a
225284Srgrimes
226147Srgrimesdistrib-dirs:
227238Sroot	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
228147Srgrimes	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
229147Srgrimes	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
230147Srgrimes	(cd ${DESTDIR}; rm -f ${DESTDIR}/sys; \
231196Snate	    ln -s usr/src/sys sys )
232147Srgrimes
23337Srgrimes.include <bsd.prog.mk>
234