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"
29 .if ${MK_SENDMAIL} != "no"
30 ETCMAIL+=Makefile README access.sample virtusertable.sample \
34 # Special top level files for FreeBSD
38 DESTDIR:= ${DESTDIR:C://*:/:g}
42 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
46 # Avoid installing tests here; "make distribution" will do this and
47 # correctly place them in the right location.
48 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
49 DESTDIR=${DISTDIR}/${DISTRIBUTION}
50 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
52 .include <bsd.endian.mk>
55 METALOG.add?= cat -l >> ${METALOG}
60 @echo "set DESTDIR before running \"make ${.TARGET}\""
64 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
65 ${BIN1} ${DESTDIR}/etc; \
66 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 600 \
67 master.passwd ${DESTDIR}/etc;
69 .if ${MK_TCSH} == "no"
70 sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
72 pwd_mkdb -i -p -d ${DESTDIR}/etc ${DESTDIR}/etc/master.passwd
75 echo "./etc/passwd type=file mode=0644 uname=root gname=wheel"; \
76 echo "./etc/pwd.db type=file mode=0644 uname=root gname=wheel"; \
77 echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \
80 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
81 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
82 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
83 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
84 ${INSTALL_SYMLINK} ../var/run/os-release \
85 ${DESTDIR}/etc/os-release
86 .if ${MK_UNBOUND} != "no"
87 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
88 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \
91 .if ${MK_SENDMAIL} != "no"
92 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
94 .if ${MK_KERBEROS} != "no"
96 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
97 dot.k5login ${DESTDIR}/root/.k5login;
100 .if ${MK_MAIL} != "no"
101 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
102 ${ETCMAIL} ${DESTDIR}/etc/mail
103 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
104 ! -f ${DESTDIR}/etc/aliases ]; then \
105 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \
108 .if ${MK_LOCATE} != "no"
109 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \
110 ${DESTDIR}/var/db/locate.database
112 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
113 ${FREEBSD} ${DESTDIR}/
114 .if ${MK_BOOT} != "no"
115 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
116 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
117 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
118 ${DESTDIR}/boot/device.hints
124 MTREES= mtree/BSD.root.dist / \
125 mtree/BSD.var.dist /var \
126 mtree/BSD.usr.dist /usr \
127 mtree/BSD.include.dist /usr/include \
128 mtree/BSD.debug.dist /usr/lib
129 .if ${MK_LIB32} != "no"
130 MTREES+= mtree/BSD.lib32.dist /usr
131 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
133 .if ${MK_LIBSOFT} != "no"
134 MTREES+= mtree/BSD.libsoft.dist /usr
135 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
137 .if ${MK_TESTS} != "no"
138 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
139 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
141 .if ${MK_SENDMAIL} != "no"
142 MTREES+= mtree/BSD.sendmail.dist /
144 .for mtree in ${LOCAL_MTREE}
145 MTREES+= ../${mtree} /
148 # Clean up some directories that where mistakenly created as files that
149 # should not have been as part of the nvi update in r281994.
150 # This should be removed after 11.0-RELEASE.
151 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
152 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
153 distrib-cleanup: .PHONY
154 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
155 if [ -f ${DESTDIR}/$${file} ]; then \
156 rm -f ${DESTDIR}/$${file}; \
160 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
162 while test $$# -ge 2; do \
167 test -d $$d || mkdir -p $$d; \
168 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
169 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
170 ${MTREE_FILTER} $$m | \
171 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
176 while test $$# -ge 2; do \
180 test "$$d" == "/" && d=""; \
183 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
184 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
185 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
186 ${MTREE_FILTER} $$m | \
187 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
191 .if ${MK_NLS} != "no"
192 set - `grep "^[a-zA-Z]" ${.CURDIR}/nls.alias`; \
193 while [ $$# -gt 0 ] ; do \
194 ${INSTALL_SYMLINK} "$$2" "${DESTDIR}${SHAREDIR}/nls/$$1"; \
199 etc-examples: ${META_DEPS}
200 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \
202 ${DESTDIR}${SHAREDIR}/examples/etc
204 .include <bsd.prog.mk>
206 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
207 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
208 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
209 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
210 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
211 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
214 .if !defined(NO_FSCHG)