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