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