xref: /freebsd/etc/sendmail/Makefile (revision 6dcff5b77c219fc6427626320f58672550accfe7)
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
9*6dcff5b7SWarner LoshSENDMAIL_DIR=	${SRCTOP}/contrib/sendmail
10a38a3724SGregory Neil ShapiroSMDIR=		${SENDMAIL_DIR}/src
1177e399e8SGregory Neil ShapiroSENDMAIL_CF_DIR?=${SENDMAIL_DIR}/cf
12fab9e3acSGregory Neil Shapiro
13fab9e3acSGregory Neil Shapiro# this is overkill, but....
1477e399e8SGregory Neil ShapiroM4FILES!=	find ${SENDMAIL_CF_DIR} -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}
20e1848069SGregory Neil Shapiro	${M4} -D_CF_DIR_=${SENDMAIL_CF_DIR}/ -D_NO_MAKEINFO_ \
21e1848069SGregory Neil Shapiro	    ${SENDMAIL_M4_FLAGS} \
2277e399e8SGregory Neil Shapiro	    ${SENDMAIL_CF_DIR}/m4/cf.m4 ${.IMPSRC} > ${.TARGET}
23fab9e3acSGregory Neil Shapiro	${CHMOD} ${ROMODE} ${.TARGET}
2476bfe4c3SPeter Wemm
25255bbde2SGregory Neil ShapiroDEST_CF=	${DESTDIR}/etc/mail/sendmail.cf
26255bbde2SGregory Neil ShapiroDEST_SUBMIT_CF=	${DESTDIR}/etc/mail/submit.cf
27255bbde2SGregory Neil Shapiro
28f92921ddSGregory Neil ShapiroALL=		freebsd.cf freebsd.submit.cf
29f92921ddSGregory Neil ShapiroCLEANFILES=	freebsd.cf freebsd.submit.cf
3076bfe4c3SPeter Wemm
3125219d25SGregory Neil Shapiro# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
3225219d25SGregory Neil Shapiro# Warning!  If set, this causes 'make install' to always copy it
3325219d25SGregory Neil Shapiro# over /etc/mail/sendmail.cf!!!
3476bfe4c3SPeter Wemm# Caveat emptor!  Be sure you want this before you enable it.
35bee2fe72SRuslan Ermilov.if defined(SENDMAIL_MC) && defined(SENDMAIL_CF)
36bee2fe72SRuslan Ermilov.error Both SENDMAIL_MC and SENDMAIL_CF cannot be set.
37bee2fe72SRuslan Ermilov.elif defined(SENDMAIL_MC)
38255bbde2SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_MC:T:R}.cf
39255bbde2SGregory Neil ShapiroALL+=		${INSTALL_CF}
406cabd2d9SGregory Neil ShapiroCLEANFILES+=	${SENDMAIL_MC:T:R}.cf
41255bbde2SGregory Neil Shapiro${INSTALL_CF}: ${SENDMAIL_MC}
42255bbde2SGregory Neil Shapiro.elif defined(SENDMAIL_CF)
436cabd2d9SGregory Neil ShapiroALL+=		${SENDMAIL_CF}
4425219d25SGregory Neil ShapiroINSTALL_CF=	${SENDMAIL_CF}
4525219d25SGregory Neil Shapiro.endif
46255bbde2SGregory Neil Shapiro
47255bbde2SGregory Neil Shapiro.if !defined(SENDMAIL_SET_USER_ID) && defined(SENDMAIL_SUBMIT_MC)
48255bbde2SGregory Neil ShapiroINSTALL_SUBMIT_CF= ${SENDMAIL_SUBMIT_MC:T:R}.cf
49255bbde2SGregory Neil ShapiroALL+=		${INSTALL_SUBMIT_CF}
506cabd2d9SGregory Neil ShapiroCLEANFILES+=	${INSTALL_SUBMIT_CF}
51255bbde2SGregory Neil Shapiro${INSTALL_SUBMIT_CF}: ${SENDMAIL_SUBMIT_MC}
5225219d25SGregory Neil Shapiro.endif
5325219d25SGregory Neil Shapiro
54255bbde2SGregory Neil Shapiro# Additional .cf files to build.
55e6c77250SGregory Neil Shapiro.if defined(SENDMAIL_ADDITIONAL_MC)
56255bbde2SGregory Neil ShapiroSENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:T:S/.mc$/.cf/}
57c8e96857SGregory Neil ShapiroALL+=		${SENDMAIL_ADDITIONAL_CF}
586cabd2d9SGregory Neil ShapiroCLEANFILES+=	${SENDMAIL_ADDITIONAL_CF}
59255bbde2SGregory Neil Shapiro.for mc in ${SENDMAIL_ADDITIONAL_MC}
60255bbde2SGregory Neil Shapiro${mc:T:R}.cf: ${mc}
61255bbde2SGregory Neil Shapiro.endfor
62e6c77250SGregory Neil Shapiro.endif
63e6c77250SGregory Neil Shapiro
64fab9e3acSGregory Neil Shapiroall: ${ALL}
6576bfe4c3SPeter Wemm
66bee2fe72SRuslan Ermilovdistribution:
67255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
68255bbde2SGregory Neil Shapiro	    ${.CURDIR}/freebsd.mc freebsd.cf ${DESTDIR}/etc/mail
69255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
701f9b7c96SGregory Neil Shapiro	    ${.CURDIR}/freebsd.submit.mc freebsd.submit.cf ${DESTDIR}/etc/mail
71255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
72255bbde2SGregory Neil Shapiro	    ${SMDIR}/helpfile ${DESTDIR}/etc/mail
73255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 \
74255bbde2SGregory Neil Shapiro	    /dev/null ${DESTDIR}/var/log/sendmail.st
75ff446b05SPeter Wemm.if defined(INSTALL_CF)
76255bbde2SGregory Neil Shapiro	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
77255bbde2SGregory Neil Shapiro	    ${INSTALL_CF} ${DEST_CF}
78ff446b05SPeter Wemm.else
79ff446b05SPeter Wemm	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
80ff446b05SPeter Wemm	    freebsd.cf ${DEST_CF}
8114d6d765SGregory Neil Shapiro.endif
82bee2fe72SRuslan Ermilov.if defined(SENDMAIL_ADDITIONAL_CF)
83d2893b16SRuslan Ermilov	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
84c8e96857SGregory Neil Shapiro	    ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail
85c8e96857SGregory Neil Shapiro.endif
86ff446b05SPeter Wemm.if !defined(SENDMAIL_SET_USER_ID)
87ff446b05SPeter Wemm.if defined(INSTALL_SUBMIT_CF)
88ff446b05SPeter Wemm	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
8914d6d765SGregory Neil Shapiro	    ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
90ff446b05SPeter Wemm.else
91ff446b05SPeter Wemm	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
92ff446b05SPeter Wemm	    freebsd.submit.cf ${DEST_SUBMIT_CF}
93ff446b05SPeter Wemm.endif
9414d6d765SGregory Neil Shapiro.endif
9576bfe4c3SPeter Wemm
9676bfe4c3SPeter Wemm.include <bsd.prog.mk>
97