]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - etc/Makefile
Move all bluetooth related config files out of etc
[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         devfs.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         networks \
33         nsswitch.conf \
34         phones \
35         protocols \
36         rc.bsdextended \
37         rc.firewall \
38         remote \
39         rpc \
40         services \
41         termcap.small
42
43 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
44 BIN1+=  etc.${MACHINE}/ttys
45 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
46 BIN1+=  etc.${MACHINE_ARCH}/ttys
47 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
48 BIN1+=  etc.${MACHINE_CPUARCH}/ttys
49 .else
50 .error etc.MACHINE/ttys missing
51 .endif
52
53 # NB: keep these sorted by MK_* knobs
54
55 .if ${MK_AMD} != "no"
56 BIN1+= amd.map
57 .endif
58
59 .if ${MK_LOCATE} != "no"
60 BIN1+=  ${SRCTOP}/usr.bin/locate/locate/locate.rc
61 .endif
62
63 .if ${MK_LPR} != "no"
64 BIN1+=  hosts.lpd printcap
65 .endif
66
67 .if ${MK_MAIL} != "no"
68 BIN1+=  ${SRCTOP}/usr.bin/mail/misc/mail.rc
69 .endif
70
71 .if ${MK_OPENSSL} != "no"
72 SSL=    ${SRCTOP}/crypto/openssl/apps/openssl.cnf
73 .endif
74
75 .if ${MK_SENDMAIL} != "no"
76 BIN1+=  rc.sendmail
77 .endif
78
79 .if ${MK_WIRELESS} != "no"
80 BIN1+= regdomain.xml
81 .endif
82
83 .if ${MK_SENDMAIL} == "no"
84 ETCMAIL=mailer.conf aliases
85 .else
86 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
87         mailertable.sample aliases
88 .endif
89
90 # Special top level files for FreeBSD
91 FREEBSD=COPYRIGHT
92
93 # Sanitize DESTDIR
94 DESTDIR:=       ${DESTDIR:C://*:/:g}
95
96 afterinstall:
97 .if ${MK_MAN} != "no"
98         ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
99 .endif
100
101 distribute:
102         # Avoid installing tests here; "make distribution" will do this and
103         # correctly place them in the right location.
104         ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
105             DESTDIR=${DISTDIR}/${DISTRIBUTION}
106         ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
107
108 .include <bsd.endian.mk>
109
110 .if defined(NO_ROOT)
111 METALOG.add?=   cat -l >> ${METALOG}
112 .endif
113
114 distribution:
115 .if !defined(DESTDIR)
116         @echo "set DESTDIR before running \"make ${.TARGET}\""
117         @false
118 .endif
119         cd ${.CURDIR}; \
120             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
121                 ${BIN1} ${DESTDIR}/etc; \
122             cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
123             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
124                 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
125
126 .if ${MK_SERVICESDB} != "no"
127         cd ${.CURDIR}; \
128             services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
129                 ${DESTDIR}/etc/services;
130 .endif
131
132 .if ${MK_TCSH} == "no"
133         sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
134 .endif
135         pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
136 .if defined(NO_ROOT)
137         ( \
138                 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
139                 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
140                 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
141                 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
142                 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
143         ) | ${METALOG.add}
144 .endif
145         ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
146         ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
147         ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
148         ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
149         ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
150         ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
151 .if ${MK_UNBOUND} != "no"
152         if [ ! -e ${DESTDIR}/etc/unbound ]; then \
153                 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
154         fi
155 .endif
156 .if ${MK_SENDMAIL} != "no"
157         ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
158 .endif
159 .if ${MK_OPENSSL} != "no"
160         cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
161             ${SSL} ${DESTDIR}/etc/ssl
162 .endif
163 .if ${MK_KERBEROS} != "no"
164         cd ${.CURDIR}/root; \
165             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
166                 dot.k5login ${DESTDIR}/root/.k5login;
167 .endif
168         cd ${.CURDIR}/root; \
169             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
170                 dot.profile ${DESTDIR}/root/.profile; \
171             rm -f ${DESTDIR}/.profile; \
172             ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
173 .if ${MK_TCSH} != "no"
174         cd ${.CURDIR}/root; \
175             ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
176                 dot.cshrc ${DESTDIR}/root/.cshrc; \
177             rm -f ${DESTDIR}/.cshrc; \
178             ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
179 .endif
180
181 .if ${MK_MAIL} != "no"
182         cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
183             ${ETCMAIL} ${DESTDIR}/etc/mail
184         if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
185               ! -f ${DESTDIR}/etc/aliases ]; then \
186                 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
187         fi
188 .endif
189 .if ${MK_LOCATE} != "no"
190         ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
191             ${DESTDIR}/var/db/locate.database
192 .endif
193         cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
194                 ${FREEBSD} ${DESTDIR}/
195 .if ${MK_BOOT} != "no"
196 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
197         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
198             ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
199             ${DESTDIR}/boot/device.hints
200 .endif
201 .endif
202 .if ${MK_NIS} == "no"
203         sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
204                 ${DESTDIR}/etc/nsswitch.conf
205 .endif
206
207 MTREE_CMD?=     mtree
208
209 MTREES=         mtree/BSD.root.dist             /               \
210                 mtree/BSD.var.dist              /var            \
211                 mtree/BSD.usr.dist              /usr            \
212                 mtree/BSD.include.dist          /usr/include    \
213                 mtree/BSD.debug.dist            /usr/lib
214 .if ${MK_LIB32} != "no"
215 MTREES+=        mtree/BSD.lib32.dist            /usr
216 MTREES+=        mtree/BSD.lib32.dist            /usr/lib/debug/usr
217 .endif
218 .if ${MK_LIBSOFT} != "no"
219 MTREES+=        mtree/BSD.libsoft.dist          /usr
220 MTREES+=        mtree/BSD.libsoft.dist          /usr/lib/debug/usr
221 .endif
222 .if ${MK_TESTS} != "no"
223 MTREES+=        mtree/BSD.tests.dist            ${TESTSBASE}
224 MTREES+=        mtree/BSD.tests.dist            /usr/lib/debug/${TESTSBASE}
225 .endif
226 .if ${MK_SENDMAIL} != "no"
227 MTREES+=        mtree/BSD.sendmail.dist         /
228 .endif
229 .for mtree in ${LOCAL_MTREE}
230 MTREES+=        ../${mtree}                     /
231 .endfor
232
233 # Clean up some directories that where mistakenly created as files that
234 # should not have been as part of the nvi update in r281994.
235 # This should be removed after 11.0-RELEASE.
236 DISTRIB_CLEANUP_SHARE_FILES=    ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
237 DISTRIB_CLEANUP_SHARE_FILES+=   ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
238 distrib-cleanup: .PHONY
239         for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
240                 if [ -f ${DESTDIR}/$${file} ]; then \
241                         rm -f ${DESTDIR}/$${file}; \
242                 fi; \
243         done
244
245 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
246         @set ${MTREES}; \
247         while test $$# -ge 2; do \
248                 m=${.CURDIR}/$$1; \
249                 shift; \
250                 d=${DESTDIR}$$1; \
251                 shift; \
252                 test -d $$d || mkdir -p $$d; \
253                 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
254                     ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
255                 ${MTREE_FILTER} $$m | \
256                 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
257                     -p $$d; \
258         done; true
259 .if defined(NO_ROOT)
260         @set ${MTREES}; \
261         while test $$# -ge 2; do \
262                 m=${.CURDIR}/$$1; \
263                 shift; \
264                 d=$$1; \
265                 test "$$d" == "/" && d=""; \
266                 d=${DISTBASE}$$d; \
267                 shift; \
268                 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
269                 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
270                     "sed s#^\.#.$$d# | ${METALOG.add}" ; \
271                 ${MTREE_FILTER} $$m | \
272                 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
273                     ${METALOG.add} ; \
274         done; true
275 .endif
276 .if ${MK_NLS} != "no"
277         set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
278         while [ $$# -gt 0 ] ; do \
279                 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
280                 shift; shift; \
281         done
282 .endif
283
284 etc-examples-install: ${META_DEPS}
285         cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
286             ${BIN1} ${BIN2} nsmb.conf opieaccess \
287             ${DESTDIR}${SHAREDIR}/examples/etc
288
289 etc-examples: etc-examples-install
290         ${_+_}cd ${.CURDIR}/defaults; \
291             ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
292             DESTDIR=${DESTDIR}${SHAREDIR}/examples
293
294 .include <bsd.prog.mk>
295
296 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
297 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
298         -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
299         -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
300         -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
301         -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
302 .else
303 MTREE_FILTER= cat
304 .if !defined(NO_FSCHG)
305 MTREE_FSCHG=    -i
306 .endif
307 .endif