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