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
155 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
156 .if ${MK_LIB32} != "no"
157 MTREE+= BSD.lib32.dist
159 .if ${MK_LIBSOFT} != "no"
160 MTREE+= BSD.libsoft.dist
162 .if ${MK_TESTS} != "no"
163 MTREE+= BSD.tests.dist
165 .if ${MK_SENDMAIL} != "no"
166 MTREE+= BSD.sendmail.dist
171 .if ${MK_SENDMAIL} == "no"
172 ETCMAIL=mailer.conf aliases
174 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
175 mailertable.sample aliases
178 # Special top level files for FreeBSD
182 DESTDIR:= ${DESTDIR:C://*:/:g}
185 .if ${MK_MAN} != "no"
186 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
190 # Avoid installing tests here; "make distribution" will do this and
191 # correctly place them in the right location.
192 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
193 DESTDIR=${DISTDIR}/${DISTRIBUTION}
194 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
196 .include <bsd.endian.mk>
197 .if ${TARGET_ENDIANNESS} == "1234"
199 .elif ${TARGET_ENDIANNESS} == "4321"
206 METALOG.add?= cat -l >> ${METALOG}
210 .if !defined(DESTDIR)
211 @echo "set DESTDIR before running \"make ${.TARGET}\""
215 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
216 ${BIN1} ${DESTDIR}/etc; \
217 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
218 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
219 ${DESTDIR}/etc/services; \
220 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
221 ${BIN2} ${DESTDIR}/etc; \
222 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
223 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
224 .if ${MK_BSNMP} != "no"
226 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
227 snmpd.config ${DESTDIR}/etc;
230 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
232 .if ${MK_TCSH} == "no"
233 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
235 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
238 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
239 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
240 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
241 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
244 .if ${MK_AUTOFS} != "no"
245 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
247 .if ${MK_BLUETOOTH} != "no"
248 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
250 .if ${MK_CASPER} != "no"
251 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
253 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
254 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
255 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
257 .if ${MK_NTP} != "no"
258 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
260 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
261 .if ${MK_PKGBOOTSTRAP} != "no"
262 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
264 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
265 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
266 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
267 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
268 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
269 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
270 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
271 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
272 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
273 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
274 .if ${MK_UNBOUND} != "no"
275 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
276 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
279 .if ${MK_SENDMAIL} != "no"
280 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
282 .if ${MK_OPENSSH} != "no"
283 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
284 ${SSH} ${DESTDIR}/etc/ssh
286 .if ${MK_OPENSSL} != "no"
287 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
288 ${SSL} ${DESTDIR}/etc/ssl
290 .if ${MK_KERBEROS} != "no"
291 cd ${.CURDIR}/root; \
292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
293 dot.k5login ${DESTDIR}/root/.k5login;
295 cd ${.CURDIR}/root; \
296 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 dot.profile ${DESTDIR}/root/.profile; \
298 rm -f ${DESTDIR}/.profile; \
299 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
300 .if ${MK_TCSH} != "no"
301 cd ${.CURDIR}/root; \
302 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303 dot.cshrc ${DESTDIR}/root/.cshrc; \
304 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
305 dot.login ${DESTDIR}/root/.login; \
306 rm -f ${DESTDIR}/.cshrc; \
307 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
309 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
310 ${MTREE} ${DESTDIR}/etc/mtree
311 .if ${MK_MAIL} != "no"
312 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
313 ${ETCMAIL} ${DESTDIR}/etc/mail
314 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
315 ! -f ${DESTDIR}/etc/aliases ]; then \
316 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
319 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
320 ${DESTDIR}/etc/dumpdates
321 .if ${MK_LOCATE} != "no"
322 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
323 ${DESTDIR}/var/db/locate.database
325 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
327 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
328 ${FREEBSD} ${DESTDIR}/
329 .if ${MK_BOOT} != "no"
330 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
331 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
332 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
333 ${DESTDIR}/boot/device.hints
336 .if ${MK_NIS} == "no"
337 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
338 ${DESTDIR}/etc/nsswitch.conf
343 MTREES= mtree/BSD.root.dist / \
344 mtree/BSD.var.dist /var \
345 mtree/BSD.usr.dist /usr \
346 mtree/BSD.include.dist /usr/include \
347 mtree/BSD.debug.dist /usr/lib
348 .if ${MK_GROFF} != "no"
349 MTREES+= mtree/BSD.groff.dist /usr
351 .if ${MK_LIB32} != "no"
352 MTREES+= mtree/BSD.lib32.dist /usr
353 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
355 .if ${MK_LIBSOFT} != "no"
356 MTREES+= mtree/BSD.libsoft.dist /usr
357 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
359 .if ${MK_TESTS} != "no"
360 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
361 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
363 .if ${MK_SENDMAIL} != "no"
364 MTREES+= mtree/BSD.sendmail.dist /
366 .for mtree in ${LOCAL_MTREE}
367 MTREES+= ../${mtree} /
370 # Clean up some directories that where mistakenly created as files that
371 # should not have been as part of the nvi update in r281994.
372 # This should be removed after 11.0-RELEASE.
373 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
374 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
375 distrib-cleanup: .PHONY
376 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
377 if [ -f ${DESTDIR}/$${file} ]; then \
378 rm -f ${DESTDIR}/$${file}; \
382 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
384 while test $$# -ge 2; do \
389 test -d $$d || mkdir -p $$d; \
390 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
391 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
392 ${MTREE_FILTER} $$m | \
393 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
398 while test $$# -ge 2; do \
402 test "$$d" == "/" && d=""; \
405 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
406 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
407 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
408 ${MTREE_FILTER} $$m | \
409 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
413 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
414 .if ${MK_MAN} != "no"
415 cd ${DESTDIR}${SHAREDIR}/man; \
416 for mandir in man*; do \
417 ${INSTALL_SYMLINK} ../$$mandir \
418 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
419 ${INSTALL_SYMLINK} ../$$mandir \
420 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
422 .if ${MK_OPENSSL} != "no"
423 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
424 for mandir in man*; do \
425 ${INSTALL_SYMLINK} ../$$mandir \
426 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
429 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
430 while [ $$# -gt 0 ] ; do \
431 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
432 if [ "${MK_OPENSSL}" != "no" ]; then \
433 ${INSTALL_SYMLINK} "$$2" \
434 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
439 .if ${MK_NLS} != "no"
440 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
441 while [ $$# -gt 0 ] ; do \
442 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
447 etc-examples-install: ${META_DEPS}
448 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
449 ${BIN1} ${BIN2} nsmb.conf opieaccess \
450 ${DESTDIR}${SHAREDIR}/examples/etc
452 etc-examples: etc-examples-install
453 ${_+_}cd ${.CURDIR}/defaults; \
454 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
455 DESTDIR=${DESTDIR}${SHAREDIR}/examples
457 .include <bsd.prog.mk>
459 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
460 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
461 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
462 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
463 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
464 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
467 .if !defined(NO_FSCHG)