Makefile revision 1.106
1#	$OpenBSD: Makefile,v 1.106 2000/01/11 13:50:03 peter 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=	aliases 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 ifaliases 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 kerberosIV; \
87		${INSTALL} -c -o root -g wheel -m 644 README \
88		    ${DESTDIR}/etc/kerberosIV; \
89		${INSTALL} -c -o root -g wheel -m 644 krb.conf \
90		    ${DESTDIR}/etc/kerberosIV; \
91		${INSTALL} -c -o root -g wheel -m 644 krb.realms \
92		    ${DESTDIR}/etc/kerberosIV)
93	(cd amd; \
94		${INSTALL} -c -o root -g wheel -m 644 master.sample \
95		    ${DESTDIR}/etc/amd)
96	(cd mtree; \
97		${INSTALL} -c -o root -g wheel -m 600 special \
98		    ${DESTDIR}/etc/mtree; \
99		${INSTALL} -c -o root -g wheel -m 444 4.4BSD.dist \
100		    ${DESTDIR}/etc/mtree; \
101		${INSTALL} -c -o root -g wheel -m 444 BSD.local.dist \
102		    ${DESTDIR}/etc/mtree; \
103		${INSTALL} -c -o root -g wheel -m 444 BSD.x11.dist \
104		    ${DESTDIR}/etc/mtree)
105	(cd photuris; \
106		${INSTALL} -c -o root -g wheel -m 600 secrets.conf \
107		    ${DESTDIR}/etc/photuris; \
108		${INSTALL} -c -o root -g wheel -m 600 attributes.conf \
109		    ${DESTDIR}/etc/photuris; \
110		${INSTALL} -c -o root -g wheel -m 600 photuris.conf \
111		    ${DESTDIR}/etc/photuris; \
112		${INSTALL} -c -o root -g wheel -m 600 photuris.startup \
113		    ${DESTDIR}/etc/photuris)
114	(cd ppp; \
115		${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
116		    ${DESTDIR}/etc/ppp; \
117		${INSTALL} -c -o root -g wheel -m 600 options \
118		    ${DESTDIR}/etc/ppp; \
119		${INSTALL} -c -o root -g wheel -m 600 options.leaf \
120		    ${DESTDIR}/etc/ppp; \
121		${INSTALL} -c -o root -g wheel -m 600 options.sample \
122		    ${DESTDIR}/etc/ppp; \
123		${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
124		    ${DESTDIR}/etc/ppp; \
125		${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
126		    ${DESTDIR}/etc/ppp; \
127		${INSTALL} -c -o root -g wheel -m 644 ppp.conf.sample \
128		    ${DESTDIR}/etc/ppp; \
129		${INSTALL} -c -o root -g wheel -m 644 ppp.linkup.sample \
130		    ${DESTDIR}/etc/ppp; \
131		${INSTALL} -c -o root -g wheel -m 644 ppp.linkdown.sample \
132		    ${DESTDIR}/etc/ppp; \
133		${INSTALL} -c -o root -g wheel -m 644 ppp.secret.sample \
134		    ${DESTDIR}/etc/ppp)
135	(cd afs; \
136		${INSTALL} -c -o root -g wheel -m 644 afsd.conf \
137		    ${DESTDIR}/etc/afs; \
138		${INSTALL} -c -o root -g wheel -m 644 ThisCell \
139		    ${DESTDIR}/etc/afs; \
140		${INSTALL} -c -o root -g wheel -m 644 CellServDB \
141		    ${DESTDIR}/etc/afs; \
142		${INSTALL} -c -o root -g wheel -m 644 SuidCells \
143		    ${DESTDIR}/etc/afs; \
144		${INSTALL} -c -o root -g wheel -m 644 README \
145		    ${DESTDIR}/etc/afs)
146	(cd namedb; \
147	    ${INSTALL} -c -o root -g ${BINGRP} -m 644 named.boot \
148		${DESTDIR}/var/named; \
149	    ${INSTALL} -c -o named -g ${BINGRP} -m 644 ${NAMEDB} \
150		${DESTDIR}/var/named/namedb)
151	/bin/rm -f ${DESTDIR}/etc/localtime
152	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
153	/bin/rm -f ${DESTDIR}/etc/rmt
154	ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
155	${INSTALL} -c -o root -g wheel -m 644 minfree \
156		${DESTDIR}/var/crash
157	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
158		${DESTDIR}/etc/dumpdates
159	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
160		${DESTDIR}/etc/skeykeys
161	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
162		${DESTDIR}/var/at/at.deny
163	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
164		${DESTDIR}/var/cron/log
165	${INSTALL} -c -o root -g wheel -m 444 /dev/null \
166		${DESTDIR}/var/db/locate.database
167	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
168		${DESTDIR}/var/log/authlog
169	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
170		${DESTDIR}/var/log/daemon
171	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
172		${DESTDIR}/var/log/ftpd
173	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
174		${DESTDIR}/var/log/ipflog
175	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
176		${DESTDIR}/var/log/lastlog
177	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
178		${DESTDIR}/var/log/lpd-errs
179	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
180		${DESTDIR}/var/log/maillog
181	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
182		${DESTDIR}/var/log/messages
183	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
184		${DESTDIR}/var/log/secure
185	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
186		${DESTDIR}/var/log/wtmp
187	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
188		${DESTDIR}/var/log/xferlog
189	${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
190		${DESTDIR}/var/msgs/bounds
191	${INSTALL} -c -o ${BINOWN} -g utmp -m 664 /dev/null \
192		${DESTDIR}/var/run/utmp
193.if (${MACHINE_ARCH} == "mips")
194	(cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g wheel -m 444 \
195	    ld.so.conf ${DESTDIR}/etc)
196.endif
197	(cd ${DESTDIR}/dev; ./MAKEDEV all)
198.if ${MACHINE} == "vax"
199	(cd etc.vax; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${PCS} \
200	    ${DESTDIR}/)
201.endif
202	(cd ../usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
203	(cd ../usr.sbin/ypserv/ypinit; ${MAKE} distribution)
204	(cd ../usr.bin/ssh; ${MAKE} distribution)
205	(cd ../usr.sbin/httpd; ${MAKE} -f Makefile.bsd-wrapper distribution)
206	(cd ../lib/libssl; ${MAKE} -f Makefile.bsd-wrapper distribution)
207	(cd ../gnu/usr.bin/lynx; ${MAKE} -f Makefile.bsd-wrapper distribution)
208	(cd ../usr.bin/mail; ${MAKE} distribution)
209	/usr/libexec/sendmail/sendmail -C${DESTDIR}/etc/sendmail.cf -bi -O AliasFile=${DESTDIR}/etc/aliases
210	${INSTALL} -c -o root -g wheel -m 600 root/root.mail \
211		${DESTDIR}/var/mail/root
212
213distribution: distribution-etc-root-var
214	(cd ..; ${MAKE} install)
215
216distrib-dirs:
217	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}
218	-mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -u
219	if [ ! -d ${DESTDIR}/usr/src ]; then \
220		${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \
221	fi
222	cd ${DESTDIR}/; rm -f sys; ln -s usr/src/sys sys
223
224.ifndef RELEASEDIR
225release:
226	@echo setenv RELEASEDIR before building a release.
227	@false
228.else
229release: distribution snap_pre snap_md
230	cd ${.CURDIR}/../distrib/notes; ${MAKE}; ${MAKE} install
231	cd ${.CURDIR}/../distrib/sets; csh maketars ${OSrev}
232	-cp ${DESTDIR}/snapshot/bsd* ${RELEASEDIR}
233	-cp ${DESTDIR}/snapshot/*boot* ${RELEASEDIR}
234	-cp ${DESTDIR}/snapshot/*BOOT* ${RELEASEDIR}
235	-cp ${DESTDIR}/snapshot/INSTALL.* ${RELEASEDIR}
236	-cp ${DESTDIR}/snapshot/*.fs ${DESTDIR}/snapshot/*.fs.gz ${RELEASEDIR}
237	-cd ${RELEASEDIR}; \
238		md5 bsd!(*.gz) *boot* *BOOT* INSTALL.* *.fs *.gz > MD5
239	-cd ${RELEASEDIR}; \
240		cksum bsd!(*.gz) *boot* *BOOT* INSTALL.* *.fs *.gz > CKSUM
241.if defined(MACHINE_HAS_TOOLS)
242	mkdir -p ${RELEASEDIR}/tools
243	cp ${DESTDIR}/snapshot/tools/* ${RELEASEDIR}/tools
244	cd ${RELEASEDIR} && md5 tools/* >>MD5
245	cd ${RELEASEDIR} && cksum tools/* >>CKSUM
246.endif
247	-cd ${RELEASEDIR} && sort -o MD5 MD5
248	-cd ${RELEASEDIR} && sort -o CKSUM -k 3 CKSUM
249.endif
250
251snapshot: distribution snap_pre snap_tar snap_md
252	cd ${DESTDIR}/snapshot && cksum * > CKSUMS
253	cd ${DESTDIR}/snapshot && md5 * > MD5
254
255snap_pre:
256	/bin/rm -rf ${DESTDIR}/snapshot
257	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/snapshot
258
259snap_tar:
260	cd ${DESTDIR} && tar cf - bin \
261	    | ${GZIP} ${GZIPFLAGS} > snapshot/bin.tar${GZIPEXT}
262	cd ${DESTDIR} && tar cf - dev \
263	    | ${GZIP} ${GZIPFLAGS} > snapshot/dev.tar${GZIPEXT}
264	cd ${DESTDIR} && tar cf - .profile .cshrc altroot etc home mnt \
265	    root stand sys tmp | ${GZIP} ${GZIPFLAGS} \
266	    > snapshot/etc.tar${GZIPEXT}
267	cd ${DESTDIR} && tar cf - sbin \
268	    | ${GZIP} ${GZIPFLAGS} > snapshot/sbin.tar${GZIPEXT}
269	cd ${DESTDIR} && tar cf - usr/bin \
270	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.bin.tar${GZIPEXT}
271	cd ${DESTDIR} && tar cf - usr/games \
272	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.games.tar${GZIPEXT}
273	cd ${DESTDIR} && tar cf - usr/include \
274	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.include.tar${GZIPEXT}
275	cd ${DESTDIR} && tar cf - usr/lib \
276	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.lib.tar${GZIPEXT}
277	cd ${DESTDIR} && tar cf - usr/libexec \
278	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.libexec.tar${GZIPEXT}
279	cd ${DESTDIR} && tar cf - usr/mdec usr/libdata usr/lkm usr/local \
280	    usr/src usr/obj | ${GZIP} ${GZIPFLAGS} \
281	    > snapshot/usr.misc.tar${GZIPEXT}
282	cd ${DESTDIR} && tar cf - usr/sbin \
283	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.sbin.tar${GZIPEXT}
284	cd ${DESTDIR} && tar cf - usr/share \
285	    | ${GZIP} ${GZIPFLAGS} > snapshot/usr.share.tar${GZIPEXT}
286	cd ${DESTDIR} && tar cf - var \
287	    | ${GZIP} ${GZIPFLAGS} > snapshot/var.tar${GZIPEXT}
288	cd ../distrib/notes; ${MAKE}; ${MAKE} install
289
290snap_md:
291# nothing here -- look in the machine-dependent Makefile.inc
292
293.endif	# DESTDIR check
294
295.include <bsd.prog.mk>
296