1 # @(#)Makefile 8.19 (Berkeley) 1/14/97
2 # $FreeBSD: src/etc/sendmail/Makefile,v 1.3.2.17 2002/08/07 16:31:41 ru Exp $
3 # $DragonFly: src/etc/sendmail/Makefile,v 1.2 2003/06/17 04:24:48 dillon Exp $
10 SENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail
11 SMDIR= ${SENDMAIL_DIR}/src
12 CFDIR= ${SENDMAIL_DIR}/cf
14 # this is overkill, but....
15 M4FILES!= find ${CFDIR} -type f -name '*.m4' -print
22 ${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
23 ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
24 ${CHMOD} ${ROMODE} ${.TARGET}
27 CLEANFILES+= freebsd.cf
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)
34 INSTALL_CF= ${SENDMAIL_MC:R}.cf
36 .if defined(SENDMAIL_CF)
37 INSTALL_CF= ${SENDMAIL_CF}
41 .ifndef SENDMAIL_SET_USER_ID
42 .if defined(SENDMAIL_SUBMIT_MC)
43 INSTALL_SUBMIT_CF=${SENDMAIL_SUBMIT_MC:R}.cf
47 DEST_CF= ${DESTDIR}/etc/mail/sendmail.cf
48 DEST_SUBMIT_CF= ${DESTDIR}/etc/mail/submit.cf
50 ALL+= ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
52 # Make sure we don't remove /etc/mail/sendmail.cf on make clean
53 # since this will break a running system during a buildworld.
54 .if defined(INSTALL_CF)
55 .if ${INSTALL_CF} != ${DEST_CF}
56 CLEANFILES+= ${INSTALL_CF}
60 .if defined(INSTALL_SUBMIT_CF)
61 .if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
62 CLEANFILES+= ${INSTALL_SUBMIT_CF}
66 # Additional .cf files to build
67 .if defined(SENDMAIL_ADDITIONAL_MC)
68 SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
69 ALL+= ${SENDMAIL_ADDITIONAL_CF}
70 CLEANFILES+= ${SENDMAIL_ADDITIONAL_CF}
77 install: ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
78 .if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
79 @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
82 .if defined(INSTALL_CF)
83 .if ${INSTALL_CF} != ${DEST_CF}
84 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
88 .if defined(SENDMAIL_ADDITIONAL_CF)
89 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
90 ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail
92 .ifndef SENDMAIL_SET_USER_ID
93 .if defined(INSTALL_SUBMIT_CF)
94 .if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
95 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
96 ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
101 # Helper for src/etc/Makefile
102 distribution: freebsd.cf freebsd.mc ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
103 .if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
104 @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
107 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
108 ${DESTDIR}/etc/mail/freebsd.mc
109 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
110 ${DESTDIR}/etc/mail/freebsd.cf
111 .if defined(INSTALL_CF)
112 .if ${INSTALL_CF} != ${DEST_CF}
113 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
117 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
120 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.mc \
121 ${DESTDIR}/etc/mail/freebsd.submit.mc
122 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.cf \
123 ${DESTDIR}/etc/mail/freebsd.submit.cf
124 .ifndef SENDMAIL_SET_USER_ID
125 .if defined(INSTALL_SUBMIT_CF)
126 .if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
127 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
128 ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
131 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.cf \
135 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
136 ${DESTDIR}/etc/mail/helpfile
137 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
138 ${DESTDIR}/var/log/sendmail.st
140 .include <bsd.prog.mk>