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