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"
45 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
46 BIN1+= etc.${MACHINE}/ttys
47 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
48 BIN1+= etc.${MACHINE_ARCH}/ttys
49 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
50 BIN1+= etc.${MACHINE_CPUARCH}/ttys
52 .error etc.MACHINE/ttys missing
55 # NB: keep these sorted by MK_* knobs
65 .if ${MK_LOCATE} != "no"
66 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
70 BIN1+= hosts.lpd printcap
73 .if ${MK_MAIL} != "no"
74 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
77 .if ${MK_OPENSSL} != "no"
78 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
81 .if ${MK_SENDMAIL} != "no"
85 .if ${MK_WIRELESS} != "no"
89 .if ${MK_SENDMAIL} == "no"
90 ETCMAIL=mailer.conf aliases
92 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
93 mailertable.sample aliases
96 # Special top level files for FreeBSD
100 DESTDIR:= ${DESTDIR:C://*:/:g}
103 .if ${MK_MAN} != "no"
104 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
108 # Avoid installing tests here; "make distribution" will do this and
109 # correctly place them in the right location.
110 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
111 DESTDIR=${DISTDIR}/${DISTRIBUTION}
112 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
114 .include <bsd.endian.mk>
117 METALOG.add?= cat -l >> ${METALOG}
121 .if !defined(DESTDIR)
122 @echo "set DESTDIR before running \"make ${.TARGET}\""
126 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
127 ${BIN1} ${DESTDIR}/etc; \
128 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
129 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
130 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
132 .if ${MK_SERVICESDB} != "no"
134 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
135 ${DESTDIR}/etc/services;
140 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
141 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
142 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
143 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
144 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
147 .if ${MK_BLUETOOTH} != "no"
148 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
150 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
151 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
152 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
153 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
154 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
155 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
156 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
157 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
158 .if ${MK_UNBOUND} != "no"
159 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
160 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
163 .if ${MK_SENDMAIL} != "no"
164 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
166 .if ${MK_OPENSSL} != "no"
167 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
168 ${SSL} ${DESTDIR}/etc/ssl
170 .if ${MK_KERBEROS} != "no"
171 cd ${.CURDIR}/root; \
172 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
173 dot.k5login ${DESTDIR}/root/.k5login;
176 .if ${MK_MAIL} != "no"
177 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
178 ${ETCMAIL} ${DESTDIR}/etc/mail
179 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
180 ! -f ${DESTDIR}/etc/aliases ]; then \
181 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
184 .if ${MK_LOCATE} != "no"
185 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
186 ${DESTDIR}/var/db/locate.database
188 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
189 ${FREEBSD} ${DESTDIR}/
190 .if ${MK_BOOT} != "no"
191 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
192 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
193 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
194 ${DESTDIR}/boot/device.hints
197 .if ${MK_NIS} == "no"
198 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
199 ${DESTDIR}/etc/nsswitch.conf
204 MTREES= mtree/BSD.root.dist / \
205 mtree/BSD.var.dist /var \
206 mtree/BSD.usr.dist /usr \
207 mtree/BSD.include.dist /usr/include \
208 mtree/BSD.debug.dist /usr/lib
209 .if ${MK_LIB32} != "no"
210 MTREES+= mtree/BSD.lib32.dist /usr
211 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
213 .if ${MK_LIBSOFT} != "no"
214 MTREES+= mtree/BSD.libsoft.dist /usr
215 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
217 .if ${MK_TESTS} != "no"
218 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
219 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
221 .if ${MK_SENDMAIL} != "no"
222 MTREES+= mtree/BSD.sendmail.dist /
224 .for mtree in ${LOCAL_MTREE}
225 MTREES+= ../${mtree} /
228 # Clean up some directories that where mistakenly created as files that
229 # should not have been as part of the nvi update in r281994.
230 # This should be removed after 11.0-RELEASE.
231 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
232 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
233 distrib-cleanup: .PHONY
234 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
235 if [ -f ${DESTDIR}/$${file} ]; then \
236 rm -f ${DESTDIR}/$${file}; \
240 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
242 while test $$# -ge 2; do \
247 test -d $$d || mkdir -p $$d; \
248 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
249 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
250 ${MTREE_FILTER} $$m | \
251 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
256 while test $$# -ge 2; do \
260 test "$$d" == "/" && d=""; \
263 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
264 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
265 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
266 ${MTREE_FILTER} $$m | \
267 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
271 .if ${MK_NLS} != "no"
272 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
273 while [ $$# -gt 0 ] ; do \
274 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
279 etc-examples-install: ${META_DEPS}
280 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
281 ${BIN1} ${BIN2} nsmb.conf opieaccess \
282 ${DESTDIR}${SHAREDIR}/examples/etc
284 etc-examples: etc-examples-install
285 ${_+_}cd ${.CURDIR}/defaults; \
286 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
287 DESTDIR=${DESTDIR}${SHAREDIR}/examples
289 .include <bsd.prog.mk>
291 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
292 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
293 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
294 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
295 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
296 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
299 .if !defined(NO_FSCHG)