Makefile revision 80796
1#	@(#)Makefile	8.19 (Berkeley) 1/14/97
2# $FreeBSD: head/etc/sendmail/Makefile 80796 2001-08-01 02:12:39Z 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
13# this is overkill, but....
14M4FILES!=	find ${CFDIR} -type f -name '*.m4' -print
15
16.SUFFIXES:	.mc .cf
17
18.mc.cf:		${M4FILES}
19	${RM} ${.TARGET}
20	(cd ${.CURDIR} && \
21	    ${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
22		${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
23	${CHMOD} ${ROMODE} ${.TARGET}
24
25ALL=	freebsd.cf
26
27# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
28# Warning! If set, this causes 'make install' to always copy it
29# over /etc/mail/sendmail.cf!!!
30# Caveat emptor!  Be sure you want this before you enable it.
31.if defined(SENDMAIL_MC)
32INSTALL_CF=	${SENDMAIL_MC:R}.cf
33.else
34.if defined(SENDMAIL_CF)
35INSTALL_CF=	${SENDMAIL_CF}
36.endif
37.endif
38
39DEST_CF=	${DESTDIR}/etc/mail/sendmail.cf
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.if ${INSTALL_CF} != ${DEST_CF}
61	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
62		${DEST_CF}
63.endif
64.endif
65
66# Helper for src/etc/Makefile
67distribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
68.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
69	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
70	@false
71.endif
72	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
73		${DESTDIR}/etc/mail/freebsd.mc
74	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
75		${DESTDIR}/etc/mail/freebsd.cf
76.if defined(INSTALL_CF)
77.if ${INSTALL_CF} != ${DEST_CF}
78	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
79		${DEST_CF}
80.endif
81.else
82	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
83		${DEST_CF}
84.endif
85	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
86	    ${DESTDIR}/etc/mail/helpfile
87	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
88	    ${DESTDIR}/var/log/sendmail.st
89
90.include <bsd.prog.mk>
91