]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/sendmail/Makefile
Rework META_TARGETS so that it automatically adds META_DEPS to the targets.
[FreeBSD/FreeBSD.git] / share / sendmail / Makefile
1 # $FreeBSD$
2 #
3 # Doing a make install builds /usr/share/sendmail/
4
5 SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
6 CFDIR=  cf
7 CFDIRS!=        (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type d -print)
8 CFFILES!=       (cd ${SENDMAIL_DIR}; find -L ${CFDIR} \( \( -name CVS -o -name .svn \) -prune \) -o -type f -print)
9
10 DDIR=   ${DESTDIR}${SHAREDIR}/sendmail
11
12 # Define SHARED to indicate whether you want symbolic links to the system
13 # source (``symlinks''), or a separate copy (``copies'')
14 SHARED?=        copies
15
16 all clean cleandir depend lint tags:
17
18 beforeinstall: ${SHARED}
19 META_TARGETS+=  copies symlinks
20
21 copies:
22         if [ -L ${DDIR}/${CFDIR} ]; then rm -f ${DDIR}/${CFDIR}; fi
23 .for dir in ${CFDIRS}
24         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 755 -d ${DDIR}/${dir}
25 .endfor
26 .for file in ${CFFILES}
27         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SENDMAIL_DIR}/${file} ${DDIR}/${file}
28 .endfor
29
30 symlinks:
31         rm -rf ${DDIR}/${CFDIR}; ln -s ${SENDMAIL_DIR}/${CFDIR} ${DDIR}/${CFDIR}
32
33 .include <bsd.prog.mk>