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= ${SRCTOP}/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"
89 .if ${MK_BLACKLIST} != "no"
90 BIN1+= blacklistd.conf
93 .if ${MK_FREEBSD_UPDATE} != "no"
94 BIN1+= freebsd-update.conf
101 .if ${MK_INETD} != "no"
105 .if ${MK_LOCATE} != "no"
106 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
109 .if ${MK_LPR} != "no"
110 BIN1+= hosts.lpd printcap
113 .if ${MK_MAIL} != "no"
114 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
117 .if ${MK_NTP} != "no"
121 .if ${MK_OPENSSH} != "no"
122 SSH= ${SRCTOP}/crypto/openssh/ssh_config \
123 ${SRCTOP}/crypto/openssh/sshd_config \
124 ${SRCTOP}/crypto/openssh/moduli
126 .if ${MK_OPENSSL} != "no"
127 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
130 .if ${MK_NS_CACHING} != "no"
134 .if ${MK_PORTSNAP} != "no"
142 .if ${MK_SENDMAIL} != "no"
146 .if ${MK_TCSH} != "no"
147 BIN1+= csh.cshrc csh.login csh.logout
150 .if ${MK_WIRELESS} != "no"
154 # -rwxr-xr-x root:wheel, for the new cron root:wheel
155 BIN2= netstart pccard_ether rc.suspend rc.resume
157 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
158 .if ${MK_LIB32} != "no"
159 MTREE+= BSD.lib32.dist
161 .if ${MK_LIBSOFT} != "no"
162 MTREE+= BSD.libsoft.dist
164 .if ${MK_TESTS} != "no"
165 MTREE+= BSD.tests.dist
167 .if ${MK_SENDMAIL} != "no"
168 MTREE+= BSD.sendmail.dist
173 .if ${MK_SENDMAIL} == "no"
174 ETCMAIL=mailer.conf aliases
176 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
177 mailertable.sample aliases
180 # Special top level files for FreeBSD
184 DESTDIR:= ${DESTDIR:C://*:/:g}
187 .if ${MK_MAN} != "no"
188 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
192 # Avoid installing tests here; "make distribution" will do this and
193 # correctly place them in the right location.
194 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
195 DESTDIR=${DISTDIR}/${DISTRIBUTION}
196 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
198 .include <bsd.endian.mk>
199 .if ${TARGET_ENDIANNESS} == "1234"
201 .elif ${TARGET_ENDIANNESS} == "4321"
208 METALOG.add?= cat -l >> ${METALOG}
212 .if !defined(DESTDIR)
213 @echo "set DESTDIR before running \"make ${.TARGET}\""
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
218 ${BIN1} ${DESTDIR}/etc; \
219 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
220 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
221 ${DESTDIR}/etc/services; \
222 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
223 ${BIN2} ${DESTDIR}/etc; \
224 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
225 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
226 .if ${MK_BSNMP} != "no"
228 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
229 snmpd.config ${DESTDIR}/etc;
232 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
234 .if ${MK_TCSH} == "no"
235 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
237 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
240 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
241 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
242 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
243 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
246 .if ${MK_AUTOFS} != "no"
247 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
249 .if ${MK_BLUETOOTH} != "no"
250 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
252 .if ${MK_CASPER} != "no"
253 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
255 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
257 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
258 .if ${MK_NTP} != "no"
259 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
261 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
262 .if ${MK_PKGBOOTSTRAP} != "no"
263 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
265 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
266 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
267 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
268 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
269 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
270 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
271 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
272 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
273 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
274 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
275 .if ${MK_UNBOUND} != "no"
276 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
277 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
280 .if ${MK_SENDMAIL} != "no"
281 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
283 .if ${MK_OPENSSH} != "no"
284 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
285 ${SSH} ${DESTDIR}/etc/ssh
287 .if ${MK_OPENSSL} != "no"
288 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 ${SSL} ${DESTDIR}/etc/ssl
291 .if ${MK_KERBEROS} != "no"
292 cd ${.CURDIR}/root; \
293 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
294 dot.k5login ${DESTDIR}/root/.k5login;
296 cd ${.CURDIR}/root; \
297 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
298 dot.profile ${DESTDIR}/root/.profile; \
299 rm -f ${DESTDIR}/.profile; \
300 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
301 .if ${MK_TCSH} != "no"
302 cd ${.CURDIR}/root; \
303 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
304 dot.cshrc ${DESTDIR}/root/.cshrc; \
305 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
306 dot.login ${DESTDIR}/root/.login; \
307 rm -f ${DESTDIR}/.cshrc; \
308 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
310 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
311 ${MTREE} ${DESTDIR}/etc/mtree
312 .if ${MK_MAIL} != "no"
313 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
314 ${ETCMAIL} ${DESTDIR}/etc/mail
315 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
316 ! -f ${DESTDIR}/etc/aliases ]; then \
317 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
320 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
321 ${DESTDIR}/etc/dumpdates
322 .if ${MK_LOCATE} != "no"
323 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
324 ${DESTDIR}/var/db/locate.database
326 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
328 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
329 ${FREEBSD} ${DESTDIR}/
330 .if ${MK_BOOT} != "no"
331 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
332 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
333 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
334 ${DESTDIR}/boot/device.hints
337 .if ${MK_NIS} == "no"
338 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
339 ${DESTDIR}/etc/nsswitch.conf
344 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
345 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
346 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
347 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
348 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
349 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
352 .if !defined(NO_FSCHG)
357 MTREES= mtree/BSD.root.dist / \
358 mtree/BSD.var.dist /var \
359 mtree/BSD.usr.dist /usr \
360 mtree/BSD.include.dist /usr/include \
361 mtree/BSD.debug.dist /usr/lib
362 .if ${MK_GROFF} != "no"
363 MTREES+= mtree/BSD.groff.dist /usr
365 .if ${MK_LIB32} != "no"
366 MTREES+= mtree/BSD.lib32.dist /usr
367 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
369 .if ${MK_LIBSOFT} != "no"
370 MTREES+= mtree/BSD.libsoft.dist /usr
371 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
373 .if ${MK_TESTS} != "no"
374 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
375 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
377 .if ${MK_SENDMAIL} != "no"
378 MTREES+= mtree/BSD.sendmail.dist /
380 .for mtree in ${LOCAL_MTREE}
381 MTREES+= ../${mtree} /
384 # Clean up some directories that where mistakenly created as files that
385 # should not have been as part of the nvi update in r281994.
386 # This should be removed after 11.0-RELEASE.
387 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
388 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
389 distrib-cleanup: .PHONY
390 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
391 if [ -f ${DESTDIR}/$${file} ]; then \
392 rm -f ${DESTDIR}/$${file}; \
396 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
398 while test $$# -ge 2; do \
403 test -d $$d || mkdir -p $$d; \
404 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
405 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
406 ${MTREE_FILTER} $$m | \
407 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
412 while test $$# -ge 2; do \
416 test "$$d" == "/" && d=""; \
419 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
420 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
421 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
422 ${MTREE_FILTER} $$m | \
423 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
427 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
428 .if ${MK_MAN} != "no"
429 cd ${DESTDIR}${SHAREDIR}/man; \
430 for mandir in man*; do \
431 ${INSTALL_SYMLINK} ../$$mandir \
432 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
433 ${INSTALL_SYMLINK} ../$$mandir \
434 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
436 .if ${MK_OPENSSL} != "no"
437 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
438 for mandir in man*; do \
439 ${INSTALL_SYMLINK} ../$$mandir \
440 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
443 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
444 while [ $$# -gt 0 ] ; do \
445 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
446 if [ "${MK_OPENSSL}" != "no" ]; then \
447 ${INSTALL_SYMLINK} "$$2" \
448 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
453 .if ${MK_NLS} != "no"
454 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
455 while [ $$# -gt 0 ] ; do \
456 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
461 etc-examples-install: ${META_DEPS}
462 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
463 ${BIN1} ${BIN2} nsmb.conf opieaccess \
464 ${DESTDIR}${SHAREDIR}/examples/etc
466 etc-examples: etc-examples-install
467 ${_+_}cd ${.CURDIR}/defaults; \
468 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
469 DESTDIR=${DESTDIR}${SHAREDIR}/examples
471 .include <bsd.prog.mk>