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