1 # from: @(#)Makefile 5.11 (Berkeley) 5/21/91
4 .include <src.tools.mk>
10 # No need as it is empty and just causes rebuilds since this file does so much.
13 .if ${MK_SENDMAIL} != "no"
17 # NB: keep these sorted by MK_* knobs
20 .if ${MK_SENDMAIL} != "no"
21 ETCMAIL+=Makefile README access.sample virtusertable.sample \
25 # Special top level files for FreeBSD
29 DESTDIR:= ${DESTDIR:C://*:/:g}
33 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb
37 # Avoid installing tests here; "make distribution" will do this and
38 # correctly place them in the right location.
39 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \
40 DESTDIR=${DISTDIR}/${DISTRIBUTION}
41 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION}
43 .include <bsd.endian.mk>
46 METALOG.add?= cat -l >> ${METALOG}
51 @echo "set DESTDIR before running \"make ${.TARGET}\""
54 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install
55 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install
56 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap
57 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt
58 ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \
59 ${DESTDIR}/etc/os-release
60 .if ${MK_UNBOUND} != "no"
61 if [ ! -e ${DESTDIR}/etc/unbound ]; then \
62 ${INSTALL_SYMLINK} -T "package=unbound" \
63 ../var/unbound ${DESTDIR}/etc/unbound; \
66 .if ${MK_SENDMAIL} != "no"
67 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution
69 .if ${MK_KERBEROS} != "no"
71 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
72 -T "package=runtime" \
73 dot.k5login ${DESTDIR}/root/.k5login;
76 .if ${MK_MAIL} != "no"
77 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
78 -T "package=sendmail" ${ETCMAIL} ${DESTDIR}/etc/mail
79 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \
80 ! -f ${DESTDIR}/etc/aliases ]; then \
81 ${INSTALL_SYMLINK} -T "package=sendmail" \
82 mail/aliases ${DESTDIR}/etc/aliases; \
85 .if ${MK_LOCATE} != "no"
86 ${INSTALL} -o nobody -g ${BINGRP} -m 644 -T "package=runtime"\
87 /dev/null ${DESTDIR}/var/db/locate.database
89 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
90 -T "package=runtime" ${FREEBSD} ${DESTDIR}/
91 .if ${MK_BOOT} != "no"
92 .if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints)
93 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
94 -T "package=bootloader,config" \
95 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \
96 ${DESTDIR}/boot/device.hints
100 MTREES= mtree/BSD.root.dist / \
101 mtree/BSD.var.dist /var \
102 mtree/BSD.usr.dist /usr \
103 mtree/BSD.include.dist /usr/include \
104 mtree/BSD.debug.dist /usr/lib
105 .if ${MK_LIB32} != "no"
106 MTREES+= mtree/BSD.lib32.dist /usr
107 MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr
109 .if ${MK_LIBSOFT} != "no"
110 MTREES+= mtree/BSD.libsoft.dist /usr
111 MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr
113 .if ${MK_TESTS} != "no"
114 MTREES+= mtree/BSD.tests.dist ${TESTSBASE}
115 MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE}
117 .if ${MK_SENDMAIL} != "no"
118 MTREES+= mtree/BSD.sendmail.dist /
120 .for mtree in ${LOCAL_MTREE}
121 MTREES+= ../${mtree} /
124 # Clean up files that have changed into directories, as mtree cannot handle this
126 DISTRIB_CLEANUP_FILES+= ${INCLUDEDIR}/c++/v1/__string
127 distrib-cleanup: .PHONY
128 for file in ${DISTRIB_CLEANUP_FILES}; do \
129 if [ -f ${DESTDIR}/$${file} ]; then \
130 rm -f ${DESTDIR}/$${file}; \
134 distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY
135 .for _m _d in ${MTREES}
136 @m=${.CURDIR}/${_m}; \
138 test -d $$d || mkdir -p $$d; \
139 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \
140 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \
141 ${MTREE_FILTER} $$m | \
142 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \
146 .for _m _d in ${MTREES}
147 @m=${.CURDIR}/${_m}; \
149 test "$$d" == "/" && d=""; \
151 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \
152 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \
153 "sed s#^\.#.$$d# | ${METALOG.add}" ; \
154 ${MTREE_FILTER} $$m | \
155 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \
159 .if ${MK_NLS} != "no"
160 .for alias nls in ${NLS_ALIASES}
161 ${INSTALL_SYMLINK} -T "package=utilities" \
162 "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}"
166 .include <bsd.prog.mk>
168 .if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0
169 MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \
170 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \
171 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \
172 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \
173 -e 's,\(gid=\)[^ ]*$$,\1${_gid},'
176 .if !defined(NO_FSCHG)