Makefile revision 73210
138102Speter#	@(#)Makefile	8.19 (Berkeley) 1/14/97
250472Speter# $FreeBSD: head/etc/sendmail/Makefile 73210 2001-02-28 04:04:07Z gshapiro $
338102Speter
473210SgshapiroM4=		m4
573210SgshapiroCHMOD=		chmod
673210SgshapiroROMODE=		444
773210SgshapiroRM=		rm -f
873210SgshapiroCFDIR=		${.CURDIR}/../../contrib/sendmail/cf
938102Speter
1073210Sgshapiro# this is overkill, but....
1173210SgshapiroM4FILES!=	find ${CFDIR} -type f -name '*.m4' -print
1238102Speter
1373210Sgshapiro.SUFFIXES:	.mc .cf
1473210Sgshapiro
1573210Sgshapiro.mc.cf:		${M4FILES}
1673210Sgshapiro	${RM} ${.TARGET}
1738102Speter	(cd ${.CURDIR} && \
1873210Sgshapiro	    ${M4} -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
1973210Sgshapiro	${CHMOD} ${ROMODE} ${.TARGET}
2038102Speter
2138102SpeterALL=	freebsd.cf
2238102Speter
2372846Sgshapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
2472846Sgshapiro# Warning! If set, this causes 'make install' to always copy it
2572846Sgshapiro# over /etc/mail/sendmail.cf!!!
2638102Speter# Caveat emptor!  Be sure you want this before you enable it.
2772846Sgshapiro.if defined(SENDMAIL_MC)
2872846SgshapiroINSTALL_CF=	${SENDMAIL_MC:R}.cf
2972846Sgshapiro.else
3038102Speter.if defined(SENDMAIL_CF)
3172846SgshapiroINSTALL_CF=	${SENDMAIL_CF}
3238102Speter.endif
3372846Sgshapiro.endif
3438102Speter
3573210SgshapiroALL+=		${INSTALL_CF}
3672846Sgshapiro
3772918Sgshapiro# Additional .cf files to build
3872918Sgshapiro.if defined(SENDMAIL_ADDITIONAL_MC)
3973210SgshapiroALL+=		${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
4072918Sgshapiro.endif
4172918Sgshapiro
4273210SgshapiroCLEANFILES+=	${ALL}
4338102Speter
4473210Sgshapiroall:		${ALL}
4538102Speter
4638102Speterdepend:
4738102Speter
4873210Sgshapiroinstall:	${INSTALL_CF}
4972846Sgshapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
5072846Sgshapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
5172846Sgshapiro	@false
5272846Sgshapiro.endif
5373210Sgshapiro.if defined(INSTALL_CF)
5472846Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
5572846Sgshapiro		${DESTDIR}/etc/mail/sendmail.cf
5638102Speter.endif
5738102Speter
5838102Speter# Helper for src/etc/Makefile
5973210Sgshapirodistribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
6072846Sgshapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
6172846Sgshapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
6272846Sgshapiro	@false
6372846Sgshapiro.endif
6472845Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
6572845Sgshapiro		${DESTDIR}/etc/mail/freebsd.mc
6638102Speter	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
6772845Sgshapiro		${DESTDIR}/etc/mail/freebsd.cf
6872846Sgshapiro.if defined(INSTALL_CF)
6972846Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
7072846Sgshapiro		${DESTDIR}/etc/mail/sendmail.cf
7172846Sgshapiro.else
7272845Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
7354836Sobrien		${DESTDIR}/etc/mail/sendmail.cf
7472846Sgshapiro.endif
7572846Sgshapiro	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
7672846Sgshapiro	    ${DESTDIR}/var/log/sendmail.st
7738102Speter
7838102Speter.include <bsd.prog.mk>
79