Makefile revision 80175
1#	@(#)Makefile	8.19 (Berkeley) 1/14/97
2# $FreeBSD: head/etc/sendmail/Makefile 80175 2001-07-23 01:33:54Z gshapiro $
3
4M4=		m4
5CHMOD=		chmod
6ROMODE=		444
7RM=		rm -f
8
9SENDMAIL_DIR=	${.CURDIR}/../../contrib/sendmail
10SMDIR=		${SENDMAIL_DIR}/src
11CFDIR=		${SENDMAIL_DIR}/cf
12
13SENDMAIL_M4_FLAGS+=	-D_FFR_TLS_O_T
14
15# this is overkill, but....
16M4FILES!=	find ${CFDIR} -type f -name '*.m4' -print
17
18.SUFFIXES:	.mc .cf
19
20.mc.cf:		${M4FILES}
21	${RM} ${.TARGET}
22	(cd ${.CURDIR} && \
23	    ${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
24		${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
25	${CHMOD} ${ROMODE} ${.TARGET}
26
27ALL=	freebsd.cf
28
29# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
30# Warning! If set, this causes 'make install' to always copy it
31# over /etc/mail/sendmail.cf!!!
32# Caveat emptor!  Be sure you want this before you enable it.
33.if defined(SENDMAIL_MC)
34INSTALL_CF=	${SENDMAIL_MC:R}.cf
35.else
36.if defined(SENDMAIL_CF)
37INSTALL_CF=	${SENDMAIL_CF}
38.endif
39.endif
40
41ALL+=		${INSTALL_CF}
42
43# Additional .cf files to build
44.if defined(SENDMAIL_ADDITIONAL_MC)
45ALL+=		${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
46.endif
47
48CLEANFILES+=	${ALL}
49
50all:		${ALL}
51
52depend:
53
54install:	${INSTALL_CF}
55.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
56	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
57	@false
58.endif
59.if defined(INSTALL_CF)
60	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
61		${DESTDIR}/etc/mail/sendmail.cf
62.endif
63
64# Helper for src/etc/Makefile
65distribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
66.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
67	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
68	@false
69.endif
70	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
71		${DESTDIR}/etc/mail/freebsd.mc
72	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
73		${DESTDIR}/etc/mail/freebsd.cf
74.if defined(INSTALL_CF)
75	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
76		${DESTDIR}/etc/mail/sendmail.cf
77.else
78	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
79		${DESTDIR}/etc/mail/sendmail.cf
80.endif
81	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
82	    ${DESTDIR}/etc/mail/helpfile
83	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
84	    ${DESTDIR}/var/log/sendmail.st
85
86.include <bsd.prog.mk>
87