Makefile revision 253853
11195Srgrimes#	from: @(#)Makefile	5.11 (Berkeley) 5/21/91
250472Speter# $FreeBSD: head/etc/Makefile 253853 2013-08-01 05:50:42Z jlh $
337Srgrimes
4156813Sru.include <bsd.own.mk>
5156813Sru
6156813Sru.if ${MK_SENDMAIL} != "no"
738103SpeterSUBDIR=	sendmail
873251Sgshapiro.endif
938103Speter
10236965SdesBIN1=	crontab \
11231849Seadler	devd.conf \
12231849Seadler	devfs.conf \
13231849Seadler	ddb.conf \
14231849Seadler	dhclient.conf \
15231849Seadler	disktab \
16231849Seadler	fbtab \
17231849Seadler	ftpusers \
18231849Seadler	gettytab \
19231849Seadler	group \
20231849Seadler	hosts \
21231849Seadler	hosts.allow \
22231849Seadler	hosts.equiv \
23231849Seadler	inetd.conf \
24231849Seadler	libalias.conf \
25253853Sjlh	libmap.conf \
26231849Seadler	login.access \
27231849Seadler	login.conf \
28231849Seadler	mac.conf \
29231849Seadler	motd \
30231849Seadler	netconfig \
31231849Seadler	network.subr \
32231849Seadler	networks \
33231849Seadler	newsyslog.conf \
34231849Seadler	nsswitch.conf \
35231849Seadler	phones \
36231849Seadler	profile \
37231849Seadler	protocols \
38231849Seadler	rc \
39231849Seadler	rc.bsdextended \
40231849Seadler	rc.firewall \
41231849Seadler	rc.initdiskless \
42231849Seadler	rc.sendmail \
43231849Seadler	rc.shutdown \
44231849Seadler	rc.subr \
45231849Seadler	remote \
46231849Seadler	rpc \
47231849Seadler	services \
48231849Seadler	shells \
49231849Seadler	sysctl.conf \
50231849Seadler	syslog.conf \
51231849Seadler	termcap.small
52155210Srwatson
53199249Sed.if exists(${.CURDIR}/etc.${MACHINE}/ttys)
54199249SedBIN1+=	etc.${MACHINE}/ttys
55209134Simp.elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
56209134SimpBIN1+=	etc.${MACHINE_ARCH}/ttys
57209134Simp.elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
58209134SimpBIN1+=	etc.${MACHINE_CPUARCH}/ttys
59199249Sed.else
60209134Simp.error etc.MACHINE/ttys missing
61199249Sed.endif
62199249Sed
63155210SrwatsonOPENBSMDIR=			${.CURDIR}/../contrib/openbsm
64155210SrwatsonBSM_ETC_OPEN_FILES=		${OPENBSMDIR}/etc/audit_class \
65155210Srwatson				${OPENBSMDIR}/etc/audit_event
66155210SrwatsonBSM_ETC_RESTRICTED_FILES=	${OPENBSMDIR}/etc/audit_control \
67155210Srwatson				${OPENBSMDIR}/etc/audit_user
68155210SrwatsonBSM_ETC_EXEC_FILES=		${OPENBSMDIR}/etc/audit_warn
69155210SrwatsonBSM_ETC_DIR=			${DESTDIR}/etc/security
70155210Srwatson
71183242Ssam# NB: keep these sorted by MK_* knobs
72183242Ssam
73183242Ssam.if ${MK_AMD} != "no"
74183242SsamBIN1+= amd.map
75183242Ssam.endif
76183242Ssam
77183242Ssam.if ${MK_APM} != "no"
78183242SsamBIN1+= apmd.conf
79183242Ssam.endif
80183242Ssam
81183242Ssam.if ${MK_BSNMP} != "no"
82183242SsamBIN1+= snmpd.config
83183242Ssam.endif
84183242Ssam
85183242Ssam.if ${MK_FREEBSD_UPDATE} != "no"
86183242SsamBIN1+= freebsd-update.conf
87183242Ssam.endif
88183242Ssam
89183242Ssam.if ${MK_LOCATE} != "no"
90183242SsamBIN1+=	${.CURDIR}/../usr.bin/locate/locate/locate.rc
91183242Ssam.endif
92183242Ssam
93156813Sru.if ${MK_LPR} != "no"
94183242SsamBIN1+=	hosts.lpd printcap
95121911Smarkm.endif
9637Srgrimes
97183242Ssam.if ${MK_MAIL} != "no"
98183242SsamBIN1+=	${.CURDIR}/../usr.bin/mail/misc/mail.rc
99158115Sume.endif
100158115Sume
101193635Sedwin.if ${MK_NTP} != "no"
102193635SedwinBIN1+=	ntp.conf
103193635Sedwin.endif
104193635Sedwin
105156813Sru.if ${MK_OPENSSH} != "no"
10657488SpeterSSH=	${.CURDIR}/../crypto/openssh/ssh_config \
10774837Sgreen	${.CURDIR}/../crypto/openssh/sshd_config \
108124214Sdes	${.CURDIR}/../crypto/openssh/moduli
10957459Smarkm.endif
110156813Sru.if ${MK_OPENSSL} != "no"
11160677SkrisSSL=	${.CURDIR}/../crypto/openssl/apps/openssl.cnf
11260677Skris.endif
11360677Skris
114183242Ssam.if ${MK_NS_CACHING} != "no"
115183242SsamBIN1+= nscd.conf
116183242Ssam.endif
117183242Ssam
118183242Ssam.if ${MK_PORTSNAP} != "no"
119183242SsamBIN1+= portsnap.conf
120183242Ssam.endif
121183242Ssam
122183242Ssam.if ${MK_PF} != "no"
123183242SsamBIN1+= pf.os
124183242Ssam.endif
125183242Ssam
126184343Ssam.if ${MK_TCSH} != "no"
127184343SsamBIN1+= csh.cshrc csh.login csh.logout
128184343Ssam.endif
129184343Ssam
130183268Ssam.if ${MK_WIRELESS} != "no"
131183268SsamBIN1+= regdomain.xml
132183268Ssam.endif
133183268Ssam
13482521Salex# -rwxr-xr-x root:wheel, for the new cron root:wheel
135108002SgreenBIN2=	netstart pccard_ether rc.suspend rc.resume
136147Srgrimes
137196767SflzMTREE=	BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
138156813Sru.if ${MK_SENDMAIL} != "no"
13995144SgshapiroMTREE+=	BSD.sendmail.dist
14095144Sgshapiro.endif
141156813Sru.if ${MK_BIND} != "no"
142135851SdougbMTREE+=	BIND.chroot.dist
143156813Sru.if ${MK_BIND_LIBS} != "no"
144135851SdougbMTREE+=	BIND.include.dist
145135851Sdougb.endif
146135851Sdougb.endif
147251512Semaste.if ${MK_DEBUG_FILES} != "no"
148251512SemasteMTREE+=	BSD.debug.dist
149251512Semaste.endif
15099451Sru
15199451SruPPPCNF=	ppp.conf
15299451Sru
153156813Sru.if ${MK_SENDMAIL} == "no"
154117292SgshapiroETCMAIL=mailer.conf aliases
155117292Sgshapiro.else
15664598SgshapiroETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
15764598Sgshapiro	mailertable.sample aliases
158117292Sgshapiro.endif
15937Srgrimes
160263Srgrimes# Special top level files for FreeBSD
16199449SruFREEBSD=COPYRIGHT
162263Srgrimes
163245825Sbrooks# Sanitize DESTDIR
164245825SbrooksDESTDIR:=	${DESTDIR:C://*:/:g}
165245825Sbrooks
166124831Sruafterinstall:
167156813Sru.if ${MK_MAN} != "no"
168173135Syar	${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
169124831Sru.endif
170124831Sru
1714487Sphkdistribute:
172173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} install DESTDIR=${DISTDIR}/${DISTRIBUTION}
173173135Syar	${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
1745948Sjkh
175142794Sru.include <bsd.endian.mk>
176142794Sru.if ${TARGET_ENDIANNESS} == "1234"
177152471SruCAP_MKDB_ENDIAN?= -l
178152471SruPWD_MKDB_ENDIAN?= -L
179142794Sru.elif ${TARGET_ENDIANNESS} == "4321"
180152471SruCAP_MKDB_ENDIAN?= -b
181152471SruPWD_MKDB_ENDIAN?= -B
182142794Sru.else
183149515SimpCAP_MKDB_ENDIAN?=
184149515SimpPWD_MKDB_ENDIAN?=
185142794Sru.endif
186142794Sru
187246097Sbrooks.if defined(NO_ROOT)
188246097SbrooksMETALOG.add?=	cat -l >> ${METALOG}
189246097Sbrooks.endif
190246097Sbrooks
1914487Sphkdistribution:
192148282Sru.if !defined(DESTDIR)
193148282Sru	@echo "set DESTDIR before running \"make ${.TARGET}\""
194148282Sru	@false
195148282Sru.endif
19699449Sru	cd ${.CURDIR}; \
197100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
19899451Sru		${BIN1} ${DESTDIR}/etc; \
199142794Sru	    cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
200100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
20199451Sru		${BIN2} ${DESTDIR}/etc; \
202100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
203184343Ssam		master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
204205329Sed.if ${MK_AT} == "no"
205205335Sed	sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
206205329Sed.endif
207184343Ssam.if ${MK_TCSH} == "no"
208184443Smp	sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
209184343Ssam.endif
210184343Ssam	pwd_mkdb ${PWD_MKDB_ENDIAN} -i -p -d ${DESTDIR}/etc \
211184343Ssam	    ${DESTDIR}/etc/master.passwd
212246097Sbrooks.if defined(NO_ROOT)
213246097Sbrooks	( \
214246097Sbrooks		echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
215246097Sbrooks		echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
216246097Sbrooks		echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
217246097Sbrooks		echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
218246097Sbrooks	) | ${METALOG.add}
219246097Sbrooks.endif
220241823Smarcel.if ${MK_ATF} != "no"
221241823Smarcel	${_+_}cd ${.CURDIR}/atf; ${MAKE} install
222241823Smarcel.endif
223183242Ssam.if ${MK_BLUETOOTH} != "no"
224173135Syar	${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
225183242Ssam.endif
226173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
227186249Sthompsa	${_+_}cd ${.CURDIR}/devd; ${MAKE} install
228173135Syar	${_+_}cd ${.CURDIR}/gss; ${MAKE} install
229173135Syar	${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
230173135Syar	${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
231173135Syar	${_+_}cd ${.CURDIR}/../gnu/usr.bin/send-pr; ${MAKE} etc-gnats-freefall
232173135Syar	${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
233173135Syar	${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
234173135Syar	${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
235155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
236155210Srwatson	    ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
237155571Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
238155210Srwatson	    ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
239155210Srwatson	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
240155210Srwatson	    ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
241170913Sdougb.if ${MK_BIND_MTREE} != "no"
242243101Seadler	if [ ! -e ${DESTDIR}/etc/namedb ]; then \
243170913Sdougb		ln -s ../var/named/etc/namedb ${DESTDIR}/etc/namedb; \
244170913Sdougb	fi
245170913Sdougb.endif
246170913Sdougb.if ${MK_BIND_ETC} != "no"
247173135Syar	${_+_}cd ${.CURDIR}/namedb; ${MAKE} install
248170913Sdougb.endif
249156813Sru.if ${MK_SENDMAIL} != "no"
250173135Syar	${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
25173251Sgshapiro.endif
252156813Sru.if ${MK_OPENSSH} != "no"
253100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
25499451Sru	    ${SSH} ${DESTDIR}/etc/ssh
25557488Speter.endif
256156813Sru.if ${MK_OPENSSL} != "no"
257100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
25899451Sru	    ${SSL} ${DESTDIR}/etc/ssl
25960677Skris.endif
260156813Sru.if ${MK_KERBEROS} != "no"
26199449Sru	cd ${.CURDIR}/root; \
262100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
263120709Sphk		dot.k5login ${DESTDIR}/root/.k5login;
264120709Sphk.endif
265120709Sphk	cd ${.CURDIR}/root; \
266120709Sphk	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
267184343Ssam		dot.profile ${DESTDIR}/root/.profile; \
268184343Ssam	    rm -f ${DESTDIR}/.profile; \
269184343Ssam	    ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
270184343Ssam.if ${MK_TCSH} != "no"
271184343Ssam	cd ${.CURDIR}/root; \
272184343Ssam	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
27399451Sru		dot.cshrc ${DESTDIR}/root/.cshrc; \
274100872Sru	    ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
27599451Sru		dot.login ${DESTDIR}/root/.login; \
276184343Ssam	    rm -f ${DESTDIR}/.cshrc; \
277184343Ssam	    ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
278184343Ssam.endif
279100872Sru	cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
2801731Sjkh	    ${MTREE} ${DESTDIR}/etc/mtree
281183242Ssam.if ${MK_PPP} != "no"
282119058Sobrien	cd ${.CURDIR}/ppp; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
2836177Samurai	    ${PPPCNF} ${DESTDIR}/etc/ppp
284183242Ssam.endif
285183242Ssam.if ${MK_MAIL} != "no"
286100872Sru	cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
28764598Sgshapiro	    ${ETCMAIL} ${DESTDIR}/etc/mail
288243101Seadler	if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
28964629Sgshapiro	      ! -f ${DESTDIR}/etc/aliases ]; then \
29064629Sgshapiro		ln -s mail/aliases ${DESTDIR}/etc/aliases; \
29164629Sgshapiro	fi
292183242Ssam.endif
293100872Sru	${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
29437Srgrimes	    ${DESTDIR}/etc/dumpdates
295100872Sru	${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
296147Srgrimes	    ${DESTDIR}/var/db/locate.database
297100872Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
2981759Sjkh	    ${DESTDIR}/var/crash
299100872Sru	cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
30099451Sru		${FREEBSD} ${DESTDIR}/
301209228Savg.if ${MK_BOOT} != "no"
302171427Simp.if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
303126977Sru	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
304126977Sru	    ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
305126977Sru	    ${DESTDIR}/boot/device.hints
306171427Simp.endif
307209228Savg.endif
308224765Sdougb.if ${MK_NIS} == "no"
309224765Sdougb	sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
310224765Sdougb		${DESTDIR}/etc/nsswitch.conf
311224765Sdougb.endif
31237Srgrimes
313245440SbrooksMTREE_CMD?=	mtree
314245440Sbrooks
315245565SbrooksMTREES=		mtree/BSD.root.dist		/		\
316245565Sbrooks		mtree/BSD.var.dist		/var		\
317245565Sbrooks		mtree/BSD.usr.dist		/usr		\
318245565Sbrooks		mtree/BSD.include.dist		/usr/include
319251512Semaste.if ${MK_DEBUG_FILES} != "no"
320251512SemasteMTREES+=	mtree/BSD.debug.dist		/usr/lib
321251512Semaste.endif
322156813Sru.if ${MK_BIND_LIBS} != "no"
323245565SbrooksMTREES+=	mtree/BIND.include.dist		/usr/include
324135875Sdougb.endif
325156813Sru.if ${MK_BIND_MTREE} != "no"
326245565SbrooksMTREES+=	mtree/BIND.chroot.dist		/var/named
327135875Sdougb.endif
328218941Suqs.if ${MK_GROFF} != "no"
329245565SbrooksMTREES+=	mtree/BSD.groff.dist		/usr
330218941Suqs.endif
331156813Sru.if ${MK_SENDMAIL} != "no"
332245565SbrooksMTREES+=	mtree/BSD.sendmail.dist		/
33395144Sgshapiro.endif
334245565Sbrooks.for mtree in ${LOCAL_MTREE}
335245565SbrooksMTREES+=	../${mtree}			/
336245565Sbrooks.endfor
337245565Sbrooks
338250116Sbrooksdistrib-dirs: ${MTREES:N/*}
339245565Sbrooks	@set ${MTREES}; \
340245565Sbrooks	while test $$# -ge 2; do \
341245565Sbrooks		m=${.CURDIR}/$$1; \
342245565Sbrooks		shift; \
343245565Sbrooks		d=${DESTDIR}$$1; \
344245565Sbrooks		shift; \
345245565Sbrooks		${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \
346245565Sbrooks		    -f $$m -p $$d; \
347245565Sbrooks		${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
348245565Sbrooks	done; true
349245825Sbrooks.if defined(NO_ROOT)
350245825Sbrooks	@set ${MTREES}; \
351245825Sbrooks	while test $$# -ge 2; do \
352245825Sbrooks		m=${.CURDIR}/$$1; \
353245825Sbrooks		shift; \
354245825Sbrooks		d=$$1; \
355245825Sbrooks		test "$$d" == "/" && d=""; \
356245825Sbrooks		d=${DISTBASE}$$d; \
357245825Sbrooks		shift; \
358246127Sbrooks		${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
359246127Sbrooks		    "sed s#^\.#.$$d# | ${METALOG.add}" ; \
360246127Sbrooks		${MTREE_CMD:N-W} -C -f $$m -K uname,gname | sed s#^\.#.$$d# | \
361246127Sbrooks		    ${METALOG.add} ; \
362245825Sbrooks	done; true
363245825Sbrooks.endif
364247162Sache	${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
36577993Sache	cd ${DESTDIR}/usr/share/man; \
366245571Sbrooks	for mandir in man*; do \
367245752Sbrooks		${INSTALL_SYMLINK} ../$$mandir \
368245752Sbrooks		    ${DESTDIR}/usr/share/man/en.ISO8859-1/; \
369245752Sbrooks		${INSTALL_SYMLINK} ../$$mandir \
370245752Sbrooks		    ${DESTDIR}/usr/share/man/en.UTF-8/; \
37177993Sache	done
372110663Sache	cd ${DESTDIR}/usr/share/openssl/man; \
373245571Sbrooks	for mandir in man*; do \
374245752Sbrooks		${INSTALL_SYMLINK} ../$$mandir \
375245571Sbrooks		    ${DESTDIR}/usr/share/openssl/man/en.ISO8859-1/; \
376245571Sbrooks	done
377110663Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
378245571Sbrooks	while [ $$# -gt 0 ] ; do \
379245752Sbrooks		${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/man/$$1"; \
380245752Sbrooks		${INSTALL_SYMLINK} "$$2" \
381245752Sbrooks		    "${DESTDIR}/usr/share/openssl/man/$$1"; \
382110663Sache		shift; shift; \
383110663Sache	done
38477999Sache	set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
385245571Sbrooks	while [ $$# -gt 0 ] ; do \
386245752Sbrooks		${INSTALL_SYMLINK} "$$2" "${DESTDIR}/usr/share/nls/$$1"; \
38711635Sache		shift; shift; \
38877999Sache	done
389147Srgrimes
39048185Ssheldonhetc-examples:
391100872Sru	cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
39299451Sru	    ${BIN1} ${BIN2} nsmb.conf opieaccess \
39399451Sru	    ${DESTDIR}/usr/share/examples/etc
394173135Syar	${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
395119385Smtm	    DESTDIR=${DESTDIR}/usr/share/examples
39648185Ssheldonh
39737Srgrimes.include <bsd.prog.mk>
398