1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
9 PWD_MKDB_CMD?= pwd_mkdb
11 # No need as it is empty and just causes rebuilds since this file does so much.
14 .if ${MK_SENDMAIL} != "no"
18 # NB: keep these sorted by MK_* knobs
20 .if ${MK_SENDMAIL} == "no"
21 ETCMAIL=mailer.conf aliases
23 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
24 mailertable.sample aliases
27 # Special top level files for FreeBSD
31 DESTDIR:= ${DESTDIR:C://*:/:g}
35 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
39 # Avoid installing tests here; "make distribution" will do this and
40 # correctly place them in the right location.
41 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
42 DESTDIR=${DISTDIR}/${DISTRIBUTION}
43 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
45 .include <bsd.endian.mk>
48 METALOG.add?= cat -l >> ${METALOG}
53 @echo "set DESTDIR before running \"make ${.TARGET}\""
56 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
57 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
58 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
59 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
60 ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \
61 ${DESTDIR}/etc/os-release
62 .if ${MK_UNBOUND} != "no"
63 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
64 ${INSTALL_SYMLINK} -T "package=unbound" \
65 ../var/unbound ${DESTDIR}/etc/unbound; \
68 .if ${MK_SENDMAIL} != "no"
69 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
71 .if ${MK_KERBEROS} != "no"
73 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
74 -T "package=runtime" \
75 dot.k5login ${DESTDIR}/root/.k5login;
78 .if ${MK_MAIL} != "no"
79 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
80 -T "package=runtime" ${ETCMAIL} ${DESTDIR}/etc/mail
81 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
82 ! -f ${DESTDIR}/etc/aliases ]; then \
83 ${INSTALL_SYMLINK} -T "package=runtime" \
84 mail/aliases ${DESTDIR}/etc/aliases; \
87 .if ${MK_LOCATE} != "no"
88 ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\
89 /dev/null ${DESTDIR}/var/db/locate.database
91 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
92 -T "package=runtime" ${FREEBSD} ${DESTDIR}/
93 .if ${MK_BOOT} != "no"
94 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
95 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
96 -T "package=runtime" \
97 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
98 ${DESTDIR}/boot/device.hints
104 MTREES= mtree/BSD.root.dist / \
105 mtree/BSD.var.dist /var \
106 mtree/BSD.usr.dist /usr \
107 mtree/BSD.include.dist /usr/include \
108 mtree/BSD.debug.dist /usr/lib
109 .if ${MK_LIB32} != "no"
110 MTREES+= mtree/BSD.lib32.dist /usr
111 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
113 .if ${MK_LIBSOFT} != "no"
114 MTREES+= mtree/BSD.libsoft.dist /usr
115 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
117 .if ${MK_TESTS} != "no"
118 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
119 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
121 .if ${MK_SENDMAIL} != "no"
122 MTREES+= mtree/BSD.sendmail.dist /
124 .for mtree in ${LOCAL_MTREE}
125 MTREES+= ../${mtree} /
128 # Clean up some directories that where mistakenly created as files that
129 # should not have been as part of the nvi update in r281994.
130 # This should be removed after 11.0-RELEASE.
131 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
132 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
133 distrib-cleanup: .PHONY
134 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
135 if [ -f ${DESTDIR}/$${file} ]; then \
136 rm -f ${DESTDIR}/$${file}; \
140 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
141 .for _m _d in ${MTREES}
142 @m=${.CURDIR}/${_m}; \
144 test -d $$d || mkdir -p $$d; \
145 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
146 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
147 ${MTREE_FILTER} $$m | \
148 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
152 .for _m _d in ${MTREES}
153 @m=${.CURDIR}/${_m}; \
155 test "$$d" == "/" && d=""; \
157 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
158 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
159 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
160 ${MTREE_FILTER} $$m | \
161 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
165 .if ${MK_NLS} != "no"
166 .for alias nls in ${NLS_ALIASES}
167 ${INSTALL_SYMLINK} -T "package=utilities" \
168 "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}"
172 .include <bsd.prog.mk>
174 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
175 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
176 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
177 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
178 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
179 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
182 .if !defined(NO_FSCHG)