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"
37 # NB: keep these sorted by MK_* knobs
43 .if ${MK_LOCATE} != "no"
44 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
48 BIN1+= hosts.lpd printcap
51 .if ${MK_MAIL} != "no"
52 BIN1+= ${SRCTOP}/usr.bin/mail/misc/mail.rc
55 .if ${MK_OPENSSL} != "no"
56 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
59 .if ${MK_SENDMAIL} != "no"
63 .if ${MK_WIRELESS} != "no"
67 .if ${MK_SENDMAIL} == "no"
68 ETCMAIL=mailer.conf aliases
70 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
71 mailertable.sample aliases
74 # Special top level files for FreeBSD
78 DESTDIR:= ${DESTDIR:C://*:/:g}
82 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
86 # Avoid installing tests here; "make distribution" will do this and
87 # correctly place them in the right location.
88 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
89 DESTDIR=${DISTDIR}/${DISTRIBUTION}
90 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
92 .include <bsd.endian.mk>
95 METALOG.add?= cat -l >> ${METALOG}
100 @echo "set DESTDIR before running \"make ${.TARGET}\""
104 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
105 ${BIN1} ${DESTDIR}/etc; \
106 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
107 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
109 .if ${MK_TCSH} == "no"
110 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
112 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
115 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
116 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
117 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
120 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
121 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
122 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
123 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
124 .if ${MK_UNBOUND} != "no"
125 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
126 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
129 .if ${MK_SENDMAIL} != "no"
130 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
132 .if ${MK_OPENSSL} != "no"
133 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
134 ${SSL} ${DESTDIR}/etc/ssl
136 .if ${MK_KERBEROS} != "no"
137 cd ${.CURDIR}/root; \
138 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
139 dot.k5login ${DESTDIR}/root/.k5login;
142 .if ${MK_MAIL} != "no"
143 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
144 ${ETCMAIL} ${DESTDIR}/etc/mail
145 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
146 ! -f ${DESTDIR}/etc/aliases ]; then \
147 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
150 .if ${MK_LOCATE} != "no"
151 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
152 ${DESTDIR}/var/db/locate.database
154 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
155 ${FREEBSD} ${DESTDIR}/
156 .if ${MK_BOOT} != "no"
157 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
158 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
159 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
160 ${DESTDIR}/boot/device.hints
163 .if ${MK_NIS} == "no"
164 sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
165 ${DESTDIR}/etc/nsswitch.conf
170 MTREES= mtree/BSD.root.dist / \
171 mtree/BSD.var.dist /var \
172 mtree/BSD.usr.dist /usr \
173 mtree/BSD.include.dist /usr/include \
174 mtree/BSD.debug.dist /usr/lib
175 .if ${MK_LIB32} != "no"
176 MTREES+= mtree/BSD.lib32.dist /usr
177 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
179 .if ${MK_LIBSOFT} != "no"
180 MTREES+= mtree/BSD.libsoft.dist /usr
181 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
183 .if ${MK_TESTS} != "no"
184 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
185 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
187 .if ${MK_SENDMAIL} != "no"
188 MTREES+= mtree/BSD.sendmail.dist /
190 .for mtree in ${LOCAL_MTREE}
191 MTREES+= ../${mtree} /
194 # Clean up some directories that where mistakenly created as files that
195 # should not have been as part of the nvi update in r281994.
196 # This should be removed after 11.0-RELEASE.
197 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
198 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
199 distrib-cleanup: .PHONY
200 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
201 if [ -f ${DESTDIR}/$${file} ]; then \
202 rm -f ${DESTDIR}/$${file}; \
206 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
208 while test $$# -ge 2; do \
213 test -d $$d || mkdir -p $$d; \
214 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
215 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
216 ${MTREE_FILTER} $$m | \
217 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
222 while test $$# -ge 2; do \
226 test "$$d" == "/" && d=""; \
229 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
230 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
231 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
232 ${MTREE_FILTER} $$m | \
233 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
237 .if ${MK_NLS} != "no"
238 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
239 while [ $$# -gt 0 ] ; do \
240 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
245 etc-examples: ${META_DEPS}
246 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
247 ${BIN1} ${BIN2} nsmb.conf opieaccess \
248 ${DESTDIR}${SHAREDIR}/examples/etc
250 .include <bsd.prog.mk>
252 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
253 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
254 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
255 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
256 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
257 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
260 .if !defined(NO_FSCHG)