1# from: @(#)Makefile 5.11 (Berkeley) 5/21/91 2# $FreeBSD$ 3 4.include <src.opts.mk> 5 6FILESGROUPS= FILES 7NLS_ALIASES= POSIX C \ 8 en_US.US_ASCII C 9 10# No need as it is empty and just causes rebuilds since this file does so much. 11UPDATE_DEPENDFILE= no 12 13.if ${MK_SENDMAIL} != "no" 14SUBDIR+=sendmail 15.endif 16 17BIN1= \ 18 login.access \ 19 rc.bsdextended \ 20 rc.firewall \ 21 termcap.small 22 23# NB: keep these sorted by MK_* knobs 24 25.if ${MK_SENDMAIL} != "no" 26BIN1+= rc.sendmail 27.endif 28 29.if ${MK_SENDMAIL} == "no" 30ETCMAIL=mailer.conf aliases 31.else 32ETCMAIL=Makefile README mailer.conf access.sample virtusertable.sample \ 33 mailertable.sample aliases 34.endif 35 36# Special top level files for FreeBSD 37FREEBSD=COPYRIGHT 38 39# Sanitize DESTDIR 40DESTDIR:= ${DESTDIR:C://*:/:g} 41 42afterinstall: 43.if ${MK_MAN} != "no" 44 ${_+_}cd ${SRCTOP}/share/man; ${MAKE} makedb 45.endif 46 47distribute: 48 # Avoid installing tests here; "make distribution" will do this and 49 # correctly place them in the right location. 50 ${_+_}cd ${.CURDIR} ; ${MAKE} MK_TESTS=no install \ 51 DESTDIR=${DISTDIR}/${DISTRIBUTION} 52 ${_+_}cd ${.CURDIR} ; ${MAKE} distribution DESTDIR=${DISTDIR}/${DISTRIBUTION} 53 54.include <bsd.endian.mk> 55 56.if defined(NO_ROOT) 57METALOG.add?= cat -l >> ${METALOG} 58.endif 59 60distribution: 61.if !defined(DESTDIR) 62 @echo "set DESTDIR before running \"make ${.TARGET}\"" 63 @false 64.endif 65 cd ${.CURDIR}; \ 66 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 67 ${BIN1} ${DESTDIR}/etc 68 ${_+_}cd ${.CURDIR}/gss; ${MAKE} install 69 ${_+_}cd ${.CURDIR}/mtree; ${MAKE} install 70 ${_+_}cd ${SRCTOP}/share/termcap; ${MAKE} etc-termcap 71 ${_+_}cd ${SRCTOP}/usr.sbin/rmt; ${MAKE} etc-rmt 72.if ${MK_UNBOUND} != "no" 73 if [ ! -e ${DESTDIR}/etc/unbound ]; then \ 74 ${INSTALL_SYMLINK} ../var/unbound ${DESTDIR}/etc/unbound; \ 75 fi 76.endif 77.if ${MK_SENDMAIL} != "no" 78 ${_+_}cd ${.CURDIR}/sendmail; ${MAKE} distribution 79.endif 80.if ${MK_KERBEROS} != "no" 81 cd ${.CURDIR}/root; \ 82 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 83 dot.k5login ${DESTDIR}/root/.k5login; 84.endif 85 86.if ${MK_MAIL} != "no" 87 cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ 88 ${ETCMAIL} ${DESTDIR}/etc/mail 89 if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ 90 ! -f ${DESTDIR}/etc/aliases ]; then \ 91 ${INSTALL_SYMLINK} mail/aliases ${DESTDIR}/etc/aliases; \ 92 fi 93.endif 94.if ${MK_LOCATE} != "no" 95 ${INSTALL} -o nobody -g ${BINGRP} -m 644 /dev/null \ 96 ${DESTDIR}/var/db/locate.database 97.endif 98 cd ${.CURDIR}/..; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 99 ${FREEBSD} ${DESTDIR}/ 100.if ${MK_BOOT} != "no" 101.if exists(${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints) 102 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \ 103 ${SRCTOP}/sys/${MACHINE}/conf/GENERIC.hints \ 104 ${DESTDIR}/boot/device.hints 105.endif 106.endif 107 108MTREE_CMD?= mtree 109 110MTREES= mtree/BSD.root.dist / \ 111 mtree/BSD.var.dist /var \ 112 mtree/BSD.usr.dist /usr \ 113 mtree/BSD.include.dist /usr/include \ 114 mtree/BSD.debug.dist /usr/lib 115.if ${MK_LIB32} != "no" 116MTREES+= mtree/BSD.lib32.dist /usr 117MTREES+= mtree/BSD.lib32.dist /usr/lib/debug/usr 118.endif 119.if ${MK_LIBSOFT} != "no" 120MTREES+= mtree/BSD.libsoft.dist /usr 121MTREES+= mtree/BSD.libsoft.dist /usr/lib/debug/usr 122.endif 123.if ${MK_TESTS} != "no" 124MTREES+= mtree/BSD.tests.dist ${TESTSBASE} 125MTREES+= mtree/BSD.tests.dist /usr/lib/debug/${TESTSBASE} 126.endif 127.if ${MK_SENDMAIL} != "no" 128MTREES+= mtree/BSD.sendmail.dist / 129.endif 130.for mtree in ${LOCAL_MTREE} 131MTREES+= ../${mtree} / 132.endfor 133 134# Clean up some directories that where mistakenly created as files that 135# should not have been as part of the nvi update in r281994. 136# This should be removed after 11.0-RELEASE. 137DISTRIB_CLEANUP_SHARE_FILES= ${SHAREDIR}/doc/usd/10.exref ${SHAREDIR}/doc/usd/11.edit 138DISTRIB_CLEANUP_SHARE_FILES+= ${SHAREDIR}/doc/usd/12.vi ${SHAREDIR}/doc/usd/13.viref 139distrib-cleanup: .PHONY 140 for file in ${DISTRIB_CLEANUP_SHARE_FILES}; do \ 141 if [ -f ${DESTDIR}/$${file} ]; then \ 142 rm -f ${DESTDIR}/$${file}; \ 143 fi; \ 144 done 145 146distrib-dirs: ${MTREES:N/*} distrib-cleanup .PHONY 147.for _m _d in ${MTREES} 148 @m=${.CURDIR}/${_m}; \ 149 d=${DESTDIR}${_d}; \ 150 test -d $$d || mkdir -p $$d; \ 151 ${ECHO} ${MTREE_CMD} -deU ${MTREE_FSCHG} \ 152 ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ 153 ${MTREE_FILTER} $$m | \ 154 ${MTREE_CMD} -deU ${MTREE_FSCHG} ${MTREE_FOLLOWS_SYMLINKS} \ 155 -p $$d 156.endfor 157.if defined(NO_ROOT) 158.for _m _d in ${MTREES} 159 @m=${.CURDIR}/${_m}; \ 160 d=${_d}; \ 161 test "$$d" == "/" && d=""; \ 162 d=${DISTBASE}$$d; \ 163 test -d ${DESTDIR}/$$d || mkdir -p ${DESTDIR}/$$d; \ 164 ${ECHO} "${MTREE_CMD:N-W} -C -f $$m -K all | " \ 165 "sed s#^\.#.$$d# | ${METALOG.add}" ; \ 166 ${MTREE_FILTER} $$m | \ 167 ${MTREE_CMD:N-W} -C -K all | sed s#^\.#.$$d# | \ 168 ${METALOG.add} 169.endfor 170.endif 171.if ${MK_NLS} != "no" 172.for alias nls in ${NLS_ALIASES} 173 ${INSTALL_SYMLINK} "${nls}" "${DESTDIR}${SHAREDIR}/nls/${alias}" 174.endfor 175.endif 176 177etc-examples: ${META_DEPS} 178 cd ${.CURDIR}; ${INSTALL} ${TAG_ARGS} -o ${BINOWN} -g ${BINGRP} -m 444 \ 179 ${BIN1} ${BIN2} \ 180 ${DESTDIR}${SHAREDIR}/examples/etc 181 182.include <bsd.prog.mk> 183 184.if ${MK_INSTALL_AS_USER} == "yes" && ${_uid} != 0 185MTREE_FILTER= sed -e 's,\([gu]\)name=,\1id=,g' \ 186 -e 's,\(uid=\)[^ ]* ,\1${_uid} ,' \ 187 -e 's,\(gid=\)[^ ]* ,\1${_gid} ,' \ 188 -e 's,\(uid=\)[^ ]*$$,\1${_uid},' \ 189 -e 's,\(gid=\)[^ ]*$$,\1${_gid},' 190.else 191MTREE_FILTER= cat 192.if !defined(NO_FSCHG) 193MTREE_FSCHG= -i 194.endif 195.endif 196