Makefile revision 73250
1#	@(#)Makefile	8.19 (Berkeley) 1/14/97
2# $FreeBSD: head/etc/sendmail/Makefile 73250 2001-03-01 03:50:28Z 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}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
22	${CHMOD} ${ROMODE} ${.TARGET}
23
24ALL=	freebsd.cf
25
26# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
27# Warning! If set, this causes 'make install' to always copy it
28# over /etc/mail/sendmail.cf!!!
29# Caveat emptor!  Be sure you want this before you enable it.
30.if defined(SENDMAIL_MC)
31INSTALL_CF=	${SENDMAIL_MC:R}.cf
32.else
33.if defined(SENDMAIL_CF)
34INSTALL_CF=	${SENDMAIL_CF}
35.endif
36.endif
37
38ALL+=		${INSTALL_CF}
39
40# Additional .cf files to build
41.if defined(SENDMAIL_ADDITIONAL_MC)
42ALL+=		${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
43.endif
44
45CLEANFILES+=	${ALL}
46
47all:		${ALL}
48
49depend:
50
51install:	${INSTALL_CF}
52.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
53	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
54	@false
55.endif
56.if defined(INSTALL_CF)
57	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
58		${DESTDIR}/etc/mail/sendmail.cf
59.endif
60
61# Helper for src/etc/Makefile
62distribution:	freebsd.cf freebsd.mc ${INSTALL_CF}
63.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
64	@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
65	@false
66.endif
67	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
68		${DESTDIR}/etc/mail/freebsd.mc
69	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
70		${DESTDIR}/etc/mail/freebsd.cf
71.if defined(INSTALL_CF)
72	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
73		${DESTDIR}/etc/mail/sendmail.cf
74.else
75	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
76		${DESTDIR}/etc/mail/sendmail.cf
77.endif
78	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
79	    ${DESTDIR}/etc/mail/helpfile
80	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
81	    ${DESTDIR}/var/log/sendmail.st
82
83.include <bsd.prog.mk>
84