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"
22 # NB: keep these sorted by MK_* knobs
24 .if ${MK_SENDMAIL} != "no"
28 .if ${MK_SENDMAIL} == "no"
29 ETCMAIL=mailer.conf aliases
31 ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \
32 mailertable.sample aliases
35 # Special top level files for FreeBSD
39 DESTDIR:= ${DESTDIR:C://*:/:g}
43 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
47 # Avoid installing tests here; "make distribution" will do this and
48 # correctly place them in the right location.
49 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
50 DESTDIR=${DISTDIR}/${DISTRIBUTION}
51 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
53 .include <bsd.endian.mk>
56 METALOG.add?= cat -l >> ${METALOG}
61 @echo "set DESTDIR before running \"make ${.TARGET}\""
65 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
66 ${BIN1} ${DESTDIR}/etc; \
67 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
68 master.passwd ${DESTDIR}/etc;
70 .if ${MK_TCSH} == "no"
71 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
73 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
76 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
77 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
78 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
81 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
82 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
83 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
84 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
85 .if ${MK_UNBOUND} != "no"
86 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
87 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
90 .if ${MK_SENDMAIL} != "no"
91 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
93 .if ${MK_KERBEROS} != "no"
95 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
96 dot.k5login ${DESTDIR}/root/.k5login;
99 .if ${MK_MAIL} != "no"
100 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
101 ${ETCMAIL} ${DESTDIR}/etc/mail
102 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
103 ! -f ${DESTDIR}/etc/aliases ]; then \
104 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
107 .if ${MK_LOCATE} != "no"
108 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
109 ${DESTDIR}/var/db/locate.database
111 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
112 ${FREEBSD} ${DESTDIR}/
113 .if ${MK_BOOT} != "no"
114 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
115 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
116 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
117 ${DESTDIR}/boot/device.hints
123 MTREES= mtree/BSD.root.dist / \
124 mtree/BSD.var.dist /var \
125 mtree/BSD.usr.dist /usr \
126 mtree/BSD.include.dist /usr/include \
127 mtree/BSD.debug.dist /usr/lib
128 .if ${MK_LIB32} != "no"
129 MTREES+= mtree/BSD.lib32.dist /usr
130 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
132 .if ${MK_LIBSOFT} != "no"
133 MTREES+= mtree/BSD.libsoft.dist /usr
134 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
136 .if ${MK_TESTS} != "no"
137 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
138 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
140 .if ${MK_SENDMAIL} != "no"
141 MTREES+= mtree/BSD.sendmail.dist /
143 .for mtree in ${LOCAL_MTREE}
144 MTREES+= ../${mtree} /
147 # Clean up some directories that where mistakenly created as files that
148 # should not have been as part of the nvi update in r281994.
149 # This should be removed after 11.0-RELEASE.
150 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
151 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
152 distrib-cleanup: .PHONY
153 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
154 if [ -f ${DESTDIR}/$${file} ]; then \
155 rm -f ${DESTDIR}/$${file}; \
159 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
161 while test $$# -ge 2; do \
166 test -d $$d || mkdir -p $$d; \
167 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
168 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
169 ${MTREE_FILTER} $$m | \
170 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
175 while test $$# -ge 2; do \
179 test "$$d" == "/" && d=""; \
182 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
183 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
184 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
185 ${MTREE_FILTER} $$m | \
186 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
190 .if ${MK_NLS} != "no"
191 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
192 while [ $$# -gt 0 ] ; do \
193 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
198 etc-examples: ${META_DEPS}
199 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
201 ${DESTDIR}${SHAREDIR}/examples/etc
203 .include <bsd.prog.mk>
205 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
206 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
207 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
208 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
209 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
210 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
213 .if !defined(NO_FSCHG)