Makefile revision 366
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 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
56#FILESYSTEM_FILES+=	sbin/reboot
57FILESYSTEM_FILES+=	sbin/umount
58FILESYSTEM_FILES+=	usr/bin/cpio
59FILESYSTEM_FILES+=	${MDEC}
60FILESYSTEM_FILES+=	usr/sbin/bad144
61
62CPIO_FILES=	${COPYRIGHT}
63CPIO_FILES+=	usr/bin/gunzip usr/bin/gzcat usr/bin/gzip usr/bin/zcat
64CPIO_CPIO=	bin/chmod bin/cp bin/mv bin/pwd bin/rm bin/stty
65CPIO_CPIO+=	etc/protocols etc/services
66CPIO_CPIO+=	sbin/ifconfig sbin/fsck sbin/mknod
67CPIO_CPIO+=	sbin/route sbin/shutdown sbin/slattach
68CPIO_CPIO+=	tmp
69CPIO_CPIO+=	usr/bin/awk usr/bin/chgrp usr/bin/ftp
70CPIO_CPIO+=	usr/bin/more usr/bin/tar usr/bin/tip
71CPIO_CPIO+=	usr/bin/elvis usr/bin/ex usr/bin/vi usr/bin/view
72#CPIO_CPIO+=	usr/local/bin/mread usr/local/bin/rz
73CPIO_CPIO+=	usr/sbin/update usr/sbin/chown
74CPIO_CPIO+=	var
75
76CRYPT_LIB=	lib/libcrypt
77CRYPT_FILES=	bin/ed bin/rcp
78CRYPT_FILES+=	libexec/ftpd libexec/makekey libexec/rexecd libexec/rlogind
79CRYPT_FILES+=	libexec/rshd libexec/telnetd libexec/uucpd
80CRYPT_FILES+=	usr.bin/bdes usr.bin/lock usr.bin/login usr.bin/passwd
81CRYPT_FILES+=	usr.bin/rlogin usr.bin/rsh usr.bin/su usr.bin/telnet
82
83all clean cleandir depend etc install lint:
84
85crypt:
86	rm -f ${LIBCRYPT};
87	(cd ${.CURDIR}/../${CRYPT_LIB}; \
88		${MAKE} cleandir obj depend all install)
89	for i in ${CRYPT_FILES}; do \
90		cd ${.CURDIR}/../$$i; \
91		${MAKE} cleandir obj depend all; \
92	done
93	
94non-crypt:
95	rm -f ${LIBCRYPT}
96	for i in ${CRYPT_FILES}; do \
97		cd ${.CURDIR}/../$$i; \
98		${MAKE} cleandir obj depend all; \
99	done
100	
101distribution: distrib-dirs
102	install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
103	install -c -o ${BINOWN} -g ${BINGRP} -m 666 ${BIN2} ${DESTDIR}/etc
104	install -c -o root -g wheel -m 755 ${BIN3} ${DESTDIR}/etc
105	install -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
106	install -c -o root -g wheel -m 600 /dev/null ${DESTDIR}/var/cron/log
107	install -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
108	pwd_mkdb -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
109	install -c -o ${BINOWN} -g ${BINGRP} -m 555 \
110	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
111.if defined(CDROMDIST)
112	(cd ${DESTDIR}/dev; sh MAKEDEV all)
113.endif
114	(cd root; \
115		install -c -o root -g wheel -m 644 dot.cshrc \
116		    ${DESTDIR}/root/.cshrc; \
117		install -c -o root -g wheel -m 644 dot.klogin \
118		    ${DESTDIR}/root/.klogin; \
119		install -c -o root -g wheel -m 644 dot.login \
120		    ${DESTDIR}/root/.login; \
121		install -c -o root -g wheel -m 644 dot.profile \
122		    ${DESTDIR}/root/.profile; \
123		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
124		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
125		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
126	cd mtree; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${MTREE} \
127	    ${DESTDIR}/etc/mtree
128	cd namedb; install -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
129	    ${DESTDIR}/etc/namedb
130	install -c -o ${BINOWN} -g operator -m 664 /dev/null \
131	    ${DESTDIR}/etc/dumpdates
132	install -c -o nobody -g ${BINGRP} -m 664 /dev/null \
133	    ${DESTDIR}/var/db/locate.database
134	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
135	    ${DESTDIR}/var/log/lpd-errs
136	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
137	    ${DESTDIR}/var/log/maillog
138	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
139	    ${DESTDIR}/var/log/lastlog
140	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
141	    ${DESTDIR}/var/log/messages
142	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
143	    ${DESTDIR}/var/log/wtmp
144	install -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
145	    ${DESTDIR}/var/run/utmp
146	(cd etc.${MACHINE}; install -c -o ${BINOWN} -g ${BINGRP} -m 444 \
147	    fstab.* ${DESTDIR}/etc)
148.if defined(NOCRYPT)
149	${MAKE} non-crypt
150	(cd ..; NOCRYPT=nocrypt; export NOCRYPT; ${MAKE} install)
151.else
152	${MAKE} crypt
153	(cd ..; ${MAKE} install)
154.endif
155	(cd ../usr.sbin/sendmail/src; \
156	    ${MAKE} install; \
157	 cd ../cf/cf; \
158	    ${MAKE} tcpproto.cf; \
159	    install -o root -g wheel -m 644 tcpproto.cf \
160	        ${DESTDIR}/etc/sendmail.cf)
161	(cd ../; \
162	    install -c -o root -g wheel -m 444 ${FREEBSD} ${DESTDIR}/)
163	(cd ..; ${MAKE} mdec; )
164.if ${MACHINE} == "tahoe"
165	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS1} \
166	    ${DESTDIR}/)
167.endif
168.if ${MACHINE} == "vax"
169	(cd etc.vax; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
170	    ${DESTDIR}/)
171.endif
172
173hcx9-distribution:
174	(cd etc.tahoe; install -c -o ${BINOWN} -g ${BINGRP} -m 444 ${WCS2} \
175	    ${DESTDIR}/)
176
177kcopy-kernels: ../sys/i386/conf/GENERICAH ../sys/i386/conf/GENERICBT
178	(cd ../sys/compile; rm -rf GENERICAH GENERICBT)
179	(cd ../sys/i386/conf; config GENERICAH; config GENERICBT)
180	(cd ../sys/compile/GENERICAH; ${MAKE} depend; ${MAKE} all; \
181	    install -c -o root -g wheel -m 755 386bsd \
182	        ${DESTDIR}/386bsd.GENERICAH)
183	(cd ../sys/compile/GENERICBT; ${MAKE} depend; ${MAKE} all; \
184	    install -c -o root -g wheel -m 755 386bsd \
185	        ${DESTDIR}/386bsd.GENERICBT)
186
187kcopy-floppy:
188	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
189	newfs -b 4096 -c 80 -f 512 -i 16384 -m 0 -o space r${FLOPPY}a floppy5
190	mount /dev/${FLOPPY}a ${MOUNT}
191	chown root.wheel ${MOUNT}/.
192	chmod 755 ${MOUNT}/.
193	(cd ${DESTDIR}/; \
194	    ls -d ${KC_DIRS} | cpio -pdamuv ${MOUNT})
195	(cd ${MOUNT}/dev; \
196	    sh ${DESTDIR}/dev/MAKEDEV std; \
197	    rm -rf fd; \
198	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
199	(cd ${DESTDIR}/; \
200	    ls ${KC_FILES} | cpio -pdamuv ${MOUNT})
201	install -c -o root -g wheel -m 755 etc.i386/kc.profile \
202	    ${MOUNT}/.profile
203
204kcopy-ah-floppy: 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=${DESTDIR}/../kcopy-ah-floppy \
211		bs=15b count=160
212	gzip --no-name -9 -c ${DESTDIR}/../kcopy-ah-floppy \
213		>${DESTDIR}/../kcopy-ah-floppy.gz
214
215kcopy-bt-floppy: kcopy-floppy
216	(cd ../sys/compile/GENERICBT; \
217	    install -c -o root -g wheel -m 755 386bsd ${MOUNT}/)
218	df -ik ${MOUNT}
219	umount /dev/${FLOPPY}a
220	fsck /dev/r${FLOPPY}a
221	dd if=/dev/r${FLOPPY}a of=${DESTDIR}/../kcopy-bt-floppy \
222		bs=15b count=160
223	gzip --no-name -9 -c ${DESTDIR}/../kcopy-bt-floppy \
224		>${DESTDIR}/../kcopy-bt-floppy.gz
225
226filesystem-floppy:
227	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
228	newfs -b 4096 -c 80 -f 512 -i 10240 -m 0 -o space r${FLOPPY}a floppy5
229	mount /dev/${FLOPPY}a ${MOUNT}
230	chown root.wheel ${MOUNT}/.
231	chmod 755 ${MOUNT}/.
232	(cd ${DESTDIR}/; \
233	    ls -d ${FILESYSTEM_DIRS} | cpio -pdamuv ${MOUNT})
234	(cd ${MOUNT}/dev; \
235	    sh ${DESTDIR}/dev/MAKEDEV std; \
236	    rm -rf fd; \
237	    sh ${DESTDIR}/dev/MAKEDEV fd0 wd0 sd0 sd1)
238	(cd ${DESTDIR}/; \
239	    ls ${FILESYSTEM_FILES} | cpio -pdamuv ${MOUNT})
240	install -c -o root -g wheel -m 755 etc.i386/inst1.profile \
241	    ${MOUNT}/.profile
242	install -c -o root -g wheel -m 755 etc.i386/inst1.install \
243	    ${MOUNT}/install
244	(cd ${MOUNT}/; \
245	    ls ${FILESYSTEM_FILES} >/tmp/filelist; \
246	    ls -d ${FILESYSTEM_DIRS} >>/tmp/filelist; \
247	    find ${FILESYSTEM_TREES} >>/tmp/filelist; \
248	    sort -u /tmp/filelist >filelist; \
249	    rm /tmp/filelist)
250	df -ik ${MOUNT}
251	umount /dev/${FLOPPY}a
252	fsck /dev/r${FLOPPY}a
253	dd if=/dev/r${FLOPPY}a of=${DESTDIR}/../filesystem-floppy \
254		bs=15b count=160
255	gzip --no-name -9 -c ${DESTDIR}/../filesystem-floppy \
256		>${DESTDIR}/../filesystem-floppy.gz
257
258cpio-floppy:
259	disklabel -w -r ${FLOPPY} floppy5 /usr/mdec/fdboot /usr/mdec/bootfd
260	newfs -b 4096 -c 80 -f 512 -i 65536 -m 0 -o space r${FLOPPY}a floppy5
261	mount /dev/${FLOPPY}a ${MOUNT}
262	chown root.wheel ${MOUNT}/.
263	chmod 755 ${MOUNT}/.
264	(cd ${DESTDIR}/; \
265		ls ${CPIO_FILES} | cpio -pdamuv ${MOUNT})
266	(cd ${DESTDIR}/; \
267	    find ${CPIO_CPIO} | cpio -oav | gzip -9 >${MOUNT}/inst2.cpio.gz)
268	install -c -o root -g wheel -m 755 etc.i386/inst2.profile \
269	    ${MOUNT}/.profile
270	install -c -o root -g wheel -m 755 etc.i386/inst2.install \
271	    ${MOUNT}/install
272	df -ik ${MOUNT}
273	umount /dev/${FLOPPY}a
274	fsck /dev/r${FLOPPY}a
275	dd if=/dev/r${FLOPPY}a of=${DESTDIR}/../cpio-floppy \
276		bs=15b count=160
277	gzip --no-name -9 -c ${DESTDIR}/../cpio-floppy \
278		>${DESTDIR}/../cpio-floppy.gz
279
280distrib-dirs:
281	mtree -u -f mtree/BSD.root.dist -p ${DESTDIR}/
282	mtree -u -f mtree/BSD.var.dist -p ${DESTDIR}/var
283	mtree -u -f mtree/BSD.usr.dist -p ${DESTDIR}/usr
284	cd ${DESTDIR}; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys
285
286.include <bsd.prog.mk>
287