Makefile revision 412
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.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
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 etc/spwd.db
52FILESYSTEM_FILES+=	sbin/disklabel sbin/halt sbin/init
53FILESYSTEM_FILES+=	sbin/mount sbin/mount_isofs 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/cp bin/dd bin/mv bin/pwd bin/rm bin/stty
64CPIO_CPIO+=	etc/protocols etc/services
65CPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod
66CPIO_CPIO+=	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+=	var
73
74DOS_FILES=	bin/cat bin/dd bin/df bin/ed
75DOS_FILES+=	usr/bin/cksum usr/bin/mt 
76DOS_FILES+=	sbin/mknod sbin/ping sbin/shutdown sbin/st sbin/reboot
77
78CRYPT_LIB=	lib/libcrypt
79CRYPT_SRCS=	bin/ed bin/rcp
80CRYPT_SRCS+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
81CRYPT_SRCS+=	libexec/rshd libexec/telnetd libexec/uucpd
82CRYPT_SRCS+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
83CRYPT_SRCS+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
84CRYPT_DIRS=	bin usr usr/bin usr/lib usr/libexec 
85
86all clean cleandir depend etc install lint:
87
88crypt:
89	rm -f ${LIBCRYPT};
90	(cd ${.CURDIR}/../${CRYPT_LIB}; \
91		${MAKE} cleandir obj depend all install)
92	for i in ${CRYPT_SRCS}; do \
93		cd ${.CURDIR}/../$$i; \
94		${MAKE} cleandir obj depend all; \
95	done
96	
97non-crypt:
98	rm -f ${LIBCRYPT}
99	for i in ${CRYPT_SRCS}; do \
100		cd ${.CURDIR}/../$$i; \
101		${MAKE} cleandir obj depend all; \
102	done
103	
104distribution: distrib-dirs
105	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
106	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
107	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
108	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
109	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
110	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
111	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
112	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
113	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
114.if defined(CDROMDIST)
115	(cd ${DESTDIR}/dev; sh MAKEDEV all)
116.endif
117	(cd root; \
118		install -c -o root -g wheel -m 644 dot.cshrc \
119		    ${DESTDIR}/root/.cshrc; \
120		install -c -o root -g wheel -m 644 dot.klogin \
121		    ${DESTDIR}/root/.klogin; \
122		install -c -o root -g wheel -m 644 dot.login \
123		    ${DESTDIR}/root/.login; \
124		install -c -o root -g wheel -m 644 dot.profile \
125		    ${DESTDIR}/root/.profile; \
126		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
127		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
128		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
129	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
130	    ${DESTDIR}/etc/mtree
131	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
132	    ${DESTDIR}/etc/namedb
133	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
134	    ${DESTDIR}/etc/dumpdates
135	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
136	    ${DESTDIR}/var/db/locate.database
137	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
138	    ${DESTDIR}/var/log/lpd-errs
139	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
140	    ${DESTDIR}/var/log/maillog
141	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
142	    ${DESTDIR}/var/log/lastlog
143	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
144	    ${DESTDIR}/var/log/messages
145	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
146	    ${DESTDIR}/var/log/wtmp
147	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
148	    ${DESTDIR}/var/run/utmp
149	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
150	    fstab.* ${DESTDIR}/etc)
151.if defined(NOCRYPT)
152	${MAKE} non-crypt
153	(cd ..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
154.else
155	${MAKE} crypt
156	(cd ..; ${MAKE} install)
157.endif
158	(cd ../usr.sbin/sendmail/src; \
159	    ${MAKE} install; \
160	 cd ../cf/cf; \
161	    ${MAKE} tcpproto.cf; \
162	    install -o root -g wheel -m 644 tcpproto.cf \
163	        ${DESTDIR}/etc/sendmail.cf)
164	(cd ../; \
165	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
166	(cd ..; ${MAKE} mdec; )
167.if ${MACHINE} == "tahoe"
168	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
169	    ${DESTDIR}/)
170.endif
171.if ${MACHINE} == "vax"
172	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
173	    ${DESTDIR}/)
174.endif
175
176hcx9-distribution:
177	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
178	    ${DESTDIR}/)
179
180kcopy-kernels: ../sys/i386/conf/GENERICAH ../sys/i386/conf/GENERICBT
181	(cd ../sys/compile; rm -rf GENERICAH GENERICBT)
182	(cd ../sys/i386/conf; config GENERICAH; config GENERICBT)
183	(cd ../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
184	    install -c -o root -g wheel -m 755 386bsd \
185	        ${DESTDIR}/386bsd.GENERICAH)
186	(cd ../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
187	    install -c -o root -g wheel -m 755 386bsd \
188	        ${DESTDIR}/386bsd.GENERICBT)
189
190kcopy-floppy:
191	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
192	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
193	mount /dev/${FLOPPY}a ${MOUNT}
194	chown root.wheel ${MOUNT}/.
195	chmod 755 ${MOUNT}/.
196	(cd ${DESTDIR}/; \
197	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
198	(cd ${MOUNT}/dev; \
199	    sh ${DESTDIR}/dev/MAKEDEV std; \
200	    rm -rf fd; \
201	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
202	(cd ${DESTDIR}/; \
203	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
204	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
205	    ${MOUNT}/.profile
206
207kcopy-ah-floppy:
208	${MAKE} kcopy-floppy
209	(cd ../sys/compile/GENERICAH; \
210	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
211	df -ik ${MOUNT}
212	umount /dev/${FLOPPY}a
213	fsck /dev/r${FLOPPY}a
214	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/kcopy-ah-floppy \
215		bs=15b count=160
216	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy-ah-floppy \
217		>${RELEASEDIR}/floppies/kcopy-ah-floppy.gz
218
219kcopy-bt-floppy:
220	${MAKE} kcopy-floppy
221	(cd ../sys/compile/GENERICBT; \
222	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
223	df -ik ${MOUNT}
224	umount /dev/${FLOPPY}a
225	fsck /dev/r${FLOPPY}a
226	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/kcopy-bt-floppy \
227		bs=15b count=160
228	gzip --no-name -9 -c ${RELEASEDIR}/floppies/kcopy-bt-floppy \
229		>${RELEASEDIR}/floppies/kcopy-bt-floppy.gz
230
231filesystem-floppy:
232	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
233	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
234	mount /dev/${FLOPPY}a ${MOUNT}
235	chown root.wheel ${MOUNT}/.
236	chmod 755 ${MOUNT}/.
237	(cd ${DESTDIR}/; \
238	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
239	(cd ${MOUNT}/dev; \
240	    sh ${DESTDIR}/dev/MAKEDEV std; \
241	    rm -rf fd; \
242	    sh ${DESTDIR}/dev/MAKEDEV fd0 fd1 wd0 sd0 sd1
243	    rm -f ${DESTDIR}/dev/rfd1[b-z] ${DESTDIR}/dev/fd1[b-z])
244	(cd ${DESTDIR}/; \
245	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT})
246	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
247	    ${MOUNT}/.profile
248	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
249	    ${MOUNT}/install
250	(cd ${MOUNT}/; \
251	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
252	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
253	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
254	    sort -u /tmp/filelist >filelist; \
255	    rm /tmp/filelist)
256	df -ik ${MOUNT}
257	umount /dev/${FLOPPY}a
258	fsck /dev/r${FLOPPY}a
259	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/filesystem-floppy \
260		bs=15b count=160
261	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesystem-floppy \
262		>${RELEASEDIR}/floppies/filesystem-floppy.gz
263
264cpio-floppy:
265	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
266	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
267	mount /dev/${FLOPPY}a ${MOUNT}
268	chown root.wheel ${MOUNT}/.
269	chmod 755 ${MOUNT}/.
270	(cd ${DESTDIR}/; \
271		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
272	(cd ${DESTDIR}/; \
273	    find ${CPIO_CPIO} | cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
274	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
275	    ${MOUNT}/.profile
276	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
277	    ${MOUNT}/install
278	df -ik ${MOUNT}
279	umount /dev/${FLOPPY}a
280	fsck /dev/r${FLOPPY}a
281	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/cpio-floppy \
282		bs=15b count=160
283	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio-floppy \
284		>${RELEASEDIR}/floppies/cpio-floppy.gz
285
286dos-floppy:
287	mount -t pcfs /dev/${FLOPPY}a ${MOUNT}
288	(cd ${DESTDIR}/; \
289		cp /sys/i386/floppy/* ${MOUNT}; \
290		cp ${DOS_FILES} ${MOUNT})
291	df -ik ${MOUNT}
292	umount /dev/${FLOPPY}a
293	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/dos-floppy \
294		bs=15b count=160
295	gzip --no-name -9 -c ${RELEASEDIR}/floppies/dos-floppy \
296		>${RELEASEDIR}/floppies/dos-floppy.gz
297
298bin-tarball:
299	(cd ${DESTDIR}; \
300		tar cf - . | gzip --no-name -9 -c | \
301			split -b 240640 - \
302			${RELEASEDIR}/tarballs/bin.tar.gz.)
303
304src-tarball:
305	(cd ${DESTDIR}; \
306		tar --exclude usr/src/${CRYPT_LIB} -cf - usr/src | gzip --no-name -9 -c | \
307			split -b 240640 - \
308			${RELEASEDIR}/tarballs/src.tar.gz.)
309
310ssrc-tarball:
311	(cd ${DESTDIR}; \
312		tar -cf - usr/src/${CRYPT_LIB} | gzip --no-name -9 -c | \
313			split -b 240640 - \
314			${RELEASEDIR}/tarballs/ssrc.tar.gz.)
315
316des-tarball:
317	rm -rf ${RELEASEDIR}/tmpdes
318	mkdir ${RELEASEDIR}/tmpdes
319	for i in ${CRYPT_DIRS}; do \
320		cd ${RELEASEDIR}/tmpdes; \
321		mkdir $$i; \
322		chown ${BINOWN}.${GRPOWN} $$i; \
323		chmod 755 $$i; \
324	done
325	# This is ugly, it force installs a /usr/lib/libcrypt.a so
326	# that the other makes will be built with des.
327	#
328	(cd ${.CURDIR}/../${CRYPT_LIB}; \
329		unset NOCRYPT; \
330		DESTDIR=; export DESTDIR; \
331		${MAKE} cleandir obj depend all install; \
332		NOMAN=noman; export NOMAN; \
333		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
334		${MAKE} cleandir obj depend all install)
335	for i in ${CRYPT_SRCS}; do \
336		unset NOCRYPT; \
337		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
338		NOMAN=noman; export NOMAN; \
339		cd ${.CURDIR}/../$$i; \
340		${MAKE} cleandir obj depend all install; \
341	done
342	(cd ${RELEASEDIR}/tmpdes; \
343		tar cf - . | gzip --no-name -9 -c | \
344			split -b 240640 - \
345			${RELEASEDIR}/tarballs/des.tar.gz.)
346	rm -rf ${RELEASEDIR}/tmpdes
347
348distrib-dirs:
349	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
350	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
351	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
352.if defined(CDROMDIST)
353	mtree -u -f mtree/BSD.local.dist -p ${DESTDIR}/usr/local
354.endif
355	cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
356
357floppies: kcopy-ah-floppy kcopy-bt-floppy filesystem-floppy \
358	  cpio-floppy
359
360release: release-dirs distribution kcopy-kernels floppies \
361	 bin-tarball des-tarball
362	
363release-dirs:
364	rm -rf ${RELEASEDIR}/filesystem
365	mkdir ${RELEASEDIR}/filesystem
366	chown root.wheel ${RELEASEDIR}/filesystem
367	chmod 755 ${RELEASEDIR}/filesystem
368	rm -rf ${RELEASEDIR}/tarballs
369	mkdir ${RELEASEDIR}/tarballs
370	chown root.wheel ${RELEASEDIR}/tarballs
371	chmod 755 ${RELEASEDIR}/tarballs
372	rm -rf ${RELEASEDIR}/floppies
373	mkdir ${RELEASEDIR}/floppies
374	chown root.wheel ${RELEASEDIR}/floppies
375	chmod 755 ${RELEASEDIR}/floppies
376
377.include <bsd.prog.mk>
378