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.
11 .if ${MK_SENDMAIL} != "no"
43 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
44 BIN1+= etc.${MACHINE}/ttys
45 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
46 BIN1+= etc.${MACHINE_ARCH}/ttys
47 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
48 BIN1+= etc.${MACHINE_CPUARCH}/ttys
50 .error etc.MACHINE/ttys missing
53 # NB: keep these sorted by MK_* knobs
59 .if ${MK_LOCATE} != "no"
60 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
64 BIN1+= hosts.lpd printcap
67 .if ${MK_MAIL} != "no"
68 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
71 .if ${MK_OPENSSL} != "no"
72 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
75 .if ${MK_SENDMAIL} != "no"
79 .if ${MK_WIRELESS} != "no"
83 .if ${MK_SENDMAIL} == "no"
84 ETCMAIL=mailer.conf aliases
86 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
87 mailertable.sample aliases
90 # Special top level files for FreeBSD
94 DESTDIR:= ${DESTDIR:C://*:/:g}
98 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
102 # Avoid installing tests here; "make distribution" will do this and
103 # correctly place them in the right location.
104 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
105 DESTDIR=${DISTDIR}/${DISTRIBUTION}
106 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
108 .include <bsd.endian.mk>
111 METALOG.add?= cat -l >> ${METALOG}
115 .if !defined(DESTDIR)
116 @echo "set DESTDIR before running \"make ${.TARGET}\""
120 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
121 ${BIN1} ${DESTDIR}/etc; \
122 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
123 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
124 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
126 .if ${MK_SERVICESDB} != "no"
128 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
129 ${DESTDIR}/etc/services;
132 .if ${MK_TCSH} == "no"
133 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
135 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
138 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
139 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
140 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
141 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
142 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
145 .if ${MK_BLUETOOTH} != "no"
146 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
148 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
149 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
150 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
151 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
152 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
153 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
154 .if ${MK_UNBOUND} != "no"
155 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
156 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
159 .if ${MK_SENDMAIL} != "no"
160 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
162 .if ${MK_OPENSSL} != "no"
163 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
164 ${SSL} ${DESTDIR}/etc/ssl
166 .if ${MK_KERBEROS} != "no"
167 cd ${.CURDIR}/root; \
168 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
169 dot.k5login ${DESTDIR}/root/.k5login;
171 cd ${.CURDIR}/root; \
172 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
173 dot.profile ${DESTDIR}/root/.profile; \
174 rm -f ${DESTDIR}/.profile; \
175 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
176 .if ${MK_TCSH} != "no"
177 cd ${.CURDIR}/root; \
178 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
179 dot.cshrc ${DESTDIR}/root/.cshrc; \
180 rm -f ${DESTDIR}/.cshrc; \
181 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
184 .if ${MK_MAIL} != "no"
185 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
186 ${ETCMAIL} ${DESTDIR}/etc/mail
187 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
188 ! -f ${DESTDIR}/etc/aliases ]; then \
189 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
192 .if ${MK_LOCATE} != "no"
193 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
194 ${DESTDIR}/var/db/locate.database
196 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
197 ${FREEBSD} ${DESTDIR}/
198 .if ${MK_BOOT} != "no"
199 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
200 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
201 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
202 ${DESTDIR}/boot/device.hints
205 .if ${MK_NIS} == "no"
206 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
207 ${DESTDIR}/etc/nsswitch.conf
212 MTREES= mtree/BSD.root.dist / \
213 mtree/BSD.var.dist /var \
214 mtree/BSD.usr.dist /usr \
215 mtree/BSD.include.dist /usr/include \
216 mtree/BSD.debug.dist /usr/lib
217 .if ${MK_LIB32} != "no"
218 MTREES+= mtree/BSD.lib32.dist /usr
219 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
221 .if ${MK_LIBSOFT} != "no"
222 MTREES+= mtree/BSD.libsoft.dist /usr
223 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
225 .if ${MK_TESTS} != "no"
226 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
227 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
229 .if ${MK_SENDMAIL} != "no"
230 MTREES+= mtree/BSD.sendmail.dist /
232 .for mtree in ${LOCAL_MTREE}
233 MTREES+= ../${mtree} /
236 # Clean up some directories that where mistakenly created as files that
237 # should not have been as part of the nvi update in r281994.
238 # This should be removed after 11.0-RELEASE.
239 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
240 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
241 distrib-cleanup: .PHONY
242 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
243 if [ -f ${DESTDIR}/$${file} ]; then \
244 rm -f ${DESTDIR}/$${file}; \
248 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
250 while test $$# -ge 2; do \
255 test -d $$d || mkdir -p $$d; \
256 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
257 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
258 ${MTREE_FILTER} $$m | \
259 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
264 while test $$# -ge 2; do \
268 test "$$d" == "/" && d=""; \
271 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
272 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
273 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
274 ${MTREE_FILTER} $$m | \
275 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
279 .if ${MK_NLS} != "no"
280 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
281 while [ $$# -gt 0 ] ; do \
282 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
287 etc-examples-install: ${META_DEPS}
288 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
289 ${BIN1} ${BIN2} nsmb.conf opieaccess \
290 ${DESTDIR}${SHAREDIR}/examples/etc
292 etc-examples: etc-examples-install
293 ${_+_}cd ${.CURDIR}/defaults; \
294 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
295 DESTDIR=${DESTDIR}${SHAREDIR}/examples
297 .include <bsd.prog.mk>
299 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
300 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
301 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
302 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
303 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
304 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
307 .if !defined(NO_FSCHG)