Makefile revision 491
1#	@(#)Makefile	5.11 (Berkeley) 5/21/91
2
3NOOBJ=	noobj
4
5# disktab may be wrong -- hcx9 is a tahoe, but gets its own.
6# -rw-r--r--
7BINOWN= root
8BINGRP= wheel
9BIN1=	aliases csh.cshrc csh.login csh.logout dm.conf \
10	ftpusers gettytab group hosts host.conf hosts.equiv hosts.lpd \
11	inetd.conf motd myname netstart networks phones \
12	printcap protocols rc rc.local remote security services shells \
13	syslog.conf ttys etc.${MACHINE}/disktab rpc
14
15# -rw-rw-rw-
16BIN2=	motd
17
18# -rwxr-xr-x root.wheel, for the new f***ing cron root.wheel
19BIN3=	daily weekly monthly
20
21MTREE=	BSD.local.dist BSD.root.dist BSD.usr.dist BSD.var.dist
22NAMEDB=	localhost.rev named.boot root.cache
23PCS=	pcs750.bin
24WCS1=	wcs fppwcs poc poc1 poc2 fppoc
25WCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
26
27# Special top level files for FreeBSD
28COPYRIGHT= COPYRIGHT
29FREEBSD= CONTRIB.386BSD CONTRIB.FreeBSD RELNOTES.FreeBSD ${COPYRIGHT}
30#
31# Floppy drive name and files for building FreeBSD Floppies
32FLOPPY?=	fd0
33MOUNT?=		/mnt
34#
35MDEC=		usr/mdec/bootfd usr/mdec/fdboot
36MDEC+=		usr/mdec/bootsd usr/mdec/sdboot
37MDEC+=		usr/mdec/bootwd usr/mdec/wdboot
38#
39KC_DIRS=	dev mnt
40KC_FILES=	${COPYRIGHT}
41KC_FILES+=	bin/[ bin/cp bin/echo bin/sh bin/test
42KC_FILES+=	sbin/fsck sbin/halt sbin/init sbin/mount sbin/umount
43#
44FILESYSTEM_DIRS=	bin dev etc mnt sbin usr usr/bin usr/mdec usr/sbin
45FILESYSTEM_TREES=	dev
46FILESYSTEM_FILES=	${COPYRIGHT}
47FILESYSTEM_FILES+=	bin/[ bin/expr bin/ls bin/mkdir bin/rm
48FILESYSTEM_FILES+=	bin/sh bin/sync bin/test
49FILESYSTEM_FILES+=	dev/MAKEDEV
50FILESYSTEM_FILES+=	etc/group
51FILESYSTEM_FILES+=	etc/master.passwd etc/passwd etc/pwd.db
52FILESYSTEM_FILES+=	sbin/disklabel sbin/halt sbin/init
53FILESYSTEM_FILES+=	sbin/mount sbin/mount_pcfs
54FILESYSTEM_FILES+=	sbin/newfs
55FILESYSTEM_FILES+=	sbin/umount
56FILESYSTEM_FILES+=	sbin/fdisk
57FILESYSTEM_FILES+=	usr/bin/cpio
58FILESYSTEM_FILES+=	${MDEC}
59FILESYSTEM_FILES+=	usr/sbin/bad144
60
61CPIO_FILES=	${COPYRIGHT}
62CPIO_FILES+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
63CPIO_CPIO=	bin/chmod bin/cat bin/cp bin/dd bin/df bin/mv bin/pwd bin/stty
64CPIO_CPIO+=	etc/protocols etc/remote etc/services etc/spwd.db
65CPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod sbin/mount_isofs
66CPIO_CPIO+=	sbin/reboot sbin/route sbin/slattach
67CPIO_CPIO+=	tmp
68CPIO_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/ftp
69CPIO_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
70CPIO_CPIO+=	usr/bin/elvis usr/bin/ex usr/bin/vi usr/bin/view
71CPIO_CPIO+=	usr/sbin/update usr/sbin/chown
72CPIO_CPIO_DIRS=	var var/tmp var/run var/spool var/spool/lock
73
74CRYPT_LIB=	lib/libcrypt
75CRYPT_SRCS=	bin/ed bin/rcp
76CRYPT_SRCS+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
77CRYPT_SRCS+=	libexec/rshd libexec/telnetd libexec/uucpd
78CRYPT_SRCS+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
79CRYPT_SRCS+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
80CRYPT_DIRS=	bin usr usr/bin usr/lib usr/libexec 
81
82all clean cleandir depend etc install lint:
83
84crypt:
85	rm -f ${LIBCRYPT};
86	(cd ${.CURDIR}/../${CRYPT_LIB}; \
87		${MAKE} cleandir obj depend all install)
88	for i in ${CRYPT_SRCS}; do \
89		cd ${.CURDIR}/../$$i; \
90		${MAKE} cleandir obj depend all; \
91	done
92	
93non-crypt:
94	rm -f ${LIBCRYPT}
95	for i in ${CRYPT_SRCS}; do \
96		cd ${.CURDIR}/../$$i; \
97		${MAKE} cleandir obj depend all; \
98	done
99	
100distribution: distrib-dirs
101	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
102	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
103	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
104	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
105	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
106	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
107	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
108	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
109	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
110.if defined(CDROMDIST)
111	(cd ${DESTDIR}/dev; sh MAKEDEV all)
112.endif
113	(cd root; \
114		install -c -o root -g wheel -m 644 dot.cshrc \
115		    ${DESTDIR}/root/.cshrc; \
116		install -c -o root -g wheel -m 644 dot.klogin \
117		    ${DESTDIR}/root/.klogin; \
118		install -c -o root -g wheel -m 644 dot.login \
119		    ${DESTDIR}/root/.login; \
120		install -c -o root -g wheel -m 644 dot.profile \
121		    ${DESTDIR}/root/.profile; \
122		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
123		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
124		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
125	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
126	    ${DESTDIR}/etc/mtree
127	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
128	    ${DESTDIR}/etc/namedb
129	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
130	    ${DESTDIR}/etc/dumpdates
131	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
132	    ${DESTDIR}/var/db/locate.database
133	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
134	    ${DESTDIR}/var/log/lpd-errs
135	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
136	    ${DESTDIR}/var/log/maillog
137	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
138	    ${DESTDIR}/var/log/lastlog
139	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
140	    ${DESTDIR}/var/log/messages
141	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
142	    ${DESTDIR}/var/log/wtmp
143	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
144	    ${DESTDIR}/var/run/utmp
145	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
146	    fstab.* ${DESTDIR}/etc)
147.if defined(NOCRYPT)
148	${MAKE} non-crypt
149	(cd ..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
150.else
151	${MAKE} crypt
152	(cd ..; ${MAKE} install)
153.endif
154	(cd ../usr.sbin/sendmail/src; \
155	    ${MAKE} install; \
156	 cd ../cf/cf; \
157	    ${MAKE} tcpproto.cf; \
158	    install -o root -g wheel -m 644 tcpproto.cf \
159	        ${DESTDIR}/etc/sendmail.cf)
160	(cd ../; \
161	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
162	(cd ..; ${MAKE} mdec; )
163.if ${MACHINE} == "tahoe"
164	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
165	    ${DESTDIR}/)
166.endif
167.if ${MACHINE} == "vax"
168	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
169	    ${DESTDIR}/)
170.endif
171
172hcx9-distribution:
173	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
174	    ${DESTDIR}/)
175
176kcopy-kernels: ../sys/i386/conf/GENERICAH ../sys/i386/conf/GENERICBT
177	(cd ../sys/compile; rm -rf GENERICAH GENERICBT)
178	(cd ../sys/i386/conf; config GENERICAH; config GENERICBT)
179	(cd ../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
180	    install -c -o root -g wheel -m 755 386bsd \
181	        ${DESTDIR}/386bsd.GENERICAH)
182	(cd ../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
183	    install -c -o root -g wheel -m 755 386bsd \
184	        ${DESTDIR}/386bsd.GENERICBT)
185
186kcopy-floppy:
187	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
188	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
189	mount /dev/${FLOPPY}a ${MOUNT}
190	chown root.wheel ${MOUNT}/.
191	chmod 755 ${MOUNT}/.
192	(cd ${DESTDIR}/; \
193	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
194	(cd ${MOUNT}/dev; \
195	    sh ${DESTDIR}/dev/MAKEDEV std; \
196	    rm -rf fd; \
197	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
198	(cd ${DESTDIR}/; \
199	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
200	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
201	    ${MOUNT}/.profile
202
203kcopy-ah-floppy:
204	${MAKE} kcopy-floppy
205	(cd ../sys/compile/GENERICAH; \
206	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
207	df -ik ${MOUNT}
208	umount /dev/${FLOPPY}a
209	fsck /dev/r${FLOPPY}a
210	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/kcopy-ah-floppy \
211		bs=15b count=160
212	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy-ah-floppy \
213		>${RELEASEDIR}/floppies/kcopy-ah-floppy.gz
214
215kcopy-bt-floppy:
216	${MAKE} kcopy-floppy
217	(cd ../sys/compile/GENERICBT; \
218	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
219	df -ik ${MOUNT}
220	umount /dev/${FLOPPY}a
221	fsck /dev/r${FLOPPY}a
222	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/kcopy-bt-floppy \
223		bs=15b count=160
224	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy-bt-floppy \
225		>${RELEASEDIR}/floppies/kcopy-bt-floppy.gz
226
227filesystem-floppy:
228	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
229	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
230	mount /dev/${FLOPPY}a ${MOUNT}
231	chown root.wheel ${MOUNT}/.
232	chmod 755 ${MOUNT}/.
233	(cd ${DESTDIR}/; \
234	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
235	(cd ${MOUNT}/dev; \
236	    sh ${DESTDIR}/dev/MAKEDEV std; \
237	    rm -rf fd; \
238	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 sd0 sd1; \
239	    rm -f rfd1[b-z] fd1[b-z])
240	(cd ${DESTDIR}/; \
241	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT})
242	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
243	    ${MOUNT}/.profile
244	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
245	    ${MOUNT}/install
246	(cd ${MOUNT}/; \
247	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
248	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
249	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
250	    sort -u /tmp/filelist >filelist; \
251	    rm /tmp/filelist)
252	df -ik ${MOUNT}
253	umount /dev/${FLOPPY}a
254	fsck /dev/r${FLOPPY}a
255	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/filesystem-floppy \
256		bs=15b count=160
257	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesystem-floppy \
258		>${RELEASEDIR}/floppies/filesystem-floppy.gz
259
260cpio-floppy:
261	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
262	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
263	mount /dev/${FLOPPY}a ${MOUNT}
264	chown root.wheel ${MOUNT}/.
265	chmod 755 ${MOUNT}/.
266	(cd ${DESTDIR}/; \
267		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
268	(cd ${DESTDIR}/; \
269	    (find ${CPIO_CPIO}; ls -d ${CPIO_CPIO_DIRS}) | \
270		cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
271	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
272	    ${MOUNT}/.profile
273	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
274	    ${MOUNT}/install
275	df -ik ${MOUNT}
276	umount /dev/${FLOPPY}a
277	fsck /dev/r${FLOPPY}a
278	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/cpio-floppy \
279		bs=15b count=160
280	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio-floppy \
281		>${RELEASEDIR}/floppies/cpio-floppy.gz
282
283bin-tarball:
284	(cd ${DESTDIR}; \
285		tar cf - . | gzip --no-name -9 -c | \
286			split -b 240640 - \
287			${RELEASEDIR}/tarballs/bin_tgz.)
288
289src-tarball:
290	(cd ${DESTDIR}; \
291		tar --exclude usr/src/${CRYPT_LIB} -cf - usr/src | gzip --no-name -9 -c | \
292			split -b 240640 - \
293			${RELEASEDIR}/tarballs/src_tgz.)
294
295ssrc-tarball:
296	(cd ${DESTDIR}; \
297		tar -cf - usr/src/${CRYPT_LIB} | gzip --no-name -9 -c | \
298			split -b 240640 - \
299			${RELEASEDIR}/tarballs/ssrc_tgz.)
300
301des-tarball:
302	rm -rf ${RELEASEDIR}/tmpdes
303	mkdir ${RELEASEDIR}/tmpdes
304	for i in ${CRYPT_DIRS}; do \
305		cd ${RELEASEDIR}/tmpdes; \
306		mkdir $$i; \
307		chown ${BINOWN}.${GRPOWN} $$i; \
308		chmod 755 $$i; \
309	done
310	# This is ugly, it force installs a /usr/lib/libcrypt.a so
311	# that the other makes will be built with des.
312	#
313	(cd ${.CURDIR}/../${CRYPT_LIB}; \
314		unset NOCRYPT; \
315		DESTDIR=; export DESTDIR; \
316		${MAKE} cleandir obj depend all install; \
317		NOMAN=noman; export NOMAN; \
318		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
319		${MAKE} cleandir obj depend all install)
320	for i in ${CRYPT_SRCS}; do \
321		unset NOCRYPT; \
322		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
323		NOMAN=noman; export NOMAN; \
324		cd ${.CURDIR}/../$$i; \
325		${MAKE} cleandir obj depend all install; \
326	done
327	(cd ${RELEASEDIR}/tmpdes; \
328		tar cf - . | gzip --no-name -9 -c | \
329			split -b 240640 - \
330			${RELEASEDIR}/tarballs/des_tgz.)
331	rm -rf ${RELEASEDIR}/tmpdes
332
333distrib-dirs:
334	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
335	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
336	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
337.if defined(CDROMDIST)
338	mtree -u -f mtree/BSD.local.dist -p ${DESTDIR}/usr/local
339.endif
340	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
341
342floppies: kcopy-ah-floppy kcopy-bt-floppy filesystem-floppy \
343	  cpio-floppy
344
345release: release-dirs distribution kcopy-kernels floppies \
346	 bin-tarball des-tarball
347	
348release-dirs:
349	rm -rf ${RELEASEDIR}/filesystem
350	mkdir ${RELEASEDIR}/filesystem
351	chown root.wheel ${RELEASEDIR}/filesystem
352	chmod 755 ${RELEASEDIR}/filesystem
353	rm -rf ${RELEASEDIR}/tarballs
354	mkdir ${RELEASEDIR}/tarballs
355	chown root.wheel ${RELEASEDIR}/tarballs
356	chmod 755 ${RELEASEDIR}/tarballs
357	rm -rf ${RELEASEDIR}/floppies
358	mkdir ${RELEASEDIR}/floppies
359	chown root.wheel ${RELEASEDIR}/floppies
360	chmod 755 ${RELEASEDIR}/floppies
361
362.include <bsd.prog.mk>
363