Makefile revision 284
1#	@(#)Makefile	5.11 (Berkeley) 5/21/91
2
3LOCALTIME=	US/Pacific
4TZDIR=/usr/share/zoneinfo
5
6NOOBJ=	oobj
7
8# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
9# -rw-r--r--
10BINOWN= root
11BINGRP= wheel
12BIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
13	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
14	inetd.conf motd myname netstart phones \
15	printcap protocols rc rc.local remote security services shells \
16	syslog.conf ttys etc.${MACHINE}/disktab rpc
17
18# -rw-rw-rw-
19BIN2=	motd
20
21# -rwxr-xr-x root.wheel, for the new f***ing cron root.wheel
22BIN3=	daily weekly monthly
23
24MTREE=	BSD.root.dist BSD.usr.dist BSD.var.dist
25NAMEDB=	localhost.rev named.boot root.cache
26PCS=	pcs750.bin
27WCS1=	wcs fppwcs poc poc1 poc2 fppoc
28WCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
29
30# Special top level files for FreeBSD
31COPYRIGHT= COPYRIGHT
32FREEBSD= CONTRIB.386BSD CONTRIB.FreeBSD ${COPYRIGHT}
33#
34# Floppy drive name and files for building FreeBSD Floppies
35FLOPPY?=	fd0
36MOUNT=		/mnt
37#
38MDEC=		usr/mdec/bootfd usr/mdec/fdboot
39MDEC+=		usr/mdec/bootsd usr/mdec/sdboot
40MDEC+=		usr/mdec/bootwd usr/mdec/wdboot
41#
42KC_DIRS=	dev mnt
43KC_FILES=	${COPYRIGHT}
44KC_FILES+=	bin/[ bin/cp bin/echo bin/sh bin/test
45KC_FILES+=	sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
46#
47INST1_DIRS=	dev mnt
48INST1_FILES=	${COPYRIGHT}
49INST1_FILES+=	bin/[ bin/cat bin/df bin/expr bin/ls bin/mkdir
50INST1_FILES+=	bin/sh bin/sync bin/test
51INST1_FILES+=	dev/MAKEDEV dev/MAKEDEV.local
52INST1_FILES+=	etc/disktab etc/group etc/master.passwd etc/passwd
53INST1_FILES+=	etc/pwd.db etc/spwd.db
54INST1_FILES+=	sbin/disklabel sbin/halt sbin/init sbin/mount sbin/umount
55INST1_FILES+=	sbin/newfs sbin/reboot
56INST1_FILES+=	usr/bin/cpio
57INST1_FILES+=	${MDEC}
58INST1_FILES+=	usr/sbin/bad144
59
60INST2_FILES=	${COPYRIGHT}
61INST2_FILES+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
62INST2_CPIO=	bin/chmod bin/cp bin/dd bin/mv bin/pwd bin/rm bin/stty
63INST2_CPIO+=	etc/protocols etc/services
64INST2_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod
65#INST2_CPIO+=	sbin/mount_pcfs sbin/mount_isofs
66INST2_CPIO+=	sbin/route sbin/shutdown sbin/slattach
67INST2_CPIO+=	tmp
68INST2_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/ftp
69INST2_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip usr/bin/zcat
70INST2_CPIO+=	usr/bin/elvis usr/bin/ex usr/bin/vi usr/bin/view
71#INST2_CPIO+=	usr/local/bin/mread usr/local/bin/rz
72INST2_CPIO+=	usr/sbin/update usr/sbin/chown
73INST2_CPIO+=	var
74
75all clean cleandir depend etc install lint:
76
77distribution: distrib-dirs
78	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
79	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
80	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
81	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
82	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
83	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
84	#
85	# This is broken, it always does /etc. It IGNORES the ${DESTDIR} for 
86	# where to write the spwd.db pwd.db files.  
87	#(cd ${DESTDIR}/etc; pwd_mkdb -p master.passwd)
88	#
89	# Work around for above problem.
90	install -c -o root -g wheel -m 644 pwd.db ${DESTDIR}/etc
91	install -c -o root -g wheel -m 600 spwd.db ${DESTDIR}/etc
92	install -c -o root -g wheel -m 644 passwd ${DESTDIR}/etc
93	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
94	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
95	(cd ${DESTDIR}/dev; sh MAKEDEV all)
96	(cd root; \
97		install -c -o root -g wheel -m 644 dot.cshrc \
98		    ${DESTDIR}/root/.cshrc; \
99		install -c -o root -g wheel -m 644 dot.klogin \
100		    ${DESTDIR}/root/.klogin; \
101		install -c -o root -g wheel -m 644 dot.login \
102		    ${DESTDIR}/root/.login; \
103		install -c -o root -g wheel -m 644 dot.profile \
104		    ${DESTDIR}/root/.profile; \
105		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
106		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
107		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
108	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
109	    ${DESTDIR}/etc/mtree
110	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
111	    ${DESTDIR}/etc/namedb
112	/bin/rm -f ${DESTDIR}/etc/localtime
113	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
114	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
115	    ${DESTDIR}/etc/dumpdates
116	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
117	    ${DESTDIR}/var/db/locate.database
118	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
119	    ${DESTDIR}/var/log/lpd-errs
120	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
121	    ${DESTDIR}/var/log/maillog
122	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
123	    ${DESTDIR}/var/log/lastlog
124	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
125	    ${DESTDIR}/var/log/messages
126	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
127	    ${DESTDIR}/var/log/wtmp
128	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
129	    ${DESTDIR}/var/run/utmp
130	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
131	    fstab.* ${DESTDIR}/etc)
132.if ${MACHINE} == "tahoe"
133	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
134	    ${DESTDIR}/)
135.endif
136.if ${MACHINE} == "vax"
137	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
138	    ${DESTDIR}/)
139.endif
140.if ${MACHINE} == "i386"
141	(cd ../sys/i386/boot; \
142	    make depend all install cleandir)
143	(cd /; \
144	    ls ${MDEC} | cpio -pdalmuv ${DESTDIR}/)
145	(cd ../usr.sbin/sendmail/src; \
146	    make install; \
147	 cd ../cf/cf; \
148	    make tcpproto.cf; \
149	    install -o root -g wheel -m 644 tcpproto.cf \
150	        ${DESTDIR}/etc/sendmail.cf)
151	(cd ../; \
152	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
153	(cd ..; make install)
154	(cd ../sys/compile; rm -rf GENERICISA)
155	(cd ../sys/i386/conf; config GENERICISA)
156	(cd ../sys/compile/GENERICISA; make depend; make all; \
157	    install -c -o root -g wheel -m 755 386bsd \
158	        ${DESTDIR}/386bsd.GENERICISA)
159	(cd ../include; make copies)
160.endif
161
162hcx9-distribution:
163	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
164	    ${DESTDIR}/)
165
166kc-ah-floppy:
167	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
168	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
169	mount /dev/${FLOPPY}a ${MOUNT}
170	(cd ${DESTDIR}/; \
171	    ls -d ${KC_DIRS} | cpio -pdalmuv ${MOUNT})
172	(cd ${MOUNT}/dev; \
173	    sh ${DESTDIR}/dev/MAKEDEV std; \
174	    rm -rf fd; \
175	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0)
176	(cd ${DESTDIR}/; \
177	    ls ${KC_FILES} | cpio -pdalmuv ${MOUNT})
178	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
179	    ${MOUNT}/.profile
180	(cd ../sys/compile/GENERICISA; \
181	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
182	df -ik ${MOUNT}
183	umount /dev/${FLOPPY}a
184	fsck /dev/r${FLOPPY}a
185
186inst1-floppy:
187	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
188	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
189	mount /dev/${FLOPPY}a ${MOUNT}
190	(cd ${DESTDIR}/; \
191	    ls -d ${INST1_DIRS} | cpio -pdalmuv ${MOUNT})
192	(cd ${MOUNT}/dev; \
193	    sh ${DESTDIR}/dev/MAKEDEV std; \
194	    rm -rf fd; \
195	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0)
196	(cd ${DESTDIR}/; \
197	    ls ${INST1_FILES} | cpio -pdalmuv ${MOUNT})
198	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
199	    ${MOUNT}/.profile
200	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
201	    ${MOUNT}/install
202	(cd ${MOUNT}/; \
203	    ls ${INST1_FILES} >/tmp/filelist; \
204	    find ${INST1_DIRS} | sort >>/tmp/filelist; \
205	    sort -u /tmp/filelist >filelist)
206	df -ik ${MOUNT}
207	umount /dev/${FLOPPY}a
208	fsck /dev/r${FLOPPY}a
209
210inst2-floppy:
211	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
212	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
213	mount /dev/${FLOPPY}a ${MOUNT}
214	(cd ${DESTDIR}/; \
215	    ls ${INST2_FILES} | cpio -pdalmuv ${MOUNT})
216	(cd ${DESTDIR}/; \
217	    find ${INST2_CPIO} | cpio -odalmuv | gzip -9 >${MOUNT}/inst2.cpio.gz)
218	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
219	    ${MOUNT}/.profile
220	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
221	    ${MOUNT}/install
222	df -ik ${MOUNT}
223	umount /dev/${FLOPPY}a
224	fsck /dev/r${FLOPPY}a
225
226distrib-dirs:
227	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
228	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
229	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
230	(cd ${DESTDIR}; rm -f ${DESTDIR}/sys; \
231	    ln -s usr/src/sys sys )
232
233.include <bsd.prog.mk>
234