Makefile revision 377
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/cat bin/expr bin/ls bin/mkdir
48FILESYSTEM_FILES+=	bin/df
49FILESYSTEM_FILES+=	bin/sh bin/sync bin/test
50FILESYSTEM_FILES+=	dev/MAKEDEV dev/MAKEDEV.local
51FILESYSTEM_FILES+=	etc/group
52FILESYSTEM_FILES+=	etc/master.passwd etc/passwd etc/pwd.db etc/spwd.db
53FILESYSTEM_FILES+=	sbin/disklabel sbin/halt sbin/init
54FILESYSTEM_FILES+=	sbin/mount sbin/mount_isofs sbin/mount_pcfs
55FILESYSTEM_FILES+=	sbin/newfs
56FILESYSTEM_FILES+=	sbin/umount
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
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 wd0 sd0 sd1)
239	(cd ${DESTDIR}/; \
240	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT})
241	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
242	    ${MOUNT}/.profile
243	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
244	    ${MOUNT}/install
245	(cd ${MOUNT}/; \
246	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
247	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
248	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
249	    sort -u /tmp/filelist >filelist; \
250	    rm /tmp/filelist)
251	df -ik ${MOUNT}
252	umount /dev/${FLOPPY}a
253	fsck /dev/r${FLOPPY}a
254	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/filesystem-floppy \
255		bs=15b count=160
256	gzip --no-name -9 -c ${RELEASEDIR}/floppies/filesystem-floppy \
257		>${RELEASEDIR}/floppies/filesystem-floppy.gz
258
259cpio-floppy:
260	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
261	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
262	mount /dev/${FLOPPY}a ${MOUNT}
263	chown root.wheel ${MOUNT}/.
264	chmod 755 ${MOUNT}/.
265	(cd ${DESTDIR}/; \
266		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
267	(cd ${DESTDIR}/; \
268	    find ${CPIO_CPIO} | cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
269	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
270	    ${MOUNT}/.profile
271	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
272	    ${MOUNT}/install
273	df -ik ${MOUNT}
274	umount /dev/${FLOPPY}a
275	fsck /dev/r${FLOPPY}a
276	dd if=/dev/r${FLOPPY}a of=${RELEASEDIR}/floppies/cpio-floppy \
277		bs=15b count=160
278	gzip --no-name -9 -c ${RELEASEDIR}/floppies/cpio-floppy \
279		>${RELEASEDIR}/floppies/cpio-floppy.gz
280
281bin-tarball:
282	(cd ${DESTDIR}; \
283		tar cf - . | gzip --no-name -9 -c | \
284			split -b 240640 - \
285			${RELEASEDIR}/tarballs/bin.tar.gz.)
286
287src-tarball:
288	(cd ${DESTDIR}; \
289		tar --exclude usr/src/${CRYPT_LIB} -cf - usr/src | gzip --no-name -9 -c | \
290			split -b 240640 - \
291			${RELEASEDIR}/tarballs/src.tar.gz.)
292
293ssrc-tarball:
294	(cd ${DESTDIR}; \
295		tar -cf - usr/src/${CRYPT_LIB} | gzip --no-name -9 -c | \
296			split -b 240640 - \
297			${RELEASEDIR}/tarballs/ssrc.tar.gz.)
298
299des-tarball:
300	rm -rf ${RELEASEDIR}/tmpdes
301	mkdir ${RELEASEDIR}/tmpdes
302	for i in ${CRYPT_DIRS}; do \
303		cd ${RELEASEDIR}/tmpdes; \
304		mkdir $$i; \
305		chown ${BINOWN}.${GRPOWN} $$i; \
306		chmod 755 $$i; \
307	done
308	# This is ugly, it force installs a /usr/lib/libcrypt.a so
309	# that the other makes will be built with des.
310	#
311	(cd ${.CURDIR}/../${CRYPT_LIB}; \
312		unset NOCRYPT; \
313		DESTDIR=; export DESTDIR; \
314		${MAKE} cleandir obj depend all install; \
315		NOMAN=noman; export NOMAN; \
316		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
317		${MAKE} cleandir obj depend all install)
318	for i in ${CRYPT_SRCS}; do \
319		unset NOCRYPT; \
320		DESTDIR=${RELEASEDIR}/tmpdes; export DESTDIR; \
321		NOMAN=noman; export NOMAN; \
322		cd ${.CURDIR}/../$$i; \
323		${MAKE} cleandir obj depend all install; \
324	done
325	(cd ${RELEASEDIR}/tmpdes; \
326		tar cf - . | gzip --no-name -9 -c | \
327			split -b 240640 - \
328			${RELEASEDIR}/tarballs/des.tar.gz.)
329	rm -rf ${RELEASEDIR}/tmpdes
330
331distrib-dirs:
332	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
333	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
334	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
335.if defined(CDROMDIST)
336	mtree -u -f mtree/BSD.local.dist -p ${DESTDIR}/usr/local
337.endif
338	cd ${DESTDIR}; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
339
340floppies: kcopy-ah-floppy kcopy-bt-floppy filesystem-floppy \
341	  cpio-floppy
342
343release: release-dirs distribution kcopy-kernels floppies \
344	 bin-tarball des-tarball
345	
346release-dirs:
347	rm -rf ${RELEASEDIR}/filesystem
348	mkdir ${RELEASEDIR}/filesystem
349	chown root.wheel ${RELEASEDIR}/filesystem
350	chmod 755 ${RELEASEDIR}/filesystem
351	rm -rf ${RELEASEDIR}/tarballs
352	mkdir ${RELEASEDIR}/tarballs
353	chown root.wheel ${RELEASEDIR}/tarballs
354	chmod 755 ${RELEASEDIR}/tarballs
355	rm -rf ${RELEASEDIR}/floppies
356	mkdir ${RELEASEDIR}/floppies
357	chown root.wheel ${RELEASEDIR}/floppies
358	chmod 755 ${RELEASEDIR}/floppies
359
360.include <bsd.prog.mk>
361