xref: /freebsd/etc/sendmail/Makefile (revision f88f925efcc17f40f43bbdcb8aa1e5ff92cdb3a0)
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
13f4843be9SGregory Neil ShapiroSENDMAIL_M4_FLAGS+=	-D_FFR_TLS_O_T
14f4843be9SGregory Neil Shapiro
15fab9e3acSGregory Neil Shapiro# this is overkill, but....
16fab9e3acSGregory Neil ShapiroM4FILES!=	find ${CFDIR} -type f -name '*.m4' -print
1776bfe4c3SPeter Wemm
1876bfe4c3SPeter Wemm.SUFFIXES:	.mc .cf
1976bfe4c3SPeter Wemm
20fab9e3acSGregory Neil Shapiro.mc.cf:		${M4FILES}
21fab9e3acSGregory Neil Shapiro	${RM} ${.TARGET}
2276bfe4c3SPeter Wemm	(cd ${.CURDIR} && \
23f4843be9SGregory Neil Shapiro	    ${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
24f4843be9SGregory Neil Shapiro		${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
25fab9e3acSGregory Neil Shapiro	${CHMOD} ${ROMODE} ${.TARGET}
2676bfe4c3SPeter Wemm
2776bfe4c3SPeter WemmALL=	freebsd.cf
2876bfe4c3SPeter Wemm
2925219d25SGregory Neil Shapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
3025219d25SGregory Neil Shapiro# Warning! If set, this causes 'make install' to always copy it
3125219d25SGregory Neil Shapiro# over /etc/mail/sendmail.cf!!!
3276bfe4c3SPeter Wemm# Caveat emptor!  Be sure you want this before you enable it.
3325219d25SGregory Neil Shapiro.if defined(SENDMAIL_MC)
3425219d25SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_MC:R}.cf
3525219d25SGregory Neil Shapiro.else
3676bfe4c3SPeter Wemm.if defined(SENDMAIL_CF)
3725219d25SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_CF}
3825219d25SGregory Neil Shapiro.endif
3925219d25SGregory Neil Shapiro.endif
4025219d25SGregory Neil Shapiro
41f88f925eSGregory Neil ShapiroDEST_CF=	${DESTDIR}/etc/mail/sendmail.cf
42f88f925eSGregory Neil Shapiro
4325219d25SGregory Neil ShapiroALL+=		${INSTALL_CF}
4476bfe4c3SPeter Wemm
45e6c77250SGregory Neil Shapiro# Additional .cf files to build
46e6c77250SGregory Neil Shapiro.if defined(SENDMAIL_ADDITIONAL_MC)
47e6c77250SGregory Neil ShapiroALL+=		${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
48e6c77250SGregory Neil Shapiro.endif
49e6c77250SGregory Neil Shapiro
50fab9e3acSGregory Neil ShapiroCLEANFILES+=	${ALL}
5176bfe4c3SPeter Wemm
52fab9e3acSGregory Neil Shapiroall:		${ALL}
5376bfe4c3SPeter Wemm
5476bfe4c3SPeter Wemmdepend:
5576bfe4c3SPeter Wemm
5625219d25SGregory Neil Shapiroinstall:	${INSTALL_CF}
5725219d25SGregory Neil Shapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
5825219d25SGregory Neil Shapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
5925219d25SGregory Neil Shapiro	@false
6025219d25SGregory Neil Shapiro.endif
61fab9e3acSGregory Neil Shapiro.if defined(INSTALL_CF)
62f88f925eSGregory Neil Shapiro.if ${INSTALL_CF} != ${DEST_CF}
6325219d25SGregory Neil Shapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
64f88f925eSGregory Neil Shapiro		${DEST_CF}
65f88f925eSGregory Neil Shapiro.endif
6676bfe4c3SPeter Wemm.endif
6776bfe4c3SPeter Wemm
6876bfe4c3SPeter Wemm# Helper for src/etc/Makefile
69fab9e3acSGregory Neil Shapirodistribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
7025219d25SGregory Neil Shapiro.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
7125219d25SGregory Neil Shapiro	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
7225219d25SGregory Neil Shapiro	@false
7325219d25SGregory Neil Shapiro.endif
74e10536edSGregory Neil Shapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
75e10536edSGregory Neil Shapiro		${DESTDIR}/etc/mail/freebsd.mc
76e10536edSGregory Neil Shapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
77e10536edSGregory Neil Shapiro		${DESTDIR}/etc/mail/freebsd.cf
7825219d25SGregory Neil Shapiro.if defined(INSTALL_CF)
79f88f925eSGregory Neil Shapiro.if ${INSTALL_CF} != ${DEST_CF}
8025219d25SGregory Neil Shapiro	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
81f88f925eSGregory Neil Shapiro		${DEST_CF}
82f88f925eSGregory Neil Shapiro.endif
8325219d25SGregory Neil Shapiro.else
8476bfe4c3SPeter Wemm	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
85f88f925eSGregory Neil Shapiro		${DEST_CF}
8625219d25SGregory Neil Shapiro.endif
87a38a3724SGregory Neil Shapiro	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
88a38a3724SGregory Neil Shapiro	    ${DESTDIR}/etc/mail/helpfile
89e4e1027aSGregory Neil Shapiro	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
90e4e1027aSGregory Neil Shapiro	    ${DESTDIR}/var/log/sendmail.st
9176bfe4c3SPeter Wemm
9276bfe4c3SPeter Wemm.include <bsd.prog.mk>
93