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"
27 # NB: keep these sorted by MK_* knobs
29 .if ${MK_LOCATE} != "no"
30 BIN1+= ${SRCTOP}/usr.bin/locate/locate/locate.rc
34 BIN1+= hosts.lpd printcap
37 .if ${MK_OPENSSL} != "no"
38 SSL= ${SRCTOP}/crypto/openssl/apps/openssl.cnf
41 .if ${MK_SENDMAIL} != "no"
45 .if ${MK_WIRELESS} != "no"
49 .if ${MK_SENDMAIL} == "no"
50 ETCMAIL=mailer.conf aliases
52 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
53 mailertable.sample aliases
56 # Special top level files for FreeBSD
60 DESTDIR:= ${DESTDIR:C://*:/:g}
64 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
68 # Avoid installing tests here; "make distribution" will do this and
69 # correctly place them in the right location.
70 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
71 DESTDIR=${DISTDIR}/${DISTRIBUTION}
72 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
74 .include <bsd.endian.mk>
77 METALOG.add?= cat -l >> ${METALOG}
82 @echo "set DESTDIR before running \"make ${.TARGET}\""
86 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
87 ${BIN1} ${DESTDIR}/etc; \
88 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
89 master.passwd nsmb.conf opieaccess ${DESTDIR}/etc;
91 .if ${MK_TCSH} == "no"
92 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
94 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
97 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
98 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
99 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
102 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
103 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
104 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
105 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
106 .if ${MK_UNBOUND} != "no"
107 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
108 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
111 .if ${MK_SENDMAIL} != "no"
112 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
114 .if ${MK_OPENSSL} != "no"
115 cd ${.CURDIR}; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
116 ${SSL} ${DESTDIR}/etc/ssl
118 .if ${MK_KERBEROS} != "no"
119 cd ${.CURDIR}/root; \
120 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
121 dot.k5login ${DESTDIR}/root/.k5login;
124 .if ${MK_MAIL} != "no"
125 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
126 ${ETCMAIL} ${DESTDIR}/etc/mail
127 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
128 ! -f ${DESTDIR}/etc/aliases ]; then \
129 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
132 .if ${MK_LOCATE} != "no"
133 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
134 ${DESTDIR}/var/db/locate.database
136 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
137 ${FREEBSD} ${DESTDIR}/
138 .if ${MK_BOOT} != "no"
139 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
140 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
141 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
142 ${DESTDIR}/boot/device.hints
148 MTREES= mtree/BSD.root.dist / \
149 mtree/BSD.var.dist /var \
150 mtree/BSD.usr.dist /usr \
151 mtree/BSD.include.dist /usr/include \
152 mtree/BSD.debug.dist /usr/lib
153 .if ${MK_LIB32} != "no"
154 MTREES+= mtree/BSD.lib32.dist /usr
155 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
157 .if ${MK_LIBSOFT} != "no"
158 MTREES+= mtree/BSD.libsoft.dist /usr
159 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
161 .if ${MK_TESTS} != "no"
162 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
163 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
165 .if ${MK_SENDMAIL} != "no"
166 MTREES+= mtree/BSD.sendmail.dist /
168 .for mtree in ${LOCAL_MTREE}
169 MTREES+= ../${mtree} /
172 # Clean up some directories that where mistakenly created as files that
173 # should not have been as part of the nvi update in r281994.
174 # This should be removed after 11.0-RELEASE.
175 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
176 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
177 distrib-cleanup: .PHONY
178 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
179 if [ -f ${DESTDIR}/$${file} ]; then \
180 rm -f ${DESTDIR}/$${file}; \
184 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
186 while test $$# -ge 2; do \
191 test -d $$d || mkdir -p $$d; \
192 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
193 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
194 ${MTREE_FILTER} $$m | \
195 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
200 while test $$# -ge 2; do \
204 test "$$d" == "/" && d=""; \
207 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
208 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
209 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
210 ${MTREE_FILTER} $$m | \
211 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
215 .if ${MK_NLS} != "no"
216 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
217 while [ $$# -gt 0 ] ; do \
218 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
223 etc-examples: ${META_DEPS}
224 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
225 ${BIN1} ${BIN2} nsmb.conf opieaccess \
226 ${DESTDIR}${SHAREDIR}/examples/etc
228 .include <bsd.prog.mk>
230 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
231 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
232 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
233 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
234 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
235 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
238 .if !defined(NO_FSCHG)