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
77 .if ${MK_INETD} != "no"
81 .if ${MK_LOCATE} != "no"
82 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
86 BIN1+= hosts.lpd printcap
89 .if ${MK_MAIL} != "no"
90 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
97 .if ${MK_OPENSSH} != "no"
98 SSH= ${SRCTOP}/crypto/openssh/ssh_config \
99 ${SRCTOP}/crypto/openssh/sshd_config \
100 ${SRCTOP}/crypto/openssh/moduli
102 .if ${MK_OPENSSL} != "no"
103 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
110 .if ${MK_SENDMAIL} != "no"
114 .if ${MK_TCSH} != "no"
115 BIN1+= csh.cshrc csh.login csh.logout
118 .if ${MK_WIRELESS} != "no"
122 .if ${MK_SENDMAIL} == "no"
123 ETCMAIL=mailer.conf aliases
125 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
126 mailertable.sample aliases
129 # Special top level files for FreeBSD
133 DESTDIR:= ${DESTDIR:C://*:/:g}
136 .if ${MK_MAN} != "no"
137 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
141 # Avoid installing tests here; "make distribution" will do this and
142 # correctly place them in the right location.
143 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
144 DESTDIR=${DISTDIR}/${DISTRIBUTION}
145 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
147 .include <bsd.endian.mk>
150 METALOG.add?= cat -l >> ${METALOG}
154 .if !defined(DESTDIR)
155 @echo "set DESTDIR before running \"make ${.TARGET}\""
159 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
160 ${BIN1} ${DESTDIR}/etc; \
161 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
162 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
163 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
165 .if ${MK_SERVICESDB} != "no"
167 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
168 ${DESTDIR}/etc/services;
171 .if ${MK_BSNMP} != "no"
173 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
174 snmpd.config ${DESTDIR}/etc;
176 .if ${MK_TCSH} == "no"
177 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
179 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
182 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
183 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
184 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
185 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
186 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
189 .if ${MK_BLUETOOTH} != "no"
190 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
192 ${_+_}cd ${.CURDIR}/cron.d; ${MAKE} install
193 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
194 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
195 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
196 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
197 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
198 .if ${MK_NTP} != "no"
199 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
201 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
202 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
203 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
204 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
205 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
206 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
207 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
208 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
209 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
210 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
211 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
212 .if ${MK_UNBOUND} != "no"
213 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
214 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
217 .if ${MK_SENDMAIL} != "no"
218 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
220 .if ${MK_OPENSSH} != "no"
221 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
222 ${SSH} ${DESTDIR}/etc/ssh
224 .if ${MK_OPENSSL} != "no"
225 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
226 ${SSL} ${DESTDIR}/etc/ssl
228 .if ${MK_KERBEROS} != "no"
229 cd ${.CURDIR}/root; \
230 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
231 dot.k5login ${DESTDIR}/root/.k5login;
233 cd ${.CURDIR}/root; \
234 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
235 dot.profile ${DESTDIR}/root/.profile; \
236 rm -f ${DESTDIR}/.profile; \
237 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
238 .if ${MK_TCSH} != "no"
239 cd ${.CURDIR}/root; \
240 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
241 dot.cshrc ${DESTDIR}/root/.cshrc; \
242 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
243 dot.login ${DESTDIR}/root/.login; \
244 rm -f ${DESTDIR}/.cshrc; \
245 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
247 .if ${MK_MAIL} != "no"
248 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
249 ${ETCMAIL} ${DESTDIR}/etc/mail
250 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
251 ! -f ${DESTDIR}/etc/aliases ]; then \
252 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
255 .if ${MK_LOCATE} != "no"
256 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
257 ${DESTDIR}/var/db/locate.database
259 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
260 ${FREEBSD} ${DESTDIR}/
261 .if ${MK_BOOT} != "no"
262 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
263 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
264 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
265 ${DESTDIR}/boot/device.hints
268 .if ${MK_NIS} == "no"
269 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
270 ${DESTDIR}/etc/nsswitch.conf
275 MTREES= mtree/BSD.root.dist / \
276 mtree/BSD.var.dist /var \
277 mtree/BSD.usr.dist /usr \
278 mtree/BSD.include.dist /usr/include \
279 mtree/BSD.debug.dist /usr/lib
280 .if ${MK_LIB32} != "no"
281 MTREES+= mtree/BSD.lib32.dist /usr
282 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
284 .if ${MK_LIBSOFT} != "no"
285 MTREES+= mtree/BSD.libsoft.dist /usr
286 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
288 .if ${MK_TESTS} != "no"
289 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
290 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
292 .if ${MK_SENDMAIL} != "no"
293 MTREES+= mtree/BSD.sendmail.dist /
295 .for mtree in ${LOCAL_MTREE}
296 MTREES+= ../${mtree} /
299 # Clean up some directories that where mistakenly created as files that
300 # should not have been as part of the nvi update in r281994.
301 # This should be removed after 11.0-RELEASE.
302 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
303 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
304 distrib-cleanup: .PHONY
305 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
306 if [ -f ${DESTDIR}/$${file} ]; then \
307 rm -f ${DESTDIR}/$${file}; \
311 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
313 while test $$# -ge 2; do \
318 test -d $$d || mkdir -p $$d; \
319 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
320 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
321 ${MTREE_FILTER} $$m | \
322 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
327 while test $$# -ge 2; do \
331 test "$$d" == "/" && d=""; \
334 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
335 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
336 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
337 ${MTREE_FILTER} $$m | \
338 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
342 .if ${MK_NLS} != "no"
343 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
344 while [ $$# -gt 0 ] ; do \
345 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
350 etc-examples-install: ${META_DEPS}
351 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
352 ${BIN1} ${BIN2} nsmb.conf opieaccess \
353 ${DESTDIR}${SHAREDIR}/examples/etc
355 etc-examples: etc-examples-install
356 ${_+_}cd ${.CURDIR}/defaults; \
357 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
358 DESTDIR=${DESTDIR}${SHAREDIR}/examples
360 .include <bsd.prog.mk>
362 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
363 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
364 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
365 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
366 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
367 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
370 .if !defined(NO_FSCHG)