176bfe4c3SPeter Wemm# @(#)Makefile 8.19 (Berkeley) 1/14/97 29b7a44a6SPeter Wemm# $FreeBSD$ 376bfe4c3SPeter Wemm 476bfe4c3SPeter WemmM4= m4 576bfe4c3SPeter WemmCHMOD= chmod 676bfe4c3SPeter WemmROMODE= 444 776bfe4c3SPeter WemmRM= rm -f 8a38a3724SGregory Neil Shapiro 9a38a3724SGregory Neil ShapiroSENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail 10a38a3724SGregory Neil ShapiroSMDIR= ${SENDMAIL_DIR}/src 11a38a3724SGregory Neil ShapiroCFDIR= ${SENDMAIL_DIR}/cf 12fab9e3acSGregory Neil Shapiro 13fab9e3acSGregory Neil Shapiro# this is overkill, but.... 14fab9e3acSGregory Neil ShapiroM4FILES!= find ${CFDIR} -type f -name '*.m4' -print 1576bfe4c3SPeter Wemm 1676bfe4c3SPeter Wemm.SUFFIXES: .mc .cf 1776bfe4c3SPeter Wemm 18fab9e3acSGregory Neil Shapiro.mc.cf: ${M4FILES} 19fab9e3acSGregory Neil Shapiro ${RM} ${.TARGET} 2076bfe4c3SPeter Wemm (cd ${.CURDIR} && \ 21fab9e3acSGregory Neil Shapiro ${M4} -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET} 22fab9e3acSGregory Neil Shapiro ${CHMOD} ${ROMODE} ${.TARGET} 2376bfe4c3SPeter Wemm 2476bfe4c3SPeter WemmALL= freebsd.cf 2576bfe4c3SPeter Wemm 2625219d25SGregory Neil Shapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf. 2725219d25SGregory Neil Shapiro# Warning! If set, this causes 'make install' to always copy it 2825219d25SGregory Neil Shapiro# over /etc/mail/sendmail.cf!!! 2976bfe4c3SPeter Wemm# Caveat emptor! Be sure you want this before you enable it. 3025219d25SGregory Neil Shapiro.if defined(SENDMAIL_MC) 3125219d25SGregory Neil ShapiroINSTALL_CF= ${SENDMAIL_MC:R}.cf 3225219d25SGregory Neil Shapiro.else 3376bfe4c3SPeter Wemm.if defined(SENDMAIL_CF) 3425219d25SGregory Neil ShapiroINSTALL_CF= ${SENDMAIL_CF} 3525219d25SGregory Neil Shapiro.endif 3625219d25SGregory Neil Shapiro.endif 3725219d25SGregory Neil Shapiro 3825219d25SGregory Neil ShapiroALL+= ${INSTALL_CF} 3976bfe4c3SPeter Wemm 40e6c77250SGregory Neil Shapiro# Additional .cf files to build 41e6c77250SGregory Neil Shapiro.if defined(SENDMAIL_ADDITIONAL_MC) 42e6c77250SGregory Neil ShapiroALL+= ${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g} 43e6c77250SGregory Neil Shapiro.endif 44e6c77250SGregory Neil Shapiro 45fab9e3acSGregory Neil ShapiroCLEANFILES+= ${ALL} 4676bfe4c3SPeter Wemm 47fab9e3acSGregory Neil Shapiroall: ${ALL} 4876bfe4c3SPeter Wemm 4976bfe4c3SPeter Wemmdepend: 5076bfe4c3SPeter Wemm 5125219d25SGregory Neil Shapiroinstall: ${INSTALL_CF} 5225219d25SGregory Neil Shapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF)) 5325219d25SGregory Neil Shapiro @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set" 5425219d25SGregory Neil Shapiro @false 5525219d25SGregory Neil Shapiro.endif 56fab9e3acSGregory Neil Shapiro.if defined(INSTALL_CF) 5725219d25SGregory Neil Shapiro ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \ 588bdd91e3SDavid E. O'Brien ${DESTDIR}/etc/mail/sendmail.cf 5976bfe4c3SPeter Wemm.endif 6076bfe4c3SPeter Wemm 6176bfe4c3SPeter Wemm# Helper for src/etc/Makefile 62fab9e3acSGregory Neil Shapirodistribution: freebsd.cf freebsd.mc ${INSTALL_CF} 6325219d25SGregory Neil Shapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF)) 6425219d25SGregory Neil Shapiro @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set" 6525219d25SGregory Neil Shapiro @false 6625219d25SGregory Neil Shapiro.endif 67e10536edSGregory Neil Shapiro ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \ 68e10536edSGregory Neil Shapiro ${DESTDIR}/etc/mail/freebsd.mc 69e10536edSGregory Neil Shapiro ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \ 70e10536edSGregory Neil Shapiro ${DESTDIR}/etc/mail/freebsd.cf 7125219d25SGregory Neil Shapiro.if defined(INSTALL_CF) 7225219d25SGregory Neil Shapiro ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \ 7325219d25SGregory Neil Shapiro ${DESTDIR}/etc/mail/sendmail.cf 7425219d25SGregory Neil Shapiro.else 7576bfe4c3SPeter Wemm ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \ 768bdd91e3SDavid E. O'Brien ${DESTDIR}/etc/mail/sendmail.cf 7725219d25SGregory Neil Shapiro.endif 78a38a3724SGregory Neil Shapiro ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \ 79a38a3724SGregory Neil Shapiro ${DESTDIR}/etc/mail/helpfile 80e4e1027aSGregory Neil Shapiro ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 81e4e1027aSGregory Neil Shapiro ${DESTDIR}/var/log/sendmail.st 8276bfe4c3SPeter Wemm 8376bfe4c3SPeter Wemm.include <bsd.prog.mk> 84