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