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 ${_+_}cd ${.CURDIR}/defaults; ${MAKE} install
146 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
147 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
148 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
149 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
150 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
151 .if ${MK_UNBOUND} != "no"
152 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
153 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
156 .if ${MK_SENDMAIL} != "no"
157 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
159 .if ${MK_OPENSSL} != "no"
160 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
161 ${SSL} ${DESTDIR}/etc/ssl
163 .if ${MK_KERBEROS} != "no"
164 cd ${.CURDIR}/root; \
165 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
166 dot.k5login ${DESTDIR}/root/.k5login;
168 cd ${.CURDIR}/root; \
169 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
170 dot.profile ${DESTDIR}/root/.profile; \
171 rm -f ${DESTDIR}/.profile; \
172 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
173 .if ${MK_TCSH} != "no"
174 cd ${.CURDIR}/root; \
175 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
176 dot.cshrc ${DESTDIR}/root/.cshrc; \
177 rm -f ${DESTDIR}/.cshrc; \
178 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
181 .if ${MK_MAIL} != "no"
182 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
183 ${ETCMAIL} ${DESTDIR}/etc/mail
184 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
185 ! -f ${DESTDIR}/etc/aliases ]; then \
186 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
189 .if ${MK_LOCATE} != "no"
190 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
191 ${DESTDIR}/var/db/locate.database
193 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
194 ${FREEBSD} ${DESTDIR}/
195 .if ${MK_BOOT} != "no"
196 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
197 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
198 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
199 ${DESTDIR}/boot/device.hints
202 .if ${MK_NIS} == "no"
203 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
204 ${DESTDIR}/etc/nsswitch.conf
209 MTREES= mtree/BSD.root.dist / \
210 mtree/BSD.var.dist /var \
211 mtree/BSD.usr.dist /usr \
212 mtree/BSD.include.dist /usr/include \
213 mtree/BSD.debug.dist /usr/lib
214 .if ${MK_LIB32} != "no"
215 MTREES+= mtree/BSD.lib32.dist /usr
216 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
218 .if ${MK_LIBSOFT} != "no"
219 MTREES+= mtree/BSD.libsoft.dist /usr
220 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
222 .if ${MK_TESTS} != "no"
223 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
224 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
226 .if ${MK_SENDMAIL} != "no"
227 MTREES+= mtree/BSD.sendmail.dist /
229 .for mtree in ${LOCAL_MTREE}
230 MTREES+= ../${mtree} /
233 # Clean up some directories that where mistakenly created as files that
234 # should not have been as part of the nvi update in r281994.
235 # This should be removed after 11.0-RELEASE.
236 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
237 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
238 distrib-cleanup: .PHONY
239 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
240 if [ -f ${DESTDIR}/$${file} ]; then \
241 rm -f ${DESTDIR}/$${file}; \
245 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
247 while test $$# -ge 2; do \
252 test -d $$d || mkdir -p $$d; \
253 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
254 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
255 ${MTREE_FILTER} $$m | \
256 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
261 while test $$# -ge 2; do \
265 test "$$d" == "/" && d=""; \
268 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
269 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
270 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
271 ${MTREE_FILTER} $$m | \
272 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
276 .if ${MK_NLS} != "no"
277 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
278 while [ $$# -gt 0 ] ; do \
279 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
284 etc-examples-install: ${META_DEPS}
285 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
286 ${BIN1} ${BIN2} nsmb.conf opieaccess \
287 ${DESTDIR}${SHAREDIR}/examples/etc
289 etc-examples: etc-examples-install
290 ${_+_}cd ${.CURDIR}/defaults; \
291 ${MAKE} ${${MK_STAGING} == "yes":?all:install} \
292 DESTDIR=${DESTDIR}${SHAREDIR}/examples
294 .include <bsd.prog.mk>
296 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
297 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
298 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
299 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
300 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
301 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
304 .if !defined(NO_FSCHG)