1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
6 # No need as it is empty and just causes rebuilds since this file does so much.
12 .if ${MK_SENDMAIL} != "no"
56 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
57 BIN1+= etc.${MACHINE}/ttys
58 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
59 BIN1+= etc.${MACHINE_ARCH}/ttys
60 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
61 BIN1+= etc.${MACHINE_CPUARCH}/ttys
63 .error etc.MACHINE/ttys missing
66 OPENBSMDIR= ${.CURDIR}/../contrib/openbsm
67 BSM_ETC_OPEN_FILES= ${OPENBSMDIR}/etc/audit_class \
68 ${OPENBSMDIR}/etc/audit_event
69 BSM_ETC_RESTRICTED_FILES= ${OPENBSMDIR}/etc/audit_control \
70 ${OPENBSMDIR}/etc/audit_user
71 BSM_ETC_EXEC_FILES= ${OPENBSMDIR}/etc/audit_warn
72 BSM_ETC_DIR= ${DESTDIR}/etc/security
74 # NB: keep these sorted by MK_* knobs
84 .if ${MK_AUTOFS} != "no"
88 .if ${MK_FREEBSD_UPDATE} != "no"
89 BIN1+= freebsd-update.conf
96 .if ${MK_INETD} != "no"
100 .if ${MK_LOCATE} != "no"
101 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
104 .if ${MK_LPR} != "no"
105 BIN1+= hosts.lpd printcap
108 .if ${MK_MAIL} != "no"
109 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
112 .if ${MK_NTP} != "no"
116 .if ${MK_OPENSSH} != "no"
117 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
118 ${.CURDIR}/../crypto/openssh/sshd_config \
119 ${.CURDIR}/../crypto/openssh/moduli
121 .if ${MK_OPENSSL} != "no"
122 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
125 .if ${MK_NS_CACHING} != "no"
129 .if ${MK_PORTSNAP} != "no"
137 .if ${MK_SENDMAIL} != "no"
141 .if ${MK_TCSH} != "no"
142 BIN1+= csh.cshrc csh.login csh.logout
145 .if ${MK_WIRELESS} != "no"
149 # -rwxr-xr-x root:wheel, for the new cron root:wheel
150 BIN2= netstart pccard_ether rc.suspend rc.resume
152 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
153 .if ${MK_LIB32} != "no"
154 MTREE+= BSD.lib32.dist
156 .if ${MK_LIBSOFT} != "no"
157 MTREE+= BSD.libsoft.dist
159 .if ${MK_TESTS} != "no"
160 MTREE+= BSD.tests.dist
162 .if ${MK_SENDMAIL} != "no"
163 MTREE+= BSD.sendmail.dist
168 .if ${MK_SENDMAIL} == "no"
169 ETCMAIL=mailer.conf aliases
171 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
172 mailertable.sample aliases
175 # Special top level files for FreeBSD
179 DESTDIR:= ${DESTDIR:C://*:/:g}
182 .if ${MK_MAN} != "no"
183 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
187 # Avoid installing tests here; "make distribution" will do this and
188 # correctly place them in the right location.
189 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
190 DESTDIR=${DISTDIR}/${DISTRIBUTION}
191 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
193 .include <bsd.endian.mk>
194 .if ${TARGET_ENDIANNESS} == "1234"
196 .elif ${TARGET_ENDIANNESS} == "4321"
203 METALOG.add?= cat -l >> ${METALOG}
207 .if !defined(DESTDIR)
208 @echo "set DESTDIR before running \"make ${.TARGET}\""
212 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
213 ${BIN1} ${DESTDIR}/etc; \
214 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
215 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
216 ${DESTDIR}/etc/services; \
217 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
218 ${BIN2} ${DESTDIR}/etc; \
219 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
220 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
221 .if ${MK_BSNMP} != "no"
223 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
224 snmpd.config ${DESTDIR}/etc;
227 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
229 .if ${MK_TCSH} == "no"
230 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
232 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
235 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
236 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
237 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
238 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
241 .if ${MK_AUTOFS} != "no"
242 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
244 .if ${MK_BLUETOOTH} != "no"
245 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
247 .if ${MK_CASPER} != "no"
248 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
250 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
251 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
252 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
253 .if ${MK_NTP} != "no"
254 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
256 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
257 .if ${MK_PKGBOOTSTRAP} != "no"
258 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
260 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
261 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
262 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
263 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
264 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
265 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
266 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
267 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
268 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
269 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
270 .if ${MK_UNBOUND} != "no"
271 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
272 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
275 .if ${MK_SENDMAIL} != "no"
276 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
278 .if ${MK_OPENSSH} != "no"
279 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
280 ${SSH} ${DESTDIR}/etc/ssh
282 .if ${MK_OPENSSL} != "no"
283 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
284 ${SSL} ${DESTDIR}/etc/ssl
286 .if ${MK_KERBEROS} != "no"
287 cd ${.CURDIR}/root; \
288 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
289 dot.k5login ${DESTDIR}/root/.k5login;
291 cd ${.CURDIR}/root; \
292 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
293 dot.profile ${DESTDIR}/root/.profile; \
294 rm -f ${DESTDIR}/.profile; \
295 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
296 .if ${MK_TCSH} != "no"
297 cd ${.CURDIR}/root; \
298 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
299 dot.cshrc ${DESTDIR}/root/.cshrc; \
300 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
301 dot.login ${DESTDIR}/root/.login; \
302 rm -f ${DESTDIR}/.cshrc; \
303 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
305 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
306 ${MTREE} ${DESTDIR}/etc/mtree
307 .if ${MK_MAIL} != "no"
308 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
309 ${ETCMAIL} ${DESTDIR}/etc/mail
310 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
311 ! -f ${DESTDIR}/etc/aliases ]; then \
312 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
315 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
316 ${DESTDIR}/etc/dumpdates
317 .if ${MK_LOCATE} != "no"
318 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
319 ${DESTDIR}/var/db/locate.database
321 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
323 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
324 ${FREEBSD} ${DESTDIR}/
325 .if ${MK_BOOT} != "no"
326 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
327 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
328 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
329 ${DESTDIR}/boot/device.hints
332 .if ${MK_NIS} == "no"
333 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
334 ${DESTDIR}/etc/nsswitch.conf
339 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
340 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
341 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
342 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
343 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
344 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
347 .if !defined(NO_FSCHG)
352 MTREES= mtree/BSD.root.dist / \
353 mtree/BSD.var.dist /var \
354 mtree/BSD.usr.dist /usr \
355 mtree/BSD.include.dist /usr/include \
356 mtree/BSD.debug.dist /usr/lib
357 .if ${MK_GROFF} != "no"
358 MTREES+= mtree/BSD.groff.dist /usr
360 .if ${MK_LIB32} != "no"
361 MTREES+= mtree/BSD.lib32.dist /usr
362 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
364 .if ${MK_LIBSOFT} != "no"
365 MTREES+= mtree/BSD.libsoft.dist /usr
366 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
368 .if ${MK_TESTS} != "no"
369 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
370 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
372 .if ${MK_SENDMAIL} != "no"
373 MTREES+= mtree/BSD.sendmail.dist /
375 .for mtree in ${LOCAL_MTREE}
376 MTREES+= ../${mtree} /
379 # Clean up some directories that where mistakenly created as files that
380 # should not have been as part of the nvi update in r281994.
381 # This should be removed after 11.0-RELEASE.
382 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
383 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
384 distrib-cleanup: .PHONY
385 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
386 if [ -f ${DESTDIR}/$${file} ]; then \
387 rm -f ${DESTDIR}/$${file}; \
391 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
393 while test $$# -ge 2; do \
398 test -d $$d || mkdir -p $$d; \
399 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
400 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
401 ${MTREE_FILTER} $$m | \
402 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
407 while test $$# -ge 2; do \
411 test "$$d" == "/" && d=""; \
414 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
415 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
416 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
417 ${MTREE_FILTER} $$m | \
418 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
422 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
423 .if ${MK_MAN} != "no"
424 cd ${DESTDIR}${SHAREDIR}/man; \
425 for mandir in man*; do \
426 ${INSTALL_SYMLINK} ../$$mandir \
427 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
428 ${INSTALL_SYMLINK} ../$$mandir \
429 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
431 .if ${MK_OPENSSL} != "no"
432 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
433 for mandir in man*; do \
434 ${INSTALL_SYMLINK} ../$$mandir \
435 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
438 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
439 while [ $$# -gt 0 ] ; do \
440 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
441 if [ "${MK_OPENSSL}" != "no" ]; then \
442 ${INSTALL_SYMLINK} "$$2" \
443 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
448 .if ${MK_NLS} != "no"
449 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
450 while [ $$# -gt 0 ] ; do \
451 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
456 etc-examples-install: ${META_DEPS}
457 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
458 ${BIN1} ${BIN2} nsmb.conf opieaccess \
459 ${DESTDIR}${SHAREDIR}/examples/etc
461 etc-examples: etc-examples-install
462 ${_+_}cd ${.CURDIR}/defaults; \
463 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
464 DESTDIR=${DESTDIR}${SHAREDIR}/examples
466 .include <bsd.prog.mk>