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"
55 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
56 BIN1+= etc.${MACHINE}/ttys
57 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
58 BIN1+= etc.${MACHINE_ARCH}/ttys
59 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
60 BIN1+= etc.${MACHINE_CPUARCH}/ttys
62 .error etc.MACHINE/ttys missing
65 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
66 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
67 ${OPENBSMDIR}/etc/audit_event
68 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
69 ${OPENBSMDIR}/etc/audit_user
70 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
71 BSM_ETC_DIR= ${DESTDIR}/etc/security
73 # NB: keep these sorted by MK_* knobs
83 .if ${MK_AUTOFS} != "no"
87 .if ${MK_BLACKLIST} != "no"
88 BIN1+= blacklistd.conf
91 .if ${MK_FREEBSD_UPDATE} != "no"
92 BIN1+= freebsd-update.conf
99 .if ${MK_INETD} != "no"
103 .if ${MK_LOCATE} != "no"
104 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
107 .if ${MK_LPR} != "no"
108 BIN1+= hosts.lpd printcap
111 .if ${MK_MAIL} != "no"
112 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
115 .if ${MK_NTP} != "no"
119 .if ${MK_OPENSSH} != "no"
120 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
121 ${.CURDIR}/../crypto/openssh/sshd_config \
122 ${.CURDIR}/../crypto/openssh/moduli
124 .if ${MK_OPENSSL} != "no"
125 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
128 .if ${MK_NS_CACHING} != "no"
132 .if ${MK_PORTSNAP} != "no"
140 .if ${MK_SENDMAIL} != "no"
144 .if ${MK_TCSH} != "no"
145 BIN1+= csh.cshrc csh.login csh.logout
148 .if ${MK_WIRELESS} != "no"
152 # -rwxr-xr-x root:wheel, for the new cron root:wheel
153 BIN2= netstart pccard_ether rc.suspend rc.resume
157 .if ${MK_SENDMAIL} == "no"
158 ETCMAIL=mailer.conf aliases
160 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
161 mailertable.sample aliases
164 # Special top level files for FreeBSD
168 DESTDIR:= ${DESTDIR:C://*:/:g}
171 .if ${MK_MAN} != "no"
172 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
176 # Avoid installing tests here; "make distribution" will do this and
177 # correctly place them in the right location.
178 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
179 DESTDIR=${DISTDIR}/${DISTRIBUTION}
180 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
182 .include <bsd.endian.mk>
183 .if ${TARGET_ENDIANNESS} == "1234"
185 .elif ${TARGET_ENDIANNESS} == "4321"
192 METALOG.add?= cat -l >> ${METALOG}
196 .if !defined(DESTDIR)
197 @echo "set DESTDIR before running \"make ${.TARGET}\""
201 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
202 ${BIN1} ${DESTDIR}/etc; \
203 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
204 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
205 ${DESTDIR}/etc/services; \
206 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
207 ${BIN2} ${DESTDIR}/etc; \
208 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
209 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
210 .if ${MK_BSNMP} != "no"
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
213 snmpd.config ${DESTDIR}/etc;
216 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
218 .if ${MK_TCSH} == "no"
219 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
221 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
224 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
225 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
226 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
227 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
230 .if ${MK_AUTOFS} != "no"
231 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
233 .if ${MK_BLUETOOTH} != "no"
234 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
236 .if ${MK_CASPER} != "no"
237 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
239 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
240 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
241 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
242 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
243 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
244 .if ${MK_NTP} != "no"
245 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
247 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
248 .if ${MK_PKGBOOTSTRAP} != "no"
249 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
252 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
253 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
254 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
255 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
256 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
257 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
258 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
259 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
260 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
261 .if ${MK_UNBOUND} != "no"
262 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
263 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
266 .if ${MK_SENDMAIL} != "no"
267 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
269 .if ${MK_OPENSSH} != "no"
270 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
271 ${SSH} ${DESTDIR}/etc/ssh
273 .if ${MK_OPENSSL} != "no"
274 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
275 ${SSL} ${DESTDIR}/etc/ssl
277 .if ${MK_KERBEROS} != "no"
278 cd ${.CURDIR}/root; \
279 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 dot.k5login ${DESTDIR}/root/.k5login;
282 cd ${.CURDIR}/root; \
283 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
284 dot.profile ${DESTDIR}/root/.profile; \
285 rm -f ${DESTDIR}/.profile; \
286 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
287 .if ${MK_TCSH} != "no"
288 cd ${.CURDIR}/root; \
289 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
290 dot.cshrc ${DESTDIR}/root/.cshrc; \
291 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 dot.login ${DESTDIR}/root/.login; \
293 rm -f ${DESTDIR}/.cshrc; \
294 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
296 .if ${MK_MAIL} != "no"
297 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
298 ${ETCMAIL} ${DESTDIR}/etc/mail
299 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
300 ! -f ${DESTDIR}/etc/aliases ]; then \
301 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
304 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
305 ${DESTDIR}/etc/dumpdates
306 .if ${MK_LOCATE} != "no"
307 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
308 ${DESTDIR}/var/db/locate.database
310 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
312 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
313 ${FREEBSD} ${DESTDIR}/
314 .if ${MK_BOOT} != "no"
315 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
316 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
317 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
318 ${DESTDIR}/boot/device.hints
321 .if ${MK_NIS} == "no"
322 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
323 ${DESTDIR}/etc/nsswitch.conf
328 MTREES= mtree/BSD.root.dist / \
329 mtree/BSD.var.dist /var \
330 mtree/BSD.usr.dist /usr \
331 mtree/BSD.include.dist /usr/include \
332 mtree/BSD.debug.dist /usr/lib
333 .if ${MK_GROFF} != "no"
334 MTREES+= mtree/BSD.groff.dist /usr
336 .if ${MK_LIB32} != "no"
337 MTREES+= mtree/BSD.lib32.dist /usr
338 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
340 .if ${MK_LIBSOFT} != "no"
341 MTREES+= mtree/BSD.libsoft.dist /usr
342 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
344 .if ${MK_TESTS} != "no"
345 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
346 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
348 .if ${MK_SENDMAIL} != "no"
349 MTREES+= mtree/BSD.sendmail.dist /
351 .for mtree in ${LOCAL_MTREE}
352 MTREES+= ../${mtree} /
355 # Clean up some directories that where mistakenly created as files that
356 # should not have been as part of the nvi update in r281994.
357 # This should be removed after 11.0-RELEASE.
358 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
359 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
360 distrib-cleanup: .PHONY
361 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
362 if [ -f ${DESTDIR}/$${file} ]; then \
363 rm -f ${DESTDIR}/$${file}; \
367 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
369 while test $$# -ge 2; do \
374 test -d $$d || mkdir -p $$d; \
375 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
376 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
377 ${MTREE_FILTER} $$m | \
378 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
383 while test $$# -ge 2; do \
387 test "$$d" == "/" && d=""; \
390 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
391 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
392 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
393 ${MTREE_FILTER} $$m | \
394 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
398 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
399 .if ${MK_MAN} != "no"
400 cd ${DESTDIR}${SHAREDIR}/man; \
401 for mandir in man*; do \
402 ${INSTALL_SYMLINK} ../$$mandir \
403 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
404 ${INSTALL_SYMLINK} ../$$mandir \
405 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
407 .if ${MK_OPENSSL} != "no"
408 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
409 for mandir in man*; do \
410 ${INSTALL_SYMLINK} ../$$mandir \
411 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
414 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
415 while [ $$# -gt 0 ] ; do \
416 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
417 if [ "${MK_OPENSSL}" != "no" ]; then \
418 ${INSTALL_SYMLINK} "$$2" \
419 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
424 .if ${MK_NLS} != "no"
425 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
426 while [ $$# -gt 0 ] ; do \
427 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
432 etc-examples-install: ${META_DEPS}
433 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
434 ${BIN1} ${BIN2} nsmb.conf opieaccess \
435 ${DESTDIR}${SHAREDIR}/examples/etc
437 etc-examples: etc-examples-install
438 ${_+_}cd ${.CURDIR}/defaults; \
439 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
440 DESTDIR=${DESTDIR}${SHAREDIR}/examples
442 .include <bsd.prog.mk>
444 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
445 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
446 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
447 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
448 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
449 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
452 .if !defined(NO_FSCHG)