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"
41 .if exists(${.CURDIR}/etc.${MACHINE}/ttys)
42 BIN1+= etc.${MACHINE}/ttys
43 .elif exists(${.CURDIR}/etc.${MACHINE_ARCH}/ttys)
44 BIN1+= etc.${MACHINE_ARCH}/ttys
45 .elif exists(${.CURDIR}/etc.${MACHINE_CPUARCH}/ttys)
46 BIN1+= etc.${MACHINE_CPUARCH}/ttys
48 .error etc.MACHINE/ttys missing
51 # NB: keep these sorted by MK_* knobs
57 .if ${MK_LOCATE} != "no"
58 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
62 BIN1+= hosts.lpd printcap
65 .if ${MK_MAIL} != "no"
66 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
69 .if ${MK_OPENSSL} != "no"
70 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
73 .if ${MK_SENDMAIL} != "no"
77 .if ${MK_WIRELESS} != "no"
81 .if ${MK_SENDMAIL} == "no"
82 ETCMAIL=mailer.conf aliases
84 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
85 mailertable.sample aliases
88 # Special top level files for FreeBSD
92 DESTDIR:= ${DESTDIR:C://*:/:g}
96 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
100 # Avoid installing tests here; "make distribution" will do this and
101 # correctly place them in the right location.
102 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
103 DESTDIR=${DISTDIR}/${DISTRIBUTION}
104 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
106 .include <bsd.endian.mk>
109 METALOG.add?= cat -l >> ${METALOG}
113 .if !defined(DESTDIR)
114 @echo "set DESTDIR before running \"make ${.TARGET}\""
118 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
119 ${BIN1} ${DESTDIR}/etc; \
120 cap_mkdb ${CAP_MKDB_ENDIAN} ${DESTDIR}/etc/login.conf; \
121 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
122 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
124 .if ${MK_TCSH} == "no"
125 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
127 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
130 echo "./etc/login.conf.db type=file mode=0644 uname=root gname=wheel"; \
131 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
132 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
133 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
136 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
137 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
138 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
139 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
140 ${_+_}cd ${.CURDIR}/pam.d; ${MAKE} install
141 .if ${MK_UNBOUND} != "no"
142 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
143 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
146 .if ${MK_SENDMAIL} != "no"
147 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
149 .if ${MK_OPENSSL} != "no"
150 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
151 ${SSL} ${DESTDIR}/etc/ssl
153 .if ${MK_KERBEROS} != "no"
154 cd ${.CURDIR}/root; \
155 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
156 dot.k5login ${DESTDIR}/root/.k5login;
158 cd ${.CURDIR}/root; \
159 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
160 dot.profile ${DESTDIR}/root/.profile; \
161 rm -f ${DESTDIR}/.profile; \
162 ${INSTALL_LINK} ${DESTDIR}/root/.profile ${DESTDIR}/.profile
163 .if ${MK_TCSH} != "no"
164 cd ${.CURDIR}/root; \
165 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
166 dot.cshrc ${DESTDIR}/root/.cshrc; \
167 rm -f ${DESTDIR}/.cshrc; \
168 ${INSTALL_LINK} ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc
171 .if ${MK_MAIL} != "no"
172 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
173 ${ETCMAIL} ${DESTDIR}/etc/mail
174 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
175 ! -f ${DESTDIR}/etc/aliases ]; then \
176 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
179 .if ${MK_LOCATE} != "no"
180 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
181 ${DESTDIR}/var/db/locate.database
183 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
184 ${FREEBSD} ${DESTDIR}/
185 .if ${MK_BOOT} != "no"
186 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
187 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
188 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
189 ${DESTDIR}/boot/device.hints
192 .if ${MK_NIS} == "no"
193 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
194 ${DESTDIR}/etc/nsswitch.conf
199 MTREES= mtree/BSD.root.dist / \
200 mtree/BSD.var.dist /var \
201 mtree/BSD.usr.dist /usr \
202 mtree/BSD.include.dist /usr/include \
203 mtree/BSD.debug.dist /usr/lib
204 .if ${MK_LIB32} != "no"
205 MTREES+= mtree/BSD.lib32.dist /usr
206 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
208 .if ${MK_LIBSOFT} != "no"
209 MTREES+= mtree/BSD.libsoft.dist /usr
210 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
212 .if ${MK_TESTS} != "no"
213 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
214 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
216 .if ${MK_SENDMAIL} != "no"
217 MTREES+= mtree/BSD.sendmail.dist /
219 .for mtree in ${LOCAL_MTREE}
220 MTREES+= ../${mtree} /
223 # Clean up some directories that where mistakenly created as files that
224 # should not have been as part of the nvi update in r281994.
225 # This should be removed after 11.0-RELEASE.
226 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
227 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
228 distrib-cleanup: .PHONY
229 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
230 if [ -f ${DESTDIR}/$${file} ]; then \
231 rm -f ${DESTDIR}/$${file}; \
235 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
237 while test $$# -ge 2; do \
242 test -d $$d || mkdir -p $$d; \
243 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
244 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
245 ${MTREE_FILTER} $$m | \
246 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
251 while test $$# -ge 2; do \
255 test "$$d" == "/" && d=""; \
258 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
259 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
260 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
261 ${MTREE_FILTER} $$m | \
262 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
266 .if ${MK_NLS} != "no"
267 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
268 while [ $$# -gt 0 ] ; do \
269 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
274 etc-examples: ${META_DEPS}
275 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
276 ${BIN1} ${BIN2} nsmb.conf opieaccess \
277 ${DESTDIR}${SHAREDIR}/examples/etc
279 .include <bsd.prog.mk>
281 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
282 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
283 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
284 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
285 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
286 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
289 .if !defined(NO_FSCHG)