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"
47 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
48 BIN1+= etc.${MACHINE}/ttys
49 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
50 BIN1+= etc.${MACHINE_ARCH}/ttys
51 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
52 BIN1+= etc.${MACHINE_CPUARCH}/ttys
54 .error etc.MACHINE/ttys missing
57 # NB: keep these sorted by MK_* knobs
67 .if ${MK_INETD} != "no"
71 .if ${MK_LOCATE} != "no"
72 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
76 BIN1+= hosts.lpd printcap
79 .if ${MK_MAIL} != "no"
80 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
87 .if ${MK_OPENSSH} != "no"
88 SSH= ${SRCTOP}/crypto/openssh/ssh_config \
89 ${SRCTOP}/crypto/openssh/sshd_config \
90 ${SRCTOP}/crypto/openssh/moduli
92 .if ${MK_OPENSSL} != "no"
93 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
96 .if ${MK_SENDMAIL} != "no"
100 .if ${MK_TCSH} != "no"
101 BIN1+= csh.cshrc csh.login csh.logout
104 .if ${MK_WIRELESS} != "no"
108 .if ${MK_SENDMAIL} == "no"
109 ETCMAIL=mailer.conf aliases
111 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
112 mailertable.sample aliases
115 # Special top level files for FreeBSD
119 DESTDIR:= ${DESTDIR:C://*:/:g}
122 .if ${MK_MAN} != "no"
123 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
127 # Avoid installing tests here; "make distribution" will do this and
128 # correctly place them in the right location.
129 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
130 DESTDIR=${DISTDIR}/${DISTRIBUTION}
131 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
133 .include <bsd.endian.mk>
136 METALOG.add?= cat -l >> ${METALOG}
140 .if !defined(DESTDIR)
141 @echo "set DESTDIR before running \"make ${.TARGET}\""
145 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
146 ${BIN1} ${DESTDIR}/etc; \
147 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
148 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
149 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
151 .if ${MK_SERVICESDB} != "no"
153 services_mkdb ${CAP_MKDB_ENDIAN} -q -o ${DESTDIR}/var/db/services.db \
154 ${DESTDIR}/etc/services;
157 .if ${MK_TCSH} == "no"
158 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
160 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
163 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
164 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
165 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
166 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
167 echo "./var/db/services.db type=file mode=0644 uname=root gname=wheel"; \
170 .if ${MK_BLUETOOTH} != "no"
171 ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install
173 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
174 ${_+_}cd ${.CURDIR}/devd; ${MAKE} install
175 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
176 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
177 ${_+_}cd ${.CURDIR}/newsyslog.conf.d; ${MAKE} install
178 .if ${MK_NTP} != "no"
179 ${_+_}cd ${.CURDIR}/ntp; ${MAKE} install
181 ${_+_}cd ${.CURDIR}/periodic; ${MAKE} install
182 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
183 ${_+_}cd ${.CURDIR}/syslog.d; ${MAKE} install
184 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
185 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
186 .if ${MK_UNBOUND} != "no"
187 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
188 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
191 .if ${MK_SENDMAIL} != "no"
192 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
194 .if ${MK_OPENSSH} != "no"
195 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
196 ${SSH} ${DESTDIR}/etc/ssh
198 .if ${MK_OPENSSL} != "no"
199 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
200 ${SSL} ${DESTDIR}/etc/ssl
202 .if ${MK_KERBEROS} != "no"
203 cd ${.CURDIR}/root; \
204 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
205 dot.k5login ${DESTDIR}/root/.k5login;
207 cd ${.CURDIR}/root; \
208 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
209 dot.profile ${DESTDIR}/root/.profile; \
210 rm -f ${DESTDIR}/.profile; \
211 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
212 .if ${MK_TCSH} != "no"
213 cd ${.CURDIR}/root; \
214 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
215 dot.cshrc ${DESTDIR}/root/.cshrc; \
216 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
217 dot.login ${DESTDIR}/root/.login; \
218 rm -f ${DESTDIR}/.cshrc; \
219 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
221 .if ${MK_MAIL} != "no"
222 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
223 ${ETCMAIL} ${DESTDIR}/etc/mail
224 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
225 ! -f ${DESTDIR}/etc/aliases ]; then \
226 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
229 .if ${MK_LOCATE} != "no"
230 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
231 ${DESTDIR}/var/db/locate.database
233 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
234 ${FREEBSD} ${DESTDIR}/
235 .if ${MK_BOOT} != "no"
236 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
237 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
238 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
239 ${DESTDIR}/boot/device.hints
242 .if ${MK_NIS} == "no"
243 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
244 ${DESTDIR}/etc/nsswitch.conf
249 MTREES= mtree/BSD.root.dist / \
250 mtree/BSD.var.dist /var \
251 mtree/BSD.usr.dist /usr \
252 mtree/BSD.include.dist /usr/include \
253 mtree/BSD.debug.dist /usr/lib
254 .if ${MK_LIB32} != "no"
255 MTREES+= mtree/BSD.lib32.dist /usr
256 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
258 .if ${MK_LIBSOFT} != "no"
259 MTREES+= mtree/BSD.libsoft.dist /usr
260 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
262 .if ${MK_TESTS} != "no"
263 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
264 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
266 .if ${MK_SENDMAIL} != "no"
267 MTREES+= mtree/BSD.sendmail.dist /
269 .for mtree in ${LOCAL_MTREE}
270 MTREES+= ../${mtree} /
273 # Clean up some directories that where mistakenly created as files that
274 # should not have been as part of the nvi update in r281994.
275 # This should be removed after 11.0-RELEASE.
276 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
277 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
278 distrib-cleanup: .PHONY
279 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
280 if [ -f ${DESTDIR}/$${file} ]; then \
281 rm -f ${DESTDIR}/$${file}; \
285 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
287 while test $$# -ge 2; do \
292 test -d $$d || mkdir -p $$d; \
293 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
294 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
295 ${MTREE_FILTER} $$m | \
296 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
301 while test $$# -ge 2; do \
305 test "$$d" == "/" && d=""; \
308 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
309 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
310 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
311 ${MTREE_FILTER} $$m | \
312 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
316 .if ${MK_NLS} != "no"
317 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
318 while [ $$# -gt 0 ] ; do \
319 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
324 etc-examples-install: ${META_DEPS}
325 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
326 ${BIN1} ${BIN2} nsmb.conf opieaccess \
327 ${DESTDIR}${SHAREDIR}/examples/etc
329 etc-examples: etc-examples-install
330 ${_+_}cd ${.CURDIR}/defaults; \
331 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
332 DESTDIR=${DESTDIR}${SHAREDIR}/examples
334 .include <bsd.prog.mk>
336 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
337 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
338 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
339 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
340 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
341 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
344 .if !defined(NO_FSCHG)