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.
13 .if ${MK_SENDMAIL} != "no"
57 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
58 BIN1+= etc.${MACHINE}/ttys
59 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
60 BIN1+= etc.${MACHINE_ARCH}/ttys
61 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
62 BIN1+= etc.${MACHINE_CPUARCH}/ttys
64 .error etc.MACHINE/ttys missing
67 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
68 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
69 ${OPENBSMDIR}/etc/audit_event
70 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
71 ${OPENBSMDIR}/etc/audit_user
72 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
73 BSM_ETC_DIR= ${DESTDIR}/etc/security
75 # NB: keep these sorted by MK_* knobs
85 .if ${MK_AUTOFS} != "no"
90 AUTOFSMODE= ${BINMODE}
94 .if ${MK_FREEBSD_UPDATE} != "no"
95 BIN1+= freebsd-update.conf
102 .if ${MK_INETD} != "no"
106 .if ${MK_LOCATE} != "no"
107 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
110 .if ${MK_LPR} != "no"
111 BIN1+= hosts.lpd printcap
114 .if ${MK_MAIL} != "no"
115 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
118 .if ${MK_NTP} != "no"
122 .if ${MK_OPENSSH} != "no"
123 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
124 ${.CURDIR}/../crypto/openssh/sshd_config \
125 ${.CURDIR}/../crypto/openssh/moduli
127 .if ${MK_OPENSSL} != "no"
128 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
131 .if ${MK_NS_CACHING} != "no"
135 .if ${MK_PORTSNAP} != "no"
143 .if ${MK_SENDMAIL} != "no"
144 FILESGROUPS+= SENDMAILRC
145 SENDMAILRC= rc.sendmail
148 SENDMAILRCMODE= ${BINMODE}
149 SENDMAILRCPACKAGE=sendmail
151 .if ${MK_TCSH} != "no"
152 BIN1+= csh.cshrc csh.login csh.logout
155 .if ${MK_WIRELESS} != "no"
159 # -rwxr-xr-x root:wheel, for the new cron root:wheel
160 BIN2= netstart pccard_ether rc.suspend rc.resume
162 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
163 .if ${MK_LIB32} != "no"
164 MTREE+= BSD.lib32.dist
166 .if ${MK_LIBSOFT} != "no"
167 MTREE+= BSD.libsoft.dist
169 .if ${MK_TESTS} != "no"
170 MTREE+= BSD.tests.dist
172 .if ${MK_SENDMAIL} != "no"
173 MTREE+= BSD.sendmail.dist
178 .if ${MK_SENDMAIL} == "no"
179 ETCMAIL=mailer.conf aliases
181 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
182 mailertable.sample aliases
185 # Special top level files for FreeBSD
189 DESTDIR:= ${DESTDIR:C://*:/:g}
192 .if ${MK_MAN} != "no"
193 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
197 # Avoid installing tests here; "make distribution" will do this and
198 # correctly place them in the right location.
199 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
200 DESTDIR=${DISTDIR}/${DISTRIBUTION}
201 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
203 .include <bsd.endian.mk>
204 .if ${TARGET_ENDIANNESS} == "1234"
206 .elif ${TARGET_ENDIANNESS} == "4321"
213 METALOG.add?= cat -l >> ${METALOG}
217 .if !defined(DESTDIR)
218 @echo "set DESTDIR before running \"make ${.TARGET}\""
222 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
223 ${BIN1} ${DESTDIR}/etc; \
224 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
225 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
226 ${DESTDIR}/etc/services; \
227 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
228 ${BIN2} ${DESTDIR}/etc; \
229 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
230 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
231 .if ${MK_BSNMP} != "no"
233 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
234 snmpd.config ${DESTDIR}/etc;
237 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
239 .if ${MK_TCSH} == "no"
240 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
242 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
245 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
246 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
247 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
248 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
251 .if ${MK_AUTOFS} != "no"
252 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
254 .if ${MK_BLUETOOTH} != "no"
255 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
257 .if ${MK_CASPER} != "no"
258 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
260 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
261 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
262 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
263 .if ${MK_NTP} != "no"
264 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
266 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
267 .if ${MK_PKGBOOTSTRAP} != "no"
268 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
270 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
271 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
272 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
273 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
274 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
275 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
276 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
277 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
278 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
279 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
280 .if ${MK_UNBOUND} != "no"
281 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
282 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
285 .if ${MK_SENDMAIL} != "no"
286 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
288 .if ${MK_OPENSSH} != "no"
289 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
290 ${SSH} ${DESTDIR}/etc/ssh
292 .if ${MK_OPENSSL} != "no"
293 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 ${SSL} ${DESTDIR}/etc/ssl
296 .if ${MK_KERBEROS} != "no"
297 cd ${.CURDIR}/root; \
298 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
299 dot.k5login ${DESTDIR}/root/.k5login;
301 cd ${.CURDIR}/root; \
302 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
303 dot.profile ${DESTDIR}/root/.profile; \
304 rm -f ${DESTDIR}/.profile; \
305 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
306 .if ${MK_TCSH} != "no"
307 cd ${.CURDIR}/root; \
308 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
309 dot.cshrc ${DESTDIR}/root/.cshrc; \
310 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
311 dot.login ${DESTDIR}/root/.login; \
312 rm -f ${DESTDIR}/.cshrc; \
313 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
315 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
316 ${MTREE} ${DESTDIR}/etc/mtree
317 .if ${MK_MAIL} != "no"
318 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
319 ${ETCMAIL} ${DESTDIR}/etc/mail
320 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
321 ! -f ${DESTDIR}/etc/aliases ]; then \
322 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
325 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
326 ${DESTDIR}/etc/dumpdates
327 .if ${MK_LOCATE} != "no"
328 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
329 ${DESTDIR}/var/db/locate.database
331 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
333 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
334 ${FREEBSD} ${DESTDIR}/
335 .if ${MK_BOOT} != "no"
336 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
337 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
338 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
339 ${DESTDIR}/boot/device.hints
342 .if ${MK_NIS} == "no"
343 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
344 ${DESTDIR}/etc/nsswitch.conf
349 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
350 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
351 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
352 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
353 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
354 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
357 .if !defined(NO_FSCHG)
362 MTREES= mtree/BSD.root.dist / \
363 mtree/BSD.var.dist /var \
364 mtree/BSD.usr.dist /usr \
365 mtree/BSD.include.dist /usr/include \
366 mtree/BSD.debug.dist /usr/lib
367 .if ${MK_GROFF} != "no"
368 MTREES+= mtree/BSD.groff.dist /usr
370 .if ${MK_LIB32} != "no"
371 MTREES+= mtree/BSD.lib32.dist /usr
372 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
374 .if ${MK_LIBSOFT} != "no"
375 MTREES+= mtree/BSD.libsoft.dist /usr
376 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
378 .if ${MK_TESTS} != "no"
379 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
380 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
382 .if ${MK_SENDMAIL} != "no"
383 MTREES+= mtree/BSD.sendmail.dist /
385 .for mtree in ${LOCAL_MTREE}
386 MTREES+= ../${mtree} /
389 # Clean up some directories that where mistakenly created as files that
390 # should not have been as part of the nvi update in r281994.
391 # This should be removed after 11.0-RELEASE.
392 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
393 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
394 distrib-cleanup: .PHONY
395 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
396 if [ -f ${DESTDIR}/$${file} ]; then \
397 rm -f ${DESTDIR}/$${file}; \
401 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
403 while test $$# -ge 2; do \
408 test -d $$d || mkdir -p $$d; \
409 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
410 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
411 ${MTREE_FILTER} $$m | \
412 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
417 while test $$# -ge 2; do \
421 test "$$d" == "/" && d=""; \
424 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
425 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
426 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
427 ${MTREE_FILTER} $$m | \
428 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
432 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
433 .if ${MK_MAN} != "no"
434 cd ${DESTDIR}${SHAREDIR}/man; \
435 for mandir in man*; do \
436 ${INSTALL_SYMLINK} ../$$mandir \
437 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
438 ${INSTALL_SYMLINK} ../$$mandir \
439 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
441 .if ${MK_OPENSSL} != "no"
442 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
443 for mandir in man*; do \
444 ${INSTALL_SYMLINK} ../$$mandir \
445 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
448 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
449 while [ $$# -gt 0 ] ; do \
450 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
451 if [ "${MK_OPENSSL}" != "no" ]; then \
452 ${INSTALL_SYMLINK} "$$2" \
453 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
458 .if ${MK_NLS} != "no"
459 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
460 while [ $$# -gt 0 ] ; do \
461 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
466 etc-examples-install: ${META_DEPS}
467 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
468 ${BIN1} ${BIN2} nsmb.conf opieaccess \
469 ${DESTDIR}${SHAREDIR}/examples/etc
471 etc-examples: etc-examples-install
472 ${_+_}cd ${.CURDIR}/defaults; \
473 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
474 DESTDIR=${DESTDIR}${SHAREDIR}/examples
476 .include <bsd.prog.mk>