Makefile revision 1.112
1#	$OpenBSD: Makefile,v 1.112 2000/06/19 17:38:44 todd Exp $
2
3TZDIR=		/usr/share/zoneinfo
4LOCALTIME=	US/Pacific
5
6NOOBJ=	oobj
7
8.if exists(etc.${MACHINE}/Makefile.inc)
9.include "etc.${MACHINE}/Makefile.inc"
10.endif
11
12# -rw-r--r--
13BINOWN= root
14BINGRP= wheel
15BIN1=	bootptab changelist ccd.conf csh.cshrc csh.login csh.logout \
16	daily dhcpd.conf dhcpd.interfaces dm.conf exports ftpusers \
17	ftpchroot gettytab group hosts hosts.lpd inetd.conf \
18	ipf.rules ksh.kshrc locate.rc man.conf monthly motd mrouted.conf \
19	myname ipnat.rules netstart networks newsyslog.conf passwd.conf \
20	phones printcap protocols rbootd.conf rc rc.conf rc.local \
21	rc.securelevel rc.shutdown remote rpc rtadvd.conf security services \
22	shells syslog.conf weekly etc.${MACHINE}/disktab dhclient.conf \
23	mailer.conf
24
25# -rw-rw-r--
26BIN2=	motd
27
28NAMEDB=	localhost.rev root.cache
29PCS=	pcs750.bin
30WCS1=	wcs fppwcs poc poc1 poc2 fppoc
31WCS2=	fpevent fppwcs fppwcs_dual hdcwcs load_diags start_fpp wcs wcs_dual
32
33# Use NOGZIP on architectures where the gzip'ing would take too much time
34# (pmax or slower :-)).  This way you get only tar'ed snap files and you can
35# gzip them on a faster machine
36.ifndef NOGZIP
37GZIP?=		gzip
38GZIPFLAGS?=	-9
39GZIPEXT?=	.gz
40.else
41GZIP=		cat
42GZIPFLAGS=
43GZIPEXT=
44.endif
45
46all clean cleandir depend etc install lint:
47
48.ifndef DESTDIR
49distribution-etc-root-var distribution distrib-dirs release snapshot:
50	@echo setenv DESTDIR before doing that!
51	@false
52.else
53distribution-etc-root-var: distrib-dirs
54	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
55	cat etc.${MACHINE}/ttys ttys.pty > ${DESTDIR}/etc/ttys && \
56	    chown ${BINOWN} ${DESTDIR}/etc/ttys && \
57	    chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \
58	    chmod 644 ${DESTDIR}/etc/ttys
59	cat sysctl.conf etc.${MACHINE}/sysctl.conf > ${DESTDIR}/etc/sysctl.conf && \
60	    chown ${BINOWN} ${DESTDIR}/etc/sysctl.conf && \
61	    chgrp ${BINGRP} ${DESTDIR}/etc/sysctl.conf && \
62	    chmod 644 ${DESTDIR}/etc/ttys
63	cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \
64	    chown ${BINOWN} ${DESTDIR}/etc/fbtab && \
65	    chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \
66	    chmod 644 ${DESTDIR}/etc/fbtab
67	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
68	${INSTALL} -c -o root -g wheel -m 600 hosts.equiv ${DESTDIR}/etc
69	${INSTALL} -c -o root -g wheel -m 600 crontab ${DESTDIR}/var/cron/tabs/root
70	${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
71	pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd
72	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
73	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
74	(cd root; \
75		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
76		    ${DESTDIR}/root/.cshrc; \
77		${INSTALL} -c -o root -g wheel -m 600 dot.klogin \
78		    ${DESTDIR}/root/.klogin; \
79		${INSTALL} -c -o root -g wheel -m 644 dot.login \
80		    ${DESTDIR}/root/.login; \
81		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
82		    ${DESTDIR}/root/.profile; \
83		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
84		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
85		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
86	(cd skel; \
87		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
88		    ${DESTDIR}/etc/skel/.cshrc; \
89		${INSTALL} -c -o root -g wheel -m 644 dot.login \
90		    ${DESTDIR}/etc/skel/.login; \
91		${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \
92		    ${DESTDIR}/etc/skel/.mailrc; \
93		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
94		    ${DESTDIR}/etc/skel/.profile; \
95		${INSTALL} -c -o root -g wheel -m 600 dot.rhosts \
96		    ${DESTDIR}/etc/skel/.rhosts)
97	(cd kerberosIV; \
98		${INSTALL} -c -o root -g wheel -m 644 README \
99		    ${DESTDIR}/etc/kerberosIV; \
100		${INSTALL} -c -o root -g wheel -m 644 krb.conf \
101		    ${DESTDIR}/etc/kerberosIV; \
102		${INSTALL} -c -o root -g wheel -m 644 krb.realms \
103		    ${DESTDIR}/etc/kerberosIV)
104	(cd amd; \
105		${INSTALL} -c -o root -g wheel -m 644 master.sample \
106		    ${DESTDIR}/etc/amd)
107	(cd mtree; \
108		${INSTALL} -c -o root -g wheel -m 600 special \
109		    ${DESTDIR}/etc/mtree; \
110		${INSTALL} -c -o root -g wheel -m 444 4.4BSD.dist \
111		    ${DESTDIR}/etc/mtree; \
112		${INSTALL} -c -o root -g wheel -m 444 BSD.local.dist \
113		    ${DESTDIR}/etc/mtree; \
114		${INSTALL} -c -o root -g wheel -m 444 BSD.x11.dist \
115		    ${DESTDIR}/etc/mtree)
116	(cd photuris; \
117		${INSTALL} -c -o root -g wheel -m 600 secrets.conf \
118		    ${DESTDIR}/etc/photuris; \
119		${INSTALL} -c -o root -g wheel -m 600 attributes.conf \
120		    ${DESTDIR}/etc/photuris; \
121		${INSTALL} -c -o root -g wheel -m 600 photuris.conf \
122		    ${DESTDIR}/etc/photuris; \
123		${INSTALL} -c -o root -g wheel -m 600 photuris.startup \
124		    ${DESTDIR}/etc/photuris)
125	(cd ppp; \
126		${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
127		    ${DESTDIR}/etc/ppp; \
128		${INSTALL} -c -o root -g wheel -m 600 options \
129		    ${DESTDIR}/etc/ppp; \
130		${INSTALL} -c -o root -g wheel -m 600 options.leaf \
131		    ${DESTDIR}/etc/ppp; \
132		${INSTALL} -c -o root -g wheel -m 600 options.sample \
133		    ${DESTDIR}/etc/ppp; \
134		${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
135		    ${DESTDIR}/etc/ppp; \
136		${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
137		    ${DESTDIR}/etc/ppp; \
138		${INSTALL} -c -o root -g wheel -m 644 ppp.conf.sample \
139		    ${DESTDIR}/etc/ppp; \
140		${INSTALL} -c -o root -g wheel -m 644 ppp.linkup.sample \
141		    ${DESTDIR}/etc/ppp; \
142		${INSTALL} -c -o root -g wheel -m 644 ppp.linkdown.sample \
143		    ${DESTDIR}/etc/ppp; \
144		${INSTALL} -c -o root -g wheel -m 644 ppp.secret.sample \
145		    ${DESTDIR}/etc/ppp)
146	(cd afs; \
147		${INSTALL} -c -o root -g wheel -m 644 afsd.conf \
148		    ${DESTDIR}/etc/afs; \
149		${INSTALL} -c -o root -g wheel -m 644 ThisCell \
150		    ${DESTDIR}/etc/afs; \
151		${INSTALL} -c -o root -g wheel -m 644 CellServDB \
152		    ${DESTDIR}/etc/afs; \
153		${INSTALL} -c -o root -g wheel -m 644 SuidCells \
154		    ${DESTDIR}/etc/afs; \
155		${INSTALL} -c -o root -g wheel -m 644 README \
156		    ${DESTDIR}/etc/afs)
157	(cd namedb; \
158	    ${INSTALL} -c -o root -g ${BINGRP} -m 644 named.boot \
159		${DESTDIR}/var/named; \
160	    ${INSTALL} -c -o named -g ${BINGRP} -m 644 ${NAMEDB} \
161		${DESTDIR}/var/named/namedb)
162	/bin/rm -f ${DESTDIR}/etc/localtime
163	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
164	/bin/rm -f ${DESTDIR}/etc/rmt
165	ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
166	${INSTALL} -c -o root -g wheel -m 644 minfree \
167		${DESTDIR}/var/crash
168	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
169		${DESTDIR}/etc/dumpdates
170	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
171		${DESTDIR}/etc/skeykeys
172	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
173		${DESTDIR}/var/at/at.deny
174	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
175		${DESTDIR}/var/cron/log
176	${INSTALL} -c -o root -g wheel -m 444 /dev/null \
177		${DESTDIR}/var/db/locate.database
178	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
179		${DESTDIR}/var/log/authlog
180	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
181		${DESTDIR}/var/log/daemon
182	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
183		${DESTDIR}/var/log/ftpd
184	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
185		${DESTDIR}/var/log/ipflog
186	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
187		${DESTDIR}/var/log/lastlog
188	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
189		${DESTDIR}/var/log/lpd-errs
190	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
191		${DESTDIR}/var/log/maillog
192	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
193		${DESTDIR}/var/log/messages
194	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
195		${DESTDIR}/var/log/secure
196	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
197		${DESTDIR}/var/log/wtmp
198	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
199		${DESTDIR}/var/log/xferlog
200	${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
201		${DESTDIR}/var/msgs/bounds
202	${INSTALL} -c -o ${BINOWN} -g utmp -m 664 /dev/null \
203		${DESTDIR}/var/run/utmp
204.if (${MACHINE_ARCH} == "mips")
205	(cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g wheel -m 444 \
206	    ld.so.conf ${DESTDIR}/etc)
207.endif
208	(cd ${DESTDIR}/dev; ./MAKEDEV all)
209.if ${MACHINE} == "vax"
210	(cd etc.vax; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
211	    ${DESTDIR}/)
212.endif
213	(cd ../gnu/usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
214	(cd ../usr.sbin/ypserv/ypinit; ${MAKE} distribution)
215	(cd ../usr.bin/ssh; ${MAKE} distribution)
216	(cd ../usr.sbin/httpd; ${MAKE} -f Makefile.bsd-wrapper distribution)
217	(cd ../lib/libssl; ${MAKE} -f Makefile.bsd-wrapper distribution)
218	(cd ../gnu/usr.bin/lynx; ${MAKE} -f Makefile.bsd-wrapper distribution)
219	(cd ../usr.bin/mail; ${MAKE} distribution)
220	${INSTALL} -c -o root -g ${BINGRP} -m 644 aliases \
221	    ${DESTDIR}/etc/mail/aliases
222	/usr/libexec/sendmail/sendmail -C${DESTDIR}/etc/mail/sendmail.cf \
223	    -bi -O AliasFile=${DESTDIR}/etc/mail/aliases
224	${INSTALL} -c -o root -g wheel -m 600 root/root.mail \
225		${DESTDIR}/var/mail/root
226
227distribution: distribution-etc-root-var
228	(cd ..; ${MAKE} install)
229
230distrib-dirs:
231	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}
232	-mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -u
233	if [ ! -d ${DESTDIR}/usr/src ]; then \
234		${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \
235	fi
236	cd ${DESTDIR}/; rm -f sys; ln -s usr/src/sys sys
237
238.ifndef RELEASEDIR
239release:
240	@echo setenv RELEASEDIR before building a release.
241	@false
242.else
243release: distribution snap_pre snap_md
244	cd ${.CURDIR}/../distrib/notes; ${MAKE}; ${MAKE} install
245	cd ${.CURDIR}/../distrib/sets; csh maketars ${OSrev}
246	-cp ${DESTDIR}/snapshot/bsd* ${RELEASEDIR}
247	-cp ${DESTDIR}/snapshot/*boot* ${RELEASEDIR}
248	-cp ${DESTDIR}/snapshot/*BOOT* ${RELEASEDIR}
249	-cp ${DESTDIR}/snapshot/INSTALL.* ${RELEASEDIR}
250	-cp ${DESTDIR}/snapshot/*.fs ${DESTDIR}/snapshot/*.fs.gz ${RELEASEDIR}
251	-cd ${RELEASEDIR}; \
252		md5 bsd!(*.gz) *boot* *BOOT* INSTALL.* *.fs *.gz *.tgz > MD5
253	-cd ${RELEASEDIR}; \
254		cksum bsd!(*.gz) *boot* *BOOT* INSTALL.* *.fs *.gz *.tgz > CKSUM
255.if defined(MACHINE_HAS_TOOLS)
256	mkdir -p ${RELEASEDIR}/tools
257	cp ${DESTDIR}/snapshot/tools/* ${RELEASEDIR}/tools
258	cd ${RELEASEDIR} && md5 tools/* >>MD5
259	cd ${RELEASEDIR} && cksum tools/* >>CKSUM
260.endif
261	-cd ${RELEASEDIR} && sort -o MD5 MD5
262	-cd ${RELEASEDIR} && sort -o CKSUM -k 3 CKSUM
263.endif
264
265snapshot: distribution snap_pre snap_tar snap_md
266	cd ${DESTDIR}/snapshot && cksum * > CKSUMS
267	cd ${DESTDIR}/snapshot && md5 * > MD5
268
269snap_pre:
270	/bin/rm -rf ${DESTDIR}/snapshot
271	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/snapshot
272
273snap_tar:
274	cd ${DESTDIR} && tar cf - bin \
275	    | ${GZIP} ${GZIPFLAGS} > snapshot/bin.tar${GZIPEXT}
276	cd ${DESTDIR} && tar cf - dev \
277	    | ${GZIP} ${GZIPFLAGS} > snapshot/dev.tar${GZIPEXT}
278	cd ${DESTDIR} && tar cf - .profile .cshrc altroot etc home mnt \
279	    root stand sys tmp | ${GZIP} ${GZIPFLAGS} \
280	    > snapshot/etc.tar${GZIPEXT}
281	cd ${DESTDIR} && tar cf - sbin \
282	    | ${GZIP} ${GZIPFLAGS} > snapshot/sbin.tar${GZIPEXT}
283	cd ${DESTDIR} && tar cf - usr/bin \
284	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.bin.tar${GZIPEXT}
285	cd ${DESTDIR} && tar cf - usr/games \
286	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.games.tar${GZIPEXT}
287	cd ${DESTDIR} && tar cf - usr/include \
288	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.include.tar${GZIPEXT}
289	cd ${DESTDIR} && tar cf - usr/lib \
290	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.lib.tar${GZIPEXT}
291	cd ${DESTDIR} && tar cf - usr/libexec \
292	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.libexec.tar${GZIPEXT}
293	cd ${DESTDIR} && tar cf - usr/mdec usr/libdata usr/lkm usr/local \
294	    usr/src usr/obj | ${GZIP} ${GZIPFLAGS} \
295	    > snapshot/usr.misc.tar${GZIPEXT}
296	cd ${DESTDIR} && tar cf - usr/sbin \
297	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.sbin.tar${GZIPEXT}
298	cd ${DESTDIR} && tar cf - usr/share \
299	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.share.tar${GZIPEXT}
300	cd ${DESTDIR} && tar cf - var \
301	    | ${GZIP} ${GZIPFLAGS} > snapshot/var.tar${GZIPEXT}
302	cd ../distrib/notes; ${MAKE}; ${MAKE} install
303
304snap_md:
305# nothing here -- look in the machine-dependent Makefile.inc
306
307.endif	# DESTDIR check
308
309.include <bsd.prog.mk>
310