Makefile revision 1.281
1#	$OpenBSD: Makefile,v 1.281 2009/10/01 19:01:28 matthieu Exp $
2
3TZDIR=		/usr/share/zoneinfo
4LOCALTIME=	Canada/Mountain
5
6NOOBJ=
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=	changelist ccd.conf csh.cshrc csh.login csh.logout daily dhcpd.conf \
16	exports ftpusers ftpchroot gettytab group hosts hosts.lpd inetd.conf \
17	ksh.kshrc locate.rc man.conf monthly motd mrouted.conf myname \
18	netstart networks newsyslog.conf phones printcap protocols \
19	rbootd.conf rc rc.conf rc.local rc.securelevel rc.shutdown \
20	remote rpc security services shells syslog.conf weekly \
21	etc.${MACHINE}/disktab dhclient.conf mailer.conf ntpd.conf \
22	moduli pf.os sensorsd.conf ifstated.conf
23
24.if ${MACHINE} != "aviion" && ${MACHINE} != "mvme68k" && \
25    ${MACHINE} != "mvme88k"
26BIN1+=	wsconsctl.conf
27.endif
28
29# -rw-rw-r--
30BIN2=	motd
31
32MISETS=	base${OSrev}.tgz comp${OSrev}.tgz misc${OSrev}.tgz \
33	man${OSrev}.tgz game${OSrev}.tgz etc${OSrev}.tgz
34
35PCS=	pcs750.bin
36
37# Use NOGZIP on architectures where the gzip'ing would take too much time
38# (pmax or slower :-)).  This way you get only tar'ed snap files and you can
39# gzip them on a faster machine
40.ifndef NOGZIP
41GZIPCMD?=	gzip
42GZIPFLAGS?=	-9
43GZIPEXT?=	.gz
44.else
45GZIPCMD=	cat
46GZIPFLAGS=
47GZIPEXT=
48.endif
49
50all clean cleandir depend etc install lint:
51
52.ifndef DESTDIR
53distribution-etc-root-var distribution distrib-dirs release:
54	@echo setenv DESTDIR before doing that!
55	@false
56.else
57distribution-etc-root-var: distrib-dirs
58	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
59	ksh ttys.pty | cat etc.${MACHINE}/ttys - > ${DESTDIR}/etc/ttys && \
60	    chown ${BINOWN} ${DESTDIR}/etc/ttys && \
61	    chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \
62	    chmod 644 ${DESTDIR}/etc/ttys
63	cat sysctl.conf etc.${MACHINE}/sysctl.conf > ${DESTDIR}/etc/sysctl.conf && \
64	    chown ${BINOWN} ${DESTDIR}/etc/sysctl.conf && \
65	    chgrp ${BINGRP} ${DESTDIR}/etc/sysctl.conf && \
66	    chmod 644 ${DESTDIR}/etc/sysctl.conf
67	cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \
68	    chown ${BINOWN} ${DESTDIR}/etc/fbtab && \
69	    chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \
70	    chmod 644 ${DESTDIR}/etc/fbtab
71	awk -f ${.CURDIR}/mklogin.conf `test -f etc.${MACHINE}/login.conf.overrides && echo etc.${MACHINE}/login.conf.overrides` < ${.CURDIR}/login.conf.in > \
72	    ${DESTDIR}/etc/login.conf && \
73	    chown ${BINOWN}:${BINGRP} ${DESTDIR}/etc/login.conf && \
74	    chmod 644 ${DESTDIR}/etc/login.conf
75	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
76	${INSTALL} -c -o root -g wheel -m 600 hosts.equiv ${DESTDIR}/etc
77	${INSTALL} -c -o root -g crontab -m 600 crontab ${DESTDIR}/var/cron/tabs/root
78	${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
79	pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd
80	${INSTALL} -c -o root -g wheel -m 600 bgpd.conf ${DESTDIR}/etc
81	${INSTALL} -c -o root -g wheel -m 600 ospfd.conf ${DESTDIR}/etc
82	${INSTALL} -c -o root -g wheel -m 600 ospf6d.conf ${DESTDIR}/etc
83	${INSTALL} -c -o root -g wheel -m 600 ripd.conf ${DESTDIR}/etc
84	${INSTALL} -c -o root -g wheel -m 600 dvmrpd.conf ${DESTDIR}/etc
85	${INSTALL} -c -o root -g wheel -m 600 pf.conf ${DESTDIR}/etc
86	${INSTALL} -c -o root -g operator -m 644 chio.conf ${DESTDIR}/etc
87	${INSTALL} -c -o root -g wheel -m 600 hostapd.conf ${DESTDIR}/etc
88	${INSTALL} -c -o root -g wheel -m 600 relayd.conf ${DESTDIR}/etc
89	${INSTALL} -c -o root -g wheel -m 600 ipsec.conf ${DESTDIR}/etc
90	${INSTALL} -c -o root -g wheel -m 600 sasyncd.conf ${DESTDIR}/etc
91	${INSTALL} -c -o root -g wheel -m 600 snmpd.conf ${DESTDIR}/etc
92	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
93	    etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
94	cd root; \
95		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
96		    ${DESTDIR}/root/.cshrc; \
97		${INSTALL} -c -o root -g wheel -m 600 dot.klogin \
98		    ${DESTDIR}/root/.klogin; \
99		${INSTALL} -c -o root -g wheel -m 644 dot.login \
100		    ${DESTDIR}/root/.login; \
101		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
102		    ${DESTDIR}/root/.profile; \
103		${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
104		    ${DESTDIR}/root/.Xdefaults; \
105		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
106		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
107		    ${DESTDIR}/.cshrc; \
108		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
109		    ${DESTDIR}/.profile
110	cd skel; \
111		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
112		    ${DESTDIR}/etc/skel/.cshrc; \
113		${INSTALL} -c -o root -g wheel -m 644 dot.login \
114		    ${DESTDIR}/etc/skel/.login; \
115		${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \
116		    ${DESTDIR}/etc/skel/.mailrc; \
117		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
118		    ${DESTDIR}/etc/skel/.profile; \
119		${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
120		    ${DESTDIR}/etc/skel/.Xdefaults; \
121		${INSTALL} -c -o root -g wheel -m 600 /dev/null \
122		    ${DESTDIR}/etc/skel/.ssh/authorized_keys
123	cd kerberosV; \
124		${INSTALL} -c -o root -g wheel -m 644 README \
125		    ${DESTDIR}/etc/kerberosV; \
126		${INSTALL} -c -o root -g wheel -m 644 krb5.conf.example \
127		    ${DESTDIR}/etc/kerberosV
128	cd amd; \
129		${INSTALL} -c -o root -g wheel -m 644 master.sample \
130		    ${DESTDIR}/etc/amd
131	cd mtree; \
132		${INSTALL} -c -o root -g wheel -m 600 special \
133		    ${DESTDIR}/etc/mtree; \
134		${INSTALL} -c -o root -g wheel -m 444 4.4BSD.dist \
135		    ${DESTDIR}/etc/mtree; \
136		${INSTALL} -c -o root -g wheel -m 444 BSD.local.dist \
137		    ${DESTDIR}/etc/mtree; \
138		${INSTALL} -c -o root -g wheel -m 444 BSD.x11.dist \
139		    ${DESTDIR}/etc/mtree
140	cd ppp; \
141		${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
142		    ${DESTDIR}/etc/ppp; \
143		${INSTALL} -c -o root -g wheel -m 600 options \
144		    ${DESTDIR}/etc/ppp; \
145		${INSTALL} -c -o root -g wheel -m 600 options.leaf \
146		    ${DESTDIR}/etc/ppp; \
147		${INSTALL} -c -o root -g wheel -m 600 options.sample \
148		    ${DESTDIR}/etc/ppp; \
149		${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
150		    ${DESTDIR}/etc/ppp; \
151		${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
152		    ${DESTDIR}/etc/ppp; \
153		${INSTALL} -c -o root -g wheel -m 600 ppp.conf.sample \
154		    ${DESTDIR}/etc/ppp; \
155		${INSTALL} -c -o root -g wheel -m 644 ppp.linkup.sample \
156		    ${DESTDIR}/etc/ppp; \
157		${INSTALL} -c -o root -g wheel -m 644 ppp.linkdown.sample \
158		    ${DESTDIR}/etc/ppp; \
159		${INSTALL} -c -o root -g wheel -m 644 ppp.secret.sample \
160		    ${DESTDIR}/etc/ppp
161	cd afs; \
162		${INSTALL} -c -o root -g wheel -m 644 afsd.conf \
163		    ${DESTDIR}/etc/afs; \
164		${INSTALL} -c -o root -g wheel -m 644 ThisCell \
165		    ${DESTDIR}/etc/afs; \
166		${INSTALL} -c -o root -g wheel -m 644 CellServDB \
167		    ${DESTDIR}/etc/afs; \
168		${INSTALL} -c -o root -g wheel -m 644 SuidCells \
169		    ${DESTDIR}/etc/afs; \
170		${INSTALL} -c -o root -g wheel -m 644 README \
171		    ${DESTDIR}/etc/afs
172	cd systrace; \
173		${INSTALL} -c -o root -g wheel -m 600 usr_sbin_lpd \
174		    ${DESTDIR}/etc/systrace; \
175		${INSTALL} -c -o root -g wheel -m 600 usr_sbin_named \
176		    ${DESTDIR}/etc/systrace
177	cd bind; \
178		${INSTALL} -c -o root -g named -m 640 named-simple.conf \
179		    ${DESTDIR}/var/named/etc/named.conf; \
180		${INSTALL} -c -o root -g named -m 640 named-*.conf \
181		    ${DESTDIR}/var/named/etc; \
182		${INSTALL} -c -o root -g wheel -m 644 root.hint \
183		    ${DESTDIR}/var/named/etc; \
184		${INSTALL} -c -o root -g wheel -m 644 db.localhost \
185		    ${DESTDIR}/var/named/standard/localhost; \
186		${INSTALL} -c -o root -g wheel -m 644 db.loopback \
187		    ${DESTDIR}/var/named/standard/loopback; \
188		${INSTALL} -c -o root -g wheel -m 644 db.loopback6.arpa \
189		    ${DESTDIR}/var/named/standard/loopback6.arpa
190	/bin/rm -f ${DESTDIR}/etc/localtime
191	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
192	/bin/rm -f ${DESTDIR}/etc/rmt
193	ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
194	${INSTALL} -c -o root -g wheel -m 644 minfree \
195	    ${DESTDIR}/var/crash
196	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
197	    ${DESTDIR}/etc/dumpdates
198	${INSTALL} -c -o root -g crontab -m 660 /dev/null \
199	    ${DESTDIR}/var/cron/at.deny
200	${INSTALL} -c -o root -g crontab -m 660 /dev/null \
201	    ${DESTDIR}/var/cron/cron.deny
202	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
203	    ${DESTDIR}/var/cron/log
204	${INSTALL} -c -o root -g wheel -m 444 /dev/null \
205	    ${DESTDIR}/var/db/locate.database
206	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
207	    ${DESTDIR}/var/log/authlog
208	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
209	    ${DESTDIR}/var/log/daemon
210	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
211	    ${DESTDIR}/var/log/failedlogin
212	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
213	    ${DESTDIR}/var/log/ftpd
214	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
215	    ${DESTDIR}/var/log/lastlog
216	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
217	    ${DESTDIR}/var/log/lpd-errs
218	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
219	    ${DESTDIR}/var/log/maillog
220	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
221	    ${DESTDIR}/var/log/messages
222	${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
223	    ${DESTDIR}/var/log/secure
224	${INSTALL} -c -o ${BINOWN} -g wheel -m 664 /dev/null \
225	    ${DESTDIR}/var/log/sendmail.st
226	${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
227	    ${DESTDIR}/var/log/wtmp
228	${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
229	    ${DESTDIR}/var/log/xferlog
230	${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
231	    ${DESTDIR}/var/msgs/bounds
232	${INSTALL} -c -o ${BINOWN} -g utmp -m 664 /dev/null \
233	    ${DESTDIR}/var/run/utmp
234.if ${MACHINE} == "vax"
235	uudecode -p etc.vax/${PCS}.uu > ${DESTDIR}/${PCS} && \
236	    chown ${BINOWN} ${DESTDIR}/${PCS} && \
237	    chgrp ${BINGRP} ${DESTDIR}/${PCS} && \
238	    chmod 644 ${DESTDIR}/${PCS}
239.endif
240	cd ../gnu/usr.sbin/sendmail/cf/cf && exec ${MAKE} distribution
241	cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution
242	cd ../usr.bin/ssh && exec ${MAKE} distribution
243	cd ../usr.sbin/httpd && exec ${MAKE} -f Makefile.bsd-wrapper distribution
244	cd ../lib/libssl && exec ${MAKE} distribution
245	cd ../gnu/usr.bin/lynx && exec ${MAKE} -f Makefile.bsd-wrapper distribution
246	cd ../usr.bin/bgplg && exec ${MAKE} distribution
247	cd ../usr.bin/mail && exec ${MAKE} distribution
248	cd mail && exec ${MAKE} distribution
249	${INSTALL} -c -o root -g wheel -m 600 root/root.mail \
250	    ${DESTDIR}/var/mail/root
251	${INSTALL} -c -o root -g wheel -m 440 ../usr.bin/sudo/sudoers \
252	    ${DESTDIR}/etc/sudoers
253
254distribution:
255	exec ${SUDO} ${MAKE} distribution-etc-root-var
256	cd .. && exec ${SUDO} ${MAKE} install
257
258distrib-dirs:
259	if [ ! -d ${DESTDIR}/. ]; then \
260		${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}; \
261	fi
262	mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -U
263	if [ ! -d ${DESTDIR}/usr/src ]; then \
264		${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \
265	fi
266	cd ${DESTDIR}/; rm -f sys; ln -s usr/src/sys sys
267
268.ifndef RELEASEDIR
269release:
270	@echo setenv RELEASEDIR before building a release.
271	@false
272.else
273
274release-sets:
275	cd ${.CURDIR}/../distrib/sets && exec ${SUDO} sh maketars ${OSrev}
276
277sha:
278	-cd ${RELEASEDIR}; \
279	    sum -a sha256 INSTALL.`arch -ks` ${MDEXT} ${MISETS} > SHA256
280
281release: distribution kernels release-sets distrib sha
282
283.endif
284
285.endif	# DESTDIR check
286
287distrib:
288	cd ${.CURDIR}/../distrib && \
289	    ${MAKE} && exec ${SUDO} ${MAKE} install
290
291DHSIZE=1024 1536 2048 3072 4096
292update-moduli:
293	( \
294		echo -n '#    $Open'; echo 'BSD$'; \
295		echo '# Time Type Tests Tries Size Generator Modulus'; \
296		( for i in ${DHSIZE}; do \
297			ssh-keygen -b $$i -G /dev/stdout; \
298		done) | \
299		ssh-keygen -T /dev/stdout \
300	) > moduli
301
302.PHONY: distribution-etc-root-var distribution distrib-dirs \
303	release allarchs kernels release-sets m4
304
305SUBDIR+= etc.alpha etc.amd64 etc.armish etc.aviion etc.hp300 etc.hppa
306SUBDIR+= etc.hppa64 etc.i386 etc.landisk etc.luna88k etc.mac68k etc.macppc
307SUBDIR+= etc.mvme68k etc.mvme88k etc.palm etc.sgi etc.socppc etc.sparc
308SUBDIR+= etc.sparc64 etc.vax etc.zaurus
309
310.include <bsd.subdir.mk>
311.include <bsd.prog.mk>
312