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