Makefile revision 73250
138102Speter#	@(#)Makefile	8.19 (Berkeley) 1/14/97
250472Speter# $FreeBSD: head/etc/sendmail/Makefile 73250 2001-03-01 03:50:28Z gshapiro $
338102Speter
473210SgshapiroM4=		m4
573210SgshapiroCHMOD=		chmod
673210SgshapiroROMODE=		444
773210SgshapiroRM=		rm -f
838102Speter
973250SgshapiroSENDMAIL_DIR=	${.CURDIR}/../../contrib/sendmail
1073250SgshapiroSMDIR=		${SENDMAIL_DIR}/src
1173250SgshapiroCFDIR=		${SENDMAIL_DIR}/cf
1273250Sgshapiro
1373210Sgshapiro# this is overkill, but....
1473210SgshapiroM4FILES!=	find ${CFDIR} -type f -name '*.m4' -print
1538102Speter
1673210Sgshapiro.SUFFIXES:	.mc .cf
1773210Sgshapiro
1873210Sgshapiro.mc.cf:		${M4FILES}
1973210Sgshapiro	${RM} ${.TARGET}
2038102Speter	(cd ${.CURDIR} && \
2173210Sgshapiro	    ${M4} -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
2273210Sgshapiro	${CHMOD} ${ROMODE} ${.TARGET}
2338102Speter
2438102SpeterALL=	freebsd.cf
2538102Speter
2672846Sgshapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
2772846Sgshapiro# Warning! If set, this causes 'make install' to always copy it
2872846Sgshapiro# over /etc/mail/sendmail.cf!!!
2938102Speter# Caveat emptor!  Be sure you want this before you enable it.
3072846Sgshapiro.if defined(SENDMAIL_MC)
3172846SgshapiroINSTALL_CF=	${SENDMAIL_MC:R}.cf
3272846Sgshapiro.else
3338102Speter.if defined(SENDMAIL_CF)
3472846SgshapiroINSTALL_CF=	${SENDMAIL_CF}
3538102Speter.endif
3672846Sgshapiro.endif
3738102Speter
3873210SgshapiroALL+=		${INSTALL_CF}
3972846Sgshapiro
4072918Sgshapiro# Additional .cf files to build
4172918Sgshapiro.if defined(SENDMAIL_ADDITIONAL_MC)
4273210SgshapiroALL+=		${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
4372918Sgshapiro.endif
4472918Sgshapiro
4573210SgshapiroCLEANFILES+=	${ALL}
4638102Speter
4773210Sgshapiroall:		${ALL}
4838102Speter
4938102Speterdepend:
5038102Speter
5173210Sgshapiroinstall:	${INSTALL_CF}
5272846Sgshapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
5372846Sgshapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
5472846Sgshapiro	@false
5572846Sgshapiro.endif
5673210Sgshapiro.if defined(INSTALL_CF)
5772846Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
5872846Sgshapiro		${DESTDIR}/etc/mail/sendmail.cf
5938102Speter.endif
6038102Speter
6138102Speter# Helper for src/etc/Makefile
6273210Sgshapirodistribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
6372846Sgshapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
6472846Sgshapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
6572846Sgshapiro	@false
6672846Sgshapiro.endif
6772845Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
6872845Sgshapiro		${DESTDIR}/etc/mail/freebsd.mc
6938102Speter	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
7072845Sgshapiro		${DESTDIR}/etc/mail/freebsd.cf
7172846Sgshapiro.if defined(INSTALL_CF)
7272846Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
7372846Sgshapiro		${DESTDIR}/etc/mail/sendmail.cf
7472846Sgshapiro.else
7572845Sgshapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
7654836Sobrien		${DESTDIR}/etc/mail/sendmail.cf
7772846Sgshapiro.endif
7873250Sgshapiro	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
7973250Sgshapiro	    ${DESTDIR}/etc/mail/helpfile
8072846Sgshapiro	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
8172846Sgshapiro	    ${DESTDIR}/var/log/sendmail.st
8238102Speter
8338102Speter.include <bsd.prog.mk>
84