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"
46 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
47 BIN1+= etc.${MACHINE}/ttys
48 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
49 BIN1+= etc.${MACHINE_ARCH}/ttys
50 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
51 BIN1+= etc.${MACHINE_CPUARCH}/ttys
53 .error etc.MACHINE/ttys missing
56 # NB: keep these sorted by MK_* knobs
66 .if ${MK_LOCATE} != "no"
67 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
71 BIN1+= hosts.lpd printcap
74 .if ${MK_MAIL} != "no"
75 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
78 .if ${MK_OPENSSH} != "no"
79 SSH= ${SRCTOP}/crypto/openssh/ssh_config \
80 ${SRCTOP}/crypto/openssh/sshd_config \
81 ${SRCTOP}/crypto/openssh/moduli
83 .if ${MK_OPENSSL} != "no"
84 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
87 .if ${MK_SENDMAIL} != "no"
91 .if ${MK_TCSH} != "no"
92 BIN1+= csh.cshrc csh.login csh.logout
95 .if ${MK_WIRELESS} != "no"
99 .if ${MK_SENDMAIL} == "no"
100 ETCMAIL=mailer.conf aliases
102 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
103 mailertable.sample aliases
106 # Special top level files for FreeBSD
110 DESTDIR:= ${DESTDIR:C://*:/:g}
113 .if ${MK_MAN} != "no"
114 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
118 # Avoid installing tests here; "make distribution" will do this and
119 # correctly place them in the right location.
120 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
121 DESTDIR=${DISTDIR}/${DISTRIBUTION}
122 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
124 .include <bsd.endian.mk>
127 METALOG.add?= cat -l >> ${METALOG}
131 .if !defined(DESTDIR)
132 @echo "set DESTDIR before running \"make ${.TARGET}\""
136 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
137 ${BIN1} ${DESTDIR}/etc; \
138 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
139 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
140 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
142 .if ${MK_SERVICESDB} != "no"
144 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
145 ${DESTDIR}/etc/services;
148 .if ${MK_TCSH} == "no"
149 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
151 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
154 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
155 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
156 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
157 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
158 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
161 .if ${MK_BLUETOOTH} != "no"
162 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
164 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
165 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
166 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
167 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
168 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
169 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
170 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
171 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
172 .if ${MK_UNBOUND} != "no"
173 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
174 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
177 .if ${MK_SENDMAIL} != "no"
178 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
180 .if ${MK_OPENSSH} != "no"
181 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
182 ${SSH} ${DESTDIR}/etc/ssh
184 .if ${MK_OPENSSL} != "no"
185 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
186 ${SSL} ${DESTDIR}/etc/ssl
188 .if ${MK_KERBEROS} != "no"
189 cd ${.CURDIR}/root; \
190 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
191 dot.k5login ${DESTDIR}/root/.k5login;
193 cd ${.CURDIR}/root; \
194 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
195 dot.profile ${DESTDIR}/root/.profile; \
196 rm -f ${DESTDIR}/.profile; \
197 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
198 .if ${MK_TCSH} != "no"
199 cd ${.CURDIR}/root; \
200 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
201 dot.cshrc ${DESTDIR}/root/.cshrc; \
202 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
203 dot.login ${DESTDIR}/root/.login; \
204 rm -f ${DESTDIR}/.cshrc; \
205 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
207 .if ${MK_MAIL} != "no"
208 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
209 ${ETCMAIL} ${DESTDIR}/etc/mail
210 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
211 ! -f ${DESTDIR}/etc/aliases ]; then \
212 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
215 .if ${MK_LOCATE} != "no"
216 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
217 ${DESTDIR}/var/db/locate.database
219 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
220 ${FREEBSD} ${DESTDIR}/
221 .if ${MK_BOOT} != "no"
222 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
223 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
224 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
225 ${DESTDIR}/boot/device.hints
228 .if ${MK_NIS} == "no"
229 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
230 ${DESTDIR}/etc/nsswitch.conf
235 MTREES= mtree/BSD.root.dist / \
236 mtree/BSD.var.dist /var \
237 mtree/BSD.usr.dist /usr \
238 mtree/BSD.include.dist /usr/include \
239 mtree/BSD.debug.dist /usr/lib
240 .if ${MK_LIB32} != "no"
241 MTREES+= mtree/BSD.lib32.dist /usr
242 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
244 .if ${MK_LIBSOFT} != "no"
245 MTREES+= mtree/BSD.libsoft.dist /usr
246 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
248 .if ${MK_TESTS} != "no"
249 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
250 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
252 .if ${MK_SENDMAIL} != "no"
253 MTREES+= mtree/BSD.sendmail.dist /
255 .for mtree in ${LOCAL_MTREE}
256 MTREES+= ../${mtree} /
259 # Clean up some directories that where mistakenly created as files that
260 # should not have been as part of the nvi update in r281994.
261 # This should be removed after 11.0-RELEASE.
262 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
263 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
264 distrib-cleanup: .PHONY
265 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
266 if [ -f ${DESTDIR}/$${file} ]; then \
267 rm -f ${DESTDIR}/$${file}; \
271 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
273 while test $$# -ge 2; do \
278 test -d $$d || mkdir -p $$d; \
279 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
280 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
281 ${MTREE_FILTER} $$m | \
282 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
287 while test $$# -ge 2; do \
291 test "$$d" == "/" && d=""; \
294 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
295 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
296 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
297 ${MTREE_FILTER} $$m | \
298 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
302 .if ${MK_NLS} != "no"
303 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
304 while [ $$# -gt 0 ] ; do \
305 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
310 etc-examples-install: ${META_DEPS}
311 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
312 ${BIN1} ${BIN2} nsmb.conf opieaccess \
313 ${DESTDIR}${SHAREDIR}/examples/etc
315 etc-examples: etc-examples-install
316 ${_+_}cd ${.CURDIR}/defaults; \
317 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
318 DESTDIR=${DESTDIR}${SHAREDIR}/examples
320 .include <bsd.prog.mk>
322 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
323 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
324 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
325 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
326 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
327 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
330 .if !defined(NO_FSCHG)