]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/Makefile
MFV r337197: 9456 ztest failure in zil_commit_waiter_timeout
[FreeBSD/FreeBSD.git] / etc / Makefile
1 #       from: @(#)Makefile      5.11 (Berkeley) 5/21/91
2 # $FreeBSD$
3
4 .include <src.opts.mk>
5
6 FILESGROUPS=    FILES
7
8 # No need as it is empty and just causes rebuilds since this file does so much.
9 UPDATE_DEPENDFILE=      no
10
11 .if ${MK_SENDMAIL} != "no"
12 SUBDIR+=sendmail
13 .endif
14
15 BIN1=   crontab \
16         devd.conf \
17         devfs.conf \
18         ddb.conf \
19         dhclient.conf \
20         disktab \
21         fbtab \
22         gettytab \
23         group \
24         hosts \
25         hosts.allow \
26         hosts.equiv \
27         libalias.conf \
28         libmap.conf \
29         login.access \
30         login.conf \
31         mac.conf \
32         motd \
33         netconfig \
34         networks \
35         newsyslog.conf \
36         nsswitch.conf \
37         phones \
38         profile \
39         protocols \
40         rc.bsdextended \
41         rc.firewall \
42         remote \
43         rpc \
44         services \
45         sysctl.conf \
46         syslog.conf \
47         termcap.small
48
49 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
50 BIN1+=  etc.${MACHINE}/ttys
51 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
52 BIN1+=  etc.${MACHINE_ARCH}/ttys
53 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
54 BIN1+=  etc.${MACHINE_CPUARCH}/ttys
55 .else
56 .error etc.MACHINE/ttys missing
57 .endif
58
59 OPENBSMDIR=                     ${SRCTOP}/contrib/openbsm
60 BSM_ETC_OPEN_FILES=             ${OPENBSMDIR}/etc/audit_class \
61                                 ${OPENBSMDIR}/etc/audit_event
62 BSM_ETC_RESTRICTED_FILES=       ${OPENBSMDIR}/etc/audit_control \
63                                 ${OPENBSMDIR}/etc/audit_user
64 BSM_ETC_EXEC_FILES=             ${OPENBSMDIR}/etc/audit_warn
65 BSM_ETC_DIR=                    ${DESTDIR}/etc/security
66
67 # NB: keep these sorted by MK_* knobs
68
69 .if ${MK_AMD} != "no"
70 BIN1+= amd.map
71 .endif
72
73 .if ${MK_AUTOFS} != "no"
74 BIN1+=  auto_master
75 .endif
76
77 .if ${MK_FREEBSD_UPDATE} != "no"
78 BIN1+= freebsd-update.conf
79 .endif
80
81 .if ${MK_FTP} != "no"
82 BIN1+= ftpusers
83 .endif
84
85 .if ${MK_INETD} != "no"
86 BIN1+= inetd.conf
87 .endif
88
89 .if ${MK_LOCATE} != "no"
90 BIN1+=  ${SRCTOP}/usr.bin/locate/locate/locate.rc
91 .endif
92
93 .if ${MK_LPR} != "no"
94 BIN1+=  hosts.lpd printcap
95 .endif
96
97 .if ${MK_MAIL} != "no"
98 BIN1+=  ${SRCTOP}/usr.bin/mail/misc/mail.rc
99 .endif
100
101 .if ${MK_NTP} != "no"
102 BIN1+=  ntp.conf
103 .endif
104
105 .if ${MK_OPENSSH} != "no"
106 SSH=    ${SRCTOP}/crypto/openssh/ssh_config \
107         ${SRCTOP}/crypto/openssh/sshd_config \
108         ${SRCTOP}/crypto/openssh/moduli
109 .endif
110 .if ${MK_OPENSSL} != "no"
111 SSL=    ${SRCTOP}/crypto/openssl/apps/openssl.cnf
112 .endif
113
114 .if ${MK_PORTSNAP} != "no"
115 BIN1+= portsnap.conf
116 .endif
117
118 .if ${MK_PF} != "no"
119 BIN1+= pf.os
120 .endif
121
122 .if ${MK_SENDMAIL} != "no"
123 BIN1+=  rc.sendmail
124 .endif
125
126 .if ${MK_TCSH} != "no"
127 BIN1+= csh.cshrc csh.login csh.logout
128 .endif
129
130 .if ${MK_WIRELESS} != "no"
131 BIN1+= regdomain.xml
132 .endif
133
134 .if ${MK_SENDMAIL} == "no"
135 ETCMAIL=mailer.conf aliases
136 .else
137 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
138         mailertable.sample aliases
139 .endif
140
141 # Special top level files for FreeBSD
142 FREEBSD=COPYRIGHT
143
144 # Sanitize DESTDIR
145 DESTDIR:=       ${DESTDIR:C://*:/:g}
146
147 afterinstall:
148 .if ${MK_MAN} != "no"
149         ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
150 .endif
151
152 distribute:
153         # Avoid installing tests here; "make distribution" will do this and
154         # correctly place them in the right location.
155         ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
156             DESTDIR=${DISTDIR}/${DISTRIBUTION}
157         ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
158
159 .include <bsd.endian.mk>
160
161 .if defined(NO_ROOT)
162 METALOG.add?=   cat -l >> ${METALOG}
163 .endif
164
165 distribution:
166 .if !defined(DESTDIR)
167         @echo "set DESTDIR before running \"make ${.TARGET}\""
168         @false
169 .endif
170         cd ${.CURDIR}; \
171             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
172                 ${BIN1} ${DESTDIR}/etc; \
173             cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
174             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
175                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
176
177 .if ${MK_SERVICESDB} != "no"
178         cd ${.CURDIR}; \
179             services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
180                 ${DESTDIR}/etc/services;
181 .endif
182
183 .if ${MK_BSNMP} != "no"
184         cd ${.CURDIR}; \
185             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
186                 snmpd.config ${DESTDIR}/etc;
187 .endif
188 .if ${MK_TCSH} == "no"
189         sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
190 .endif
191         pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
192 .if defined(NO_ROOT)
193         ( \
194                 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
195                 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
196                 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
197                 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
198                 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
199         ) | ${METALOG.add}
200 .endif
201 .if ${MK_AUTOFS} != "no"
202         ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
203 .endif
204 .if ${MK_BLUETOOTH} != "no"
205         ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
206 .endif
207         ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
208         ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
209         ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
210         ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
211         ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
212         ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
213 .if ${MK_NTP} != "no"
214         ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
215 .endif
216         ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
217         ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
218         ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
219         ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
220         ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
221         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
222             ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
223         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
224             ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
225         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
226             ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
227 .if ${MK_UNBOUND} != "no"
228         if [ ! -e ${DESTDIR}/etc/unbound ]; then \
229                 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
230         fi
231 .endif
232 .if ${MK_SENDMAIL} != "no"
233         ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
234 .endif
235 .if ${MK_OPENSSH} != "no"
236         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
237             ${SSH} ${DESTDIR}/etc/ssh
238 .endif
239 .if ${MK_OPENSSL} != "no"
240         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
241             ${SSL} ${DESTDIR}/etc/ssl
242 .endif
243 .if ${MK_KERBEROS} != "no"
244         cd ${.CURDIR}/root; \
245             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
246                 dot.k5login ${DESTDIR}/root/.k5login;
247 .endif
248         cd ${.CURDIR}/root; \
249             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
250                 dot.profile ${DESTDIR}/root/.profile; \
251             rm -f ${DESTDIR}/.profile; \
252             ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
253 .if ${MK_TCSH} != "no"
254         cd ${.CURDIR}/root; \
255             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
256                 dot.cshrc ${DESTDIR}/root/.cshrc; \
257             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
258                 dot.login ${DESTDIR}/root/.login; \
259             rm -f ${DESTDIR}/.cshrc; \
260             ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
261 .endif
262 .if ${MK_MAIL} != "no"
263         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
264             ${ETCMAIL} ${DESTDIR}/etc/mail
265         if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
266               ! -f ${DESTDIR}/etc/aliases ]; then \
267                 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
268         fi
269 .endif
270 .if ${MK_LOCATE} != "no"
271         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
272             ${DESTDIR}/var/db/locate.database
273 .endif
274         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
275             ${DESTDIR}/var/crash
276         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
277                 ${FREEBSD} ${DESTDIR}/
278 .if ${MK_BOOT} != "no"
279 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
280         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
281             ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
282             ${DESTDIR}/boot/device.hints
283 .endif
284 .endif
285 .if ${MK_NIS} == "no"
286         sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
287                 ${DESTDIR}/etc/nsswitch.conf
288 .endif
289
290 MTREE_CMD?=     mtree
291
292 MTREES=         mtree/BSD.root.dist             /               \
293                 mtree/BSD.var.dist              /var            \
294                 mtree/BSD.usr.dist              /usr            \
295                 mtree/BSD.include.dist          /usr/include    \
296                 mtree/BSD.debug.dist            /usr/lib
297 .if ${MK_LIB32} != "no"
298 MTREES+=        mtree/BSD.lib32.dist            /usr
299 MTREES+=        mtree/BSD.lib32.dist            /usr/lib/debug/usr
300 .endif
301 .if ${MK_LIBSOFT} != "no"
302 MTREES+=        mtree/BSD.libsoft.dist          /usr
303 MTREES+=        mtree/BSD.libsoft.dist          /usr/lib/debug/usr
304 .endif
305 .if ${MK_TESTS} != "no"
306 MTREES+=        mtree/BSD.tests.dist            ${TESTSBASE}
307 MTREES+=        mtree/BSD.tests.dist            /usr/lib/debug/${TESTSBASE}
308 .endif
309 .if ${MK_SENDMAIL} != "no"
310 MTREES+=        mtree/BSD.sendmail.dist         /
311 .endif
312 .for mtree in ${LOCAL_MTREE}
313 MTREES+=        ../${mtree}                     /
314 .endfor
315
316 # Clean up some directories that where mistakenly created as files that
317 # should not have been as part of the nvi update in r281994.
318 # This should be removed after 11.0-RELEASE.
319 DISTRIB_CLEANUP_SHARE_FILES=    ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
320 DISTRIB_CLEANUP_SHARE_FILES+=   ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
321 distrib-cleanup: .PHONY
322         for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
323                 if [ -f ${DESTDIR}/$${file} ]; then \
324                         rm -f ${DESTDIR}/$${file}; \
325                 fi; \
326         done
327
328 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
329         @set ${MTREES}; \
330         while test $$# -ge 2; do \
331                 m=${.CURDIR}/$$1; \
332                 shift; \
333                 d=${DESTDIR}$$1; \
334                 shift; \
335                 test -d $$d || mkdir -p $$d; \
336                 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
337                     ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
338                 ${MTREE_FILTER} $$m | \
339                 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
340                     -p $$d; \
341         done; true
342 .if defined(NO_ROOT)
343         @set ${MTREES}; \
344         while test $$# -ge 2; do \
345                 m=${.CURDIR}/$$1; \
346                 shift; \
347                 d=$$1; \
348                 test "$$d" == "/" && d=""; \
349                 d=${DISTBASE}$$d; \
350                 shift; \
351                 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
352                 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
353                     "sed s#^\.#.$$d# | ${METALOG.add}" ; \
354                 ${MTREE_FILTER} $$m | \
355                 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
356                     ${METALOG.add} ; \
357         done; true
358 .endif
359 .if ${MK_NLS} != "no"
360         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
361         while [ $$# -gt 0 ] ; do \
362                 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
363                 shift; shift; \
364         done
365 .endif
366
367 etc-examples-install: ${META_DEPS}
368         cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
369             ${BIN1} ${BIN2} nsmb.conf opieaccess \
370             ${DESTDIR}${SHAREDIR}/examples/etc
371
372 etc-examples: etc-examples-install
373         ${_+_}cd ${.CURDIR}/defaults; \
374             ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
375             DESTDIR=${DESTDIR}${SHAREDIR}/examples
376
377 .include <bsd.prog.mk>
378
379 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
380 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
381         -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
382         -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
383         -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
384         -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
385 .else
386 MTREE_FILTER= cat
387 .if !defined(NO_FSCHG)
388 MTREE_FSCHG=    -i
389 .endif
390 .endif