1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
8 # No need as it is empty and just causes rebuilds since this file does so much.
11 .if ${MK_SENDMAIL} != "no"
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
56 .error etc.MACHINE/ttys missing
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
67 # NB: keep these sorted by MK_* knobs
73 .if ${MK_AUTOFS} != "no"
81 .if ${MK_INETD} != "no"
85 .if ${MK_LOCATE} != "no"
86 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
90 BIN1+= hosts.lpd printcap
93 .if ${MK_MAIL} != "no"
94 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
101 .if ${MK_OPENSSH} != "no"
102 SSH= ${SRCTOP}/crypto/openssh/ssh_config \
103 ${SRCTOP}/crypto/openssh/sshd_config \
104 ${SRCTOP}/crypto/openssh/moduli
106 .if ${MK_OPENSSL} != "no"
107 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
114 .if ${MK_SENDMAIL} != "no"
118 .if ${MK_TCSH} != "no"
119 BIN1+= csh.cshrc csh.login csh.logout
122 .if ${MK_WIRELESS} != "no"
126 .if ${MK_SENDMAIL} == "no"
127 ETCMAIL=mailer.conf aliases
129 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
130 mailertable.sample aliases
133 # Special top level files for FreeBSD
137 DESTDIR:= ${DESTDIR:C://*:/:g}
140 .if ${MK_MAN} != "no"
141 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
145 # Avoid installing tests here; "make distribution" will do this and
146 # correctly place them in the right location.
147 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
148 DESTDIR=${DISTDIR}/${DISTRIBUTION}
149 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
151 .include <bsd.endian.mk>
154 METALOG.add?= cat -l >> ${METALOG}
158 .if !defined(DESTDIR)
159 @echo "set DESTDIR before running \"make ${.TARGET}\""
163 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
164 ${BIN1} ${DESTDIR}/etc; \
165 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
166 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
167 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
169 .if ${MK_SERVICESDB} != "no"
171 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
172 ${DESTDIR}/etc/services;
175 .if ${MK_BSNMP} != "no"
177 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
178 snmpd.config ${DESTDIR}/etc;
180 .if ${MK_TCSH} == "no"
181 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
183 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
186 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
187 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
188 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
189 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
190 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
193 .if ${MK_BLUETOOTH} != "no"
194 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
196 ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
197 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
198 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
199 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
200 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
201 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
202 .if ${MK_NTP} != "no"
203 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
205 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
206 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
207 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
208 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
209 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
210 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
211 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
212 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
213 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
214 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
215 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
216 .if ${MK_UNBOUND} != "no"
217 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
218 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
221 .if ${MK_SENDMAIL} != "no"
222 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
224 .if ${MK_OPENSSH} != "no"
225 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
226 ${SSH} ${DESTDIR}/etc/ssh
228 .if ${MK_OPENSSL} != "no"
229 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
230 ${SSL} ${DESTDIR}/etc/ssl
232 .if ${MK_KERBEROS} != "no"
233 cd ${.CURDIR}/root; \
234 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
235 dot.k5login ${DESTDIR}/root/.k5login;
237 cd ${.CURDIR}/root; \
238 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
239 dot.profile ${DESTDIR}/root/.profile; \
240 rm -f ${DESTDIR}/.profile; \
241 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
242 .if ${MK_TCSH} != "no"
243 cd ${.CURDIR}/root; \
244 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
245 dot.cshrc ${DESTDIR}/root/.cshrc; \
246 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
247 dot.login ${DESTDIR}/root/.login; \
248 rm -f ${DESTDIR}/.cshrc; \
249 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
251 .if ${MK_MAIL} != "no"
252 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
253 ${ETCMAIL} ${DESTDIR}/etc/mail
254 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
255 ! -f ${DESTDIR}/etc/aliases ]; then \
256 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
259 .if ${MK_LOCATE} != "no"
260 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
261 ${DESTDIR}/var/db/locate.database
263 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
264 ${FREEBSD} ${DESTDIR}/
265 .if ${MK_BOOT} != "no"
266 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
267 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
268 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
269 ${DESTDIR}/boot/device.hints
272 .if ${MK_NIS} == "no"
273 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
274 ${DESTDIR}/etc/nsswitch.conf
279 MTREES= mtree/BSD.root.dist / \
280 mtree/BSD.var.dist /var \
281 mtree/BSD.usr.dist /usr \
282 mtree/BSD.include.dist /usr/include \
283 mtree/BSD.debug.dist /usr/lib
284 .if ${MK_LIB32} != "no"
285 MTREES+= mtree/BSD.lib32.dist /usr
286 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
288 .if ${MK_LIBSOFT} != "no"
289 MTREES+= mtree/BSD.libsoft.dist /usr
290 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
292 .if ${MK_TESTS} != "no"
293 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
294 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
296 .if ${MK_SENDMAIL} != "no"
297 MTREES+= mtree/BSD.sendmail.dist /
299 .for mtree in ${LOCAL_MTREE}
300 MTREES+= ../${mtree} /
303 # Clean up some directories that where mistakenly created as files that
304 # should not have been as part of the nvi update in r281994.
305 # This should be removed after 11.0-RELEASE.
306 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
307 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
308 distrib-cleanup: .PHONY
309 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
310 if [ -f ${DESTDIR}/$${file} ]; then \
311 rm -f ${DESTDIR}/$${file}; \
315 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
317 while test $$# -ge 2; do \
322 test -d $$d || mkdir -p $$d; \
323 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
324 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
325 ${MTREE_FILTER} $$m | \
326 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
331 while test $$# -ge 2; do \
335 test "$$d" == "/" && d=""; \
338 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
339 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
340 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
341 ${MTREE_FILTER} $$m | \
342 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
346 .if ${MK_NLS} != "no"
347 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
348 while [ $$# -gt 0 ] ; do \
349 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
354 etc-examples-install: ${META_DEPS}
355 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
356 ${BIN1} ${BIN2} nsmb.conf opieaccess \
357 ${DESTDIR}${SHAREDIR}/examples/etc
359 etc-examples: etc-examples-install
360 ${_+_}cd ${.CURDIR}/defaults; \
361 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
362 DESTDIR=${DESTDIR}${SHAREDIR}/examples
364 .include <bsd.prog.mk>
366 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
367 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
368 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
369 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
370 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
371 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
374 .if !defined(NO_FSCHG)