1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
5 .include <src.tools.mk>
11 # No need as it is empty and just causes rebuilds since this file does so much.
14 .if ${MK_SENDMAIL} != "no"
18 # NB: keep these sorted by MK_* knobs
21 .if ${MK_SENDMAIL} != "no"
22 ETCMAIL+=Makefile README access.sample virtusertable.sample \
26 # Special top level files for FreeBSD
30 DESTDIR:= ${DESTDIR:C://*:/:g}
34 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
38 # Avoid installing tests here; "make distribution" will do this and
39 # correctly place them in the right location.
40 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
41 DESTDIR=${DISTDIR}/${DISTRIBUTION}
42 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
44 .include <bsd.endian.mk>
47 METALOG.add?= cat -l >> ${METALOG}
52 @echo "set DESTDIR before running \"make ${.TARGET}\""
55 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
56 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
57 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
58 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
59 ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \
60 ${DESTDIR}/etc/os-release
61 .if ${MK_UNBOUND} != "no"
62 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
63 ${INSTALL_SYMLINK} -T "package=unbound" \
64 ../var/unbound ${DESTDIR}/etc/unbound; \
67 .if ${MK_SENDMAIL} != "no"
68 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
70 .if ${MK_KERBEROS} != "no"
72 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
73 -T "package=runtime" \
74 dot.k5login ${DESTDIR}/root/.k5login;
77 .if ${MK_MAIL} != "no"
78 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
79 -T "package=runtime" ${ETCMAIL} ${DESTDIR}/etc/mail
80 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
81 ! -f ${DESTDIR}/etc/aliases ]; then \
82 ${INSTALL_SYMLINK} -T "package=runtime" \
83 mail/aliases ${DESTDIR}/etc/aliases; \
86 .if ${MK_LOCATE} != "no"
87 ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\
88 /dev/null ${DESTDIR}/var/db/locate.database
90 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
91 -T "package=runtime" ${FREEBSD} ${DESTDIR}/
92 .if ${MK_BOOT} != "no"
93 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
94 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
95 -T "package=bootloader,config" \
96 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
97 ${DESTDIR}/boot/device.hints
101 MTREES= mtree/BSD.root.dist / \
102 mtree/BSD.var.dist /var \
103 mtree/BSD.usr.dist /usr \
104 mtree/BSD.include.dist /usr/include \
105 mtree/BSD.debug.dist /usr/lib
106 .if ${MK_LIB32} != "no"
107 MTREES+= mtree/BSD.lib32.dist /usr
108 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
110 .if ${MK_LIBSOFT} != "no"
111 MTREES+= mtree/BSD.libsoft.dist /usr
112 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
114 .if ${MK_TESTS} != "no"
115 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
116 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
118 .if ${MK_SENDMAIL} != "no"
119 MTREES+= mtree/BSD.sendmail.dist /
121 .for mtree in ${LOCAL_MTREE}
122 MTREES+= ../${mtree} /
125 # Clean up some directories that where mistakenly created as files that
126 # should not have been as part of the nvi update in r281994.
127 # This should be removed after 11.0-RELEASE.
128 DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit
129 DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref
130 distrib-cleanup: .PHONY
131 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \
132 if [ -f ${DESTDIR}/$${file} ]; then \
133 rm -f ${DESTDIR}/$${file}; \
137 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
138 .for _m _d in ${MTREES}
139 @m=${.CURDIR}/${_m}; \
141 test -d $$d || mkdir -p $$d; \
142 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
143 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
144 ${MTREE_FILTER} $$m | \
145 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
149 .for _m _d in ${MTREES}
150 @m=${.CURDIR}/${_m}; \
152 test "$$d" == "/" && d=""; \
154 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
155 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
156 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
157 ${MTREE_FILTER} $$m | \
158 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
162 .if ${MK_NLS} != "no"
163 .for alias nls in ${NLS_ALIASES}
164 ${INSTALL_SYMLINK} -T "package=utilities" \
165 "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}"
169 .include <bsd.prog.mk>
171 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
172 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
173 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
174 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
175 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
176 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
179 .if !defined(NO_FSCHG)