xref: /freebsd/etc/sendmail/Makefile (revision 6cabd2d9bb0e38d304c2a9a18073bba64f25cf0c)
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}
20f4843be9SGregory Neil Shapiro	${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
21255bbde2SGregory Neil Shapiro	    ${CFDIR}/m4/cf.m4 ${.IMPSRC} > ${.TARGET}
22fab9e3acSGregory Neil Shapiro	${CHMOD} ${ROMODE} ${.TARGET}
2376bfe4c3SPeter Wemm
24255bbde2SGregory Neil ShapiroDEST_CF=	${DESTDIR}/etc/mail/sendmail.cf
25255bbde2SGregory Neil ShapiroDEST_SUBMIT_CF=	${DESTDIR}/etc/mail/submit.cf
26255bbde2SGregory Neil Shapiro
2776bfe4c3SPeter WemmALL=		freebsd.cf
286cabd2d9SGregory Neil ShapiroCLEANFILES=	freebsd.cf
2976bfe4c3SPeter Wemm
3025219d25SGregory Neil Shapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
3125219d25SGregory Neil Shapiro# Warning!  If set, this causes 'make install' to always copy it
3225219d25SGregory Neil Shapiro# over /etc/mail/sendmail.cf!!!
3376bfe4c3SPeter Wemm# Caveat emptor!  Be sure you want this before you enable it.
3425219d25SGregory Neil Shapiro.if defined(SENDMAIL_MC)
35255bbde2SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_MC:T:R}.cf
36255bbde2SGregory Neil ShapiroALL+=		${INSTALL_CF}
376cabd2d9SGregory Neil ShapiroCLEANFILES+=	${SENDMAIL_MC:T:R}.cf
38255bbde2SGregory Neil Shapiro${INSTALL_CF}: ${SENDMAIL_MC}
39255bbde2SGregory Neil Shapiro.elif defined(SENDMAIL_CF)
406cabd2d9SGregory Neil ShapiroALL+=		${SENDMAIL_CF}
4125219d25SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_CF}
4225219d25SGregory Neil Shapiro.endif
43255bbde2SGregory Neil Shapiro
44255bbde2SGregory Neil Shapiro.if !defined(SENDMAIL_SET_USER_ID) && defined(SENDMAIL_SUBMIT_MC)
45255bbde2SGregory Neil ShapiroINSTALL_SUBMIT_CF= ${SENDMAIL_SUBMIT_MC:T:R}.cf
46255bbde2SGregory Neil ShapiroALL+=		${INSTALL_SUBMIT_CF}
476cabd2d9SGregory Neil ShapiroCLEANFILES+=	${INSTALL_SUBMIT_CF}
48255bbde2SGregory Neil Shapiro${INSTALL_SUBMIT_CF}: ${SENDMAIL_SUBMIT_MC}
4925219d25SGregory Neil Shapiro.endif
5025219d25SGregory Neil Shapiro
51255bbde2SGregory Neil Shapiro# Additional .cf files to build.
52e6c77250SGregory Neil Shapiro.if defined(SENDMAIL_ADDITIONAL_MC)
53255bbde2SGregory Neil ShapiroSENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:T:S/.mc$/.cf/}
54c8e96857SGregory Neil ShapiroALL+=		${SENDMAIL_ADDITIONAL_CF}
556cabd2d9SGregory Neil ShapiroCLEANFILES+=	${SENDMAIL_ADDITIONAL_CF}
56255bbde2SGregory Neil Shapiro.for mc in ${SENDMAIL_ADDITIONAL_MC}
57255bbde2SGregory Neil Shapiro${mc:T:R}.cf: ${mc}
58255bbde2SGregory Neil Shapiro.endfor
59e6c77250SGregory Neil Shapiro.endif
60e6c77250SGregory Neil Shapiro
61fab9e3acSGregory Neil Shapiroall: ${ALL}
6276bfe4c3SPeter Wemm
63d361b55eSGregory Neil Shapiroinstall distribution: ${ALL}
64255bbde2SGregory Neil Shapiro.if defined(SENDMAIL_MC) && defined(SENDMAIL_CF)
65255bbde2SGregory Neil Shapiro	@echo ">>> ERROR: Both SENDMAIL_MC and SENDMAIL_CF cannot be set"
6625219d25SGregory Neil Shapiro	@false
6725219d25SGregory Neil Shapiro.endif
68255bbde2SGregory Neil Shapiro.if make(distribution)
69255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
70255bbde2SGregory Neil Shapiro	    ${.CURDIR}/freebsd.mc freebsd.cf ${DESTDIR}/etc/mail
71255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
72255bbde2SGregory Neil Shapiro	    ${CFDIR}/cf/submit.mc ${DESTDIR}/etc/mail/freebsd.submit.mc
73255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
74255bbde2SGregory Neil Shapiro	    ${CFDIR}/cf/submit.cf ${DESTDIR}/etc/mail/freebsd.submit.cf
75255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
76255bbde2SGregory Neil Shapiro	    ${SMDIR}/helpfile ${DESTDIR}/etc/mail
77255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 \
78255bbde2SGregory Neil Shapiro	    /dev/null ${DESTDIR}/var/log/sendmail.st
79f88f925eSGregory Neil Shapiro.endif
80255bbde2SGregory Neil Shapiro.if defined(INSTALL_CF) && ${INSTALL_CF} != ${DEST_CF}
81255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
82255bbde2SGregory Neil Shapiro	    ${INSTALL_CF} ${DEST_CF}
83255bbde2SGregory Neil Shapiro.elif make(distribution)
84255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
85255bbde2SGregory Neil Shapiro	    freebsd.cf ${DEST_CF}
8614d6d765SGregory Neil Shapiro.endif
87255bbde2SGregory Neil Shapiro.if defined(SENDMAIL_ADDITIONAL_CF) && make(install)
88d2893b16SRuslan Ermilov	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
89c8e96857SGregory Neil Shapiro	    ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail
90c8e96857SGregory Neil Shapiro.endif
91255bbde2SGregory Neil Shapiro.if !defined(SENDMAIL_SET_USER_ID)
92255bbde2SGregory Neil Shapiro.if defined(INSTALL_SUBMIT_CF) && ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
93d2893b16SRuslan Ermilov	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
9414d6d765SGregory Neil Shapiro	    ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
95255bbde2SGregory Neil Shapiro.elif make(distribution)
96255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
97255bbde2SGregory Neil Shapiro	    ${CFDIR}/cf/submit.cf ${DEST_SUBMIT_CF}
9814d6d765SGregory Neil Shapiro.endif
9914d6d765SGregory Neil Shapiro.endif
10076bfe4c3SPeter Wemm
10176bfe4c3SPeter Wemm.include <bsd.prog.mk>
102