1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
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"
88 AUTOFSMODE= ${BINMODE}
92 .if ${MK_FREEBSD_UPDATE} != "no"
93 BIN1+= freebsd-update.conf
100 .if ${MK_INETD} != "no"
104 .if ${MK_LOCATE} != "no"
105 BIN1+= ${.CURDIR}/../usr.bin/locate/locate/locate.rc
108 .if ${MK_LPR} != "no"
109 BIN1+= hosts.lpd printcap
112 .if ${MK_MAIL} != "no"
113 BIN1+= ${.CURDIR}/../usr.bin/mail/misc/mail.rc
116 .if ${MK_NTP} != "no"
120 .if ${MK_OPENSSH} != "no"
121 SSH= ${.CURDIR}/../crypto/openssh/ssh_config \
122 ${.CURDIR}/../crypto/openssh/sshd_config \
123 ${.CURDIR}/../crypto/openssh/moduli
125 .if ${MK_OPENSSL} != "no"
126 SSL= ${.CURDIR}/../crypto/openssl/apps/openssl.cnf
129 .if ${MK_NS_CACHING} != "no"
133 .if ${MK_PORTSNAP} != "no"
141 .if ${MK_SENDMAIL} != "no"
142 FILESGROUPS+= SENDMAILRC
143 SENDMAILRC= rc.sendmail
146 SENDMAILRCMODE= ${BINMODE}
147 SENDMAILRCPACKAGE=sendmail
149 .if ${MK_TCSH} != "no"
150 BIN1+= csh.cshrc csh.login csh.logout
153 .if ${MK_WIRELESS} != "no"
157 # -rwxr-xr-x root:wheel, for the new cron root:wheel
158 BIN2= netstart pccard_ether rc.suspend rc.resume
160 MTREE= BSD.debug.dist BSD.include.dist BSD.root.dist BSD.usr.dist BSD.var.dist
161 .if ${MK_LIB32} != "no"
162 MTREE+= BSD.lib32.dist
164 .if ${MK_LIBSOFT} != "no"
165 MTREE+= BSD.libsoft.dist
167 .if ${MK_TESTS} != "no"
168 MTREE+= BSD.tests.dist
170 .if ${MK_SENDMAIL} != "no"
171 MTREE+= BSD.sendmail.dist
176 .if ${MK_SENDMAIL} == "no"
177 ETCMAIL=mailer.conf aliases
179 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
180 mailertable.sample aliases
183 # Special top level files for FreeBSD
187 DESTDIR:= ${DESTDIR:C://*:/:g}
190 .if ${MK_MAN} != "no"
191 ${_+_}cd ${.CURDIR}/../share/man; ${MAKE} makedb
195 # Avoid installing tests here; "make distribution" will do this and
196 # correctly place them in the right location.
197 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
198 DESTDIR=${DISTDIR}/${DISTRIBUTION}
199 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
201 .include <bsd.endian.mk>
202 .if ${TARGET_ENDIANNESS} == "1234"
204 .elif ${TARGET_ENDIANNESS} == "4321"
211 METALOG.add?= cat -l >> ${METALOG}
215 .if !defined(DESTDIR)
216 @echo "set DESTDIR before running \"make ${.TARGET}\""
220 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
221 ${BIN1} ${DESTDIR}/etc; \
222 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
223 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
224 ${DESTDIR}/etc/services; \
225 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 \
226 ${BIN2} ${DESTDIR}/etc; \
227 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
228 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
229 .if ${MK_BSNMP} != "no"
231 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
232 snmpd.config ${DESTDIR}/etc;
235 sed -i "" -e 's;.*/usr/libexec/atrun;#&;' ${DESTDIR}/etc/crontab
237 .if ${MK_TCSH} == "no"
238 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
240 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
243 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
244 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
245 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
246 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
249 .if ${MK_AUTOFS} != "no"
250 ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install
252 .if ${MK_BLUETOOTH} != "no"
253 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
255 .if ${MK_CASPER} != "no"
256 ${_+_}cd ${.CURDIR}/casper; ${MAKE} install
258 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
259 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
260 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
261 .if ${MK_NTP} != "no"
262 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
264 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
265 .if ${MK_PKGBOOTSTRAP} != "no"
266 ${_+_}cd ${.CURDIR}/pkg; ${MAKE} install
268 ${_+_}cd ${.CURDIR}/rc.d; ${MAKE} install
269 ${_+_}cd ${.CURDIR}/../share/termcap; ${MAKE} etc-termcap
270 ${_+_}cd ${.CURDIR}/../usr.sbin/rmt; ${MAKE} etc-rmt
271 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
272 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0444 \
273 ${BSM_ETC_OPEN_FILES} ${BSM_ETC_DIR}
274 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0600 \
275 ${BSM_ETC_RESTRICTED_FILES} ${BSM_ETC_DIR}
276 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 0500 \
277 ${BSM_ETC_EXEC_FILES} ${BSM_ETC_DIR}
278 .if ${MK_UNBOUND} != "no"
279 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
280 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
283 .if ${MK_SENDMAIL} != "no"
284 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
286 .if ${MK_OPENSSH} != "no"
287 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
288 ${SSH} ${DESTDIR}/etc/ssh
290 .if ${MK_OPENSSL} != "no"
291 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
292 ${SSL} ${DESTDIR}/etc/ssl
294 .if ${MK_KERBEROS} != "no"
295 cd ${.CURDIR}/root; \
296 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
297 dot.k5login ${DESTDIR}/root/.k5login;
299 cd ${.CURDIR}/root; \
300 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
301 dot.profile ${DESTDIR}/root/.profile; \
302 rm -f ${DESTDIR}/.profile; \
303 ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile
304 .if ${MK_TCSH} != "no"
305 cd ${.CURDIR}/root; \
306 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
307 dot.cshrc ${DESTDIR}/root/.cshrc; \
308 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
309 dot.login ${DESTDIR}/root/.login; \
310 rm -f ${DESTDIR}/.cshrc; \
311 ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
313 cd ${.CURDIR}/mtree; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
314 ${MTREE} ${DESTDIR}/etc/mtree
315 .if ${MK_MAIL} != "no"
316 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
317 ${ETCMAIL} ${DESTDIR}/etc/mail
318 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
319 ! -f ${DESTDIR}/etc/aliases ]; then \
320 ln -s mail/aliases ${DESTDIR}/etc/aliases; \
323 ${INSTALL} -o ${BINOWN} -g operator -m 664 /dev/null \
324 ${DESTDIR}/etc/dumpdates
325 .if ${MK_LOCATE} != "no"
326 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
327 ${DESTDIR}/var/db/locate.database
329 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/minfree \
331 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
332 ${FREEBSD} ${DESTDIR}/
333 .if ${MK_BOOT} != "no"
334 .if exists(${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints)
335 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
336 ${.CURDIR}/../sys/${MACHINE}/conf/GENERIC.hints \
337 ${DESTDIR}/boot/device.hints
340 .if ${MK_NIS} == "no"
341 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
342 ${DESTDIR}/etc/nsswitch.conf
347 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
348 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
349 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
350 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
351 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
352 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
355 .if !defined(NO_FSCHG)
360 MTREES= mtree/BSD.root.dist / \
361 mtree/BSD.var.dist /var \
362 mtree/BSD.usr.dist /usr \
363 mtree/BSD.include.dist /usr/include \
364 mtree/BSD.debug.dist /usr/lib
365 .if ${MK_GROFF} != "no"
366 MTREES+= mtree/BSD.groff.dist /usr
368 .if ${MK_LIB32} != "no"
369 MTREES+= mtree/BSD.lib32.dist /usr
370 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
372 .if ${MK_LIBSOFT} != "no"
373 MTREES+= mtree/BSD.libsoft.dist /usr
374 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
376 .if ${MK_TESTS} != "no"
377 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
378 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
380 .if ${MK_SENDMAIL} != "no"
381 MTREES+= mtree/BSD.sendmail.dist /
383 .for mtree in ${LOCAL_MTREE}
384 MTREES+= ../${mtree} /
387 # Clean up some directories that where mistakenly created as files that
388 # should not have been as part of the nvi update in r281994.
389 # This should be removed after 11.0-RELEASE.
390 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
391 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
392 distrib-cleanup: .PHONY
393 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
394 if [ -f ${DESTDIR}/$${file} ]; then \
395 rm -f ${DESTDIR}/$${file}; \
399 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
401 while test $$# -ge 2; do \
406 test -d $$d || mkdir -p $$d; \
407 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
408 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
409 ${MTREE_FILTER} $$m | \
410 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
415 while test $$# -ge 2; do \
419 test "$$d" == "/" && d=""; \
422 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
423 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K uname,gname | " \
424 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
425 ${MTREE_FILTER} $$m | \
426 ${MTREE_CMD:N-W} -C -K uname,gname | sed s#^\.#.$$d# | \
430 ${INSTALL_SYMLINK} usr/src/sys ${DESTDIR}/sys
431 .if ${MK_MAN} != "no"
432 cd ${DESTDIR}${SHAREDIR}/man; \
433 for mandir in man*; do \
434 ${INSTALL_SYMLINK} ../$$mandir \
435 ${DESTDIR}${SHAREDIR}/man/en.ISO8859-1/; \
436 ${INSTALL_SYMLINK} ../$$mandir \
437 ${DESTDIR}${SHAREDIR}/man/en.UTF-8/; \
439 .if ${MK_OPENSSL} != "no"
440 cd ${DESTDIR}${SHAREDIR}/openssl/man; \
441 for mandir in man*; do \
442 ${INSTALL_SYMLINK} ../$$mandir \
443 ${DESTDIR}${SHAREDIR}/openssl/man/en.ISO8859-1/; \
446 set - `grep "^[a-zA-Z]" ${.CURDIR}/man.alias`; \
447 while [ $$# -gt 0 ] ; do \
448 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/man/$$1"; \
449 if [ "${MK_OPENSSL}" != "no" ]; then \
450 ${INSTALL_SYMLINK} "$$2" \
451 "${DESTDIR}${SHAREDIR}/openssl/man/$$1"; \
456 .if ${MK_NLS} != "no"
457 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
458 while [ $$# -gt 0 ] ; do \
459 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
465 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
466 ${BIN1} ${BIN2} nsmb.conf opieaccess \
467 ${DESTDIR}${SHAREDIR}/examples/etc
468 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install \
469 DESTDIR=${DESTDIR}${SHAREDIR}/examples
471 .include <bsd.prog.mk>