1998-08-04 15:53:18 +00:00
|
|
|
# @(#)Makefile 8.19 (Berkeley) 1/14/97
|
1999-08-27 23:37:10 +00:00
|
|
|
# $FreeBSD$
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2001-02-28 04:04:07 +00:00
|
|
|
M4= m4
|
|
|
|
CHMOD= chmod
|
|
|
|
ROMODE= 444
|
|
|
|
RM= rm -f
|
2001-03-01 03:50:28 +00:00
|
|
|
|
|
|
|
SENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail
|
|
|
|
SMDIR= ${SENDMAIL_DIR}/src
|
|
|
|
CFDIR= ${SENDMAIL_DIR}/cf
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2001-02-28 04:04:07 +00:00
|
|
|
# this is overkill, but....
|
|
|
|
M4FILES!= find ${CFDIR} -type f -name '*.m4' -print
|
|
|
|
|
|
|
|
.SUFFIXES: .mc .cf
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2001-02-28 04:04:07 +00:00
|
|
|
.mc.cf: ${M4FILES}
|
|
|
|
${RM} ${.TARGET}
|
1998-08-04 15:53:18 +00:00
|
|
|
(cd ${.CURDIR} && \
|
2001-07-23 01:33:54 +00:00
|
|
|
${M4} -D_CF_DIR_=${CFDIR}/ ${SENDMAIL_M4_FLAGS} \
|
|
|
|
${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
|
2001-02-28 04:04:07 +00:00
|
|
|
${CHMOD} ${ROMODE} ${.TARGET}
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2002-02-24 02:38:23 +00:00
|
|
|
ALL= freebsd.cf
|
|
|
|
CLEANFILES+= freebsd.cf
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2001-02-22 04:11:52 +00:00
|
|
|
# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
|
|
|
|
# Warning! If set, this causes 'make install' to always copy it
|
|
|
|
# over /etc/mail/sendmail.cf!!!
|
1998-08-04 15:53:18 +00:00
|
|
|
# Caveat emptor! Be sure you want this before you enable it.
|
2001-02-22 04:11:52 +00:00
|
|
|
.if defined(SENDMAIL_MC)
|
|
|
|
INSTALL_CF= ${SENDMAIL_MC:R}.cf
|
|
|
|
.else
|
1998-08-04 15:53:18 +00:00
|
|
|
.if defined(SENDMAIL_CF)
|
2001-02-22 04:11:52 +00:00
|
|
|
INSTALL_CF= ${SENDMAIL_CF}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2002-04-14 19:20:26 +00:00
|
|
|
.ifndef SENDMAIL_SET_USER_ID
|
|
|
|
.if defined(SENDMAIL_SUBMIT_MC)
|
|
|
|
INSTALL_SUBMIT_CF=${SENDMAIL_SUBMIT_MC:R}.cf
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2001-07-23 02:19:02 +00:00
|
|
|
DEST_CF= ${DESTDIR}/etc/mail/sendmail.cf
|
2002-04-14 19:20:26 +00:00
|
|
|
DEST_SUBMIT_CF= ${DESTDIR}/etc/mail/submit.cf
|
2001-07-23 02:19:02 +00:00
|
|
|
|
2002-04-14 19:20:26 +00:00
|
|
|
ALL+= ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
|
1998-08-04 15:53:18 +00:00
|
|
|
|
2002-02-24 02:38:23 +00:00
|
|
|
# Make sure we don't remove /etc/mail/sendmail.cf on make clean
|
|
|
|
# since this will break a running system during a buildworld.
|
|
|
|
.if defined(INSTALL_CF)
|
|
|
|
.if ${INSTALL_CF} != ${DEST_CF}
|
|
|
|
CLEANFILES+= ${INSTALL_CF}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2002-04-14 19:20:26 +00:00
|
|
|
.if defined(INSTALL_SUBMIT_CF)
|
|
|
|
.if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
|
|
|
|
CLEANFILES+= ${INSTALL_SUBMIT_CF}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2001-02-22 19:44:16 +00:00
|
|
|
# Additional .cf files to build
|
|
|
|
.if defined(SENDMAIL_ADDITIONAL_MC)
|
2001-11-20 03:41:05 +00:00
|
|
|
SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g}
|
|
|
|
ALL+= ${SENDMAIL_ADDITIONAL_CF}
|
2002-02-24 02:38:23 +00:00
|
|
|
CLEANFILES+= ${SENDMAIL_ADDITIONAL_CF}
|
2001-02-22 19:44:16 +00:00
|
|
|
.endif
|
|
|
|
|
2001-02-28 04:04:07 +00:00
|
|
|
all: ${ALL}
|
1998-08-04 15:53:18 +00:00
|
|
|
|
|
|
|
depend:
|
|
|
|
|
2002-04-14 19:20:26 +00:00
|
|
|
install: ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
|
2001-02-22 04:11:52 +00:00
|
|
|
.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
|
|
|
|
@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
|
|
|
|
@false
|
|
|
|
.endif
|
2001-02-28 04:04:07 +00:00
|
|
|
.if defined(INSTALL_CF)
|
2001-07-23 02:19:02 +00:00
|
|
|
.if ${INSTALL_CF} != ${DEST_CF}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
|
2001-07-23 02:19:02 +00:00
|
|
|
${DEST_CF}
|
|
|
|
.endif
|
2002-04-14 19:20:26 +00:00
|
|
|
.endif
|
2001-11-20 03:41:05 +00:00
|
|
|
.if defined(SENDMAIL_ADDITIONAL_CF)
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
|
2001-11-20 03:41:05 +00:00
|
|
|
${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail
|
|
|
|
.endif
|
2002-04-14 19:20:26 +00:00
|
|
|
.ifndef SENDMAIL_SET_USER_ID
|
|
|
|
.if defined(INSTALL_SUBMIT_CF)
|
|
|
|
.if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
|
2002-04-14 19:20:26 +00:00
|
|
|
${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
|
|
|
|
.endif
|
|
|
|
.endif
|
1998-08-04 15:53:18 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
# Helper for src/etc/Makefile
|
2002-04-14 19:20:26 +00:00
|
|
|
distribution: freebsd.cf freebsd.mc ${INSTALL_CF} ${INSTALL_SUBMIT_CF}
|
2001-02-22 04:11:52 +00:00
|
|
|
.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF))
|
|
|
|
@echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set"
|
|
|
|
@false
|
|
|
|
.endif
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \
|
2001-02-22 04:01:16 +00:00
|
|
|
${DESTDIR}/etc/mail/freebsd.mc
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
|
2001-02-22 04:01:16 +00:00
|
|
|
${DESTDIR}/etc/mail/freebsd.cf
|
2001-02-22 04:11:52 +00:00
|
|
|
.if defined(INSTALL_CF)
|
2001-07-23 02:19:02 +00:00
|
|
|
.if ${INSTALL_CF} != ${DEST_CF}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \
|
2001-07-23 02:19:02 +00:00
|
|
|
${DEST_CF}
|
|
|
|
.endif
|
2001-02-22 04:11:52 +00:00
|
|
|
.else
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
|
2001-07-23 02:19:02 +00:00
|
|
|
${DEST_CF}
|
2002-02-17 22:09:15 +00:00
|
|
|
.endif
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.mc \
|
2002-04-14 19:20:26 +00:00
|
|
|
${DESTDIR}/etc/mail/freebsd.submit.mc
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.cf \
|
2002-04-14 19:20:26 +00:00
|
|
|
${DESTDIR}/etc/mail/freebsd.submit.cf
|
|
|
|
.ifndef SENDMAIL_SET_USER_ID
|
|
|
|
.if defined(INSTALL_SUBMIT_CF)
|
|
|
|
.if ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
|
2002-04-14 19:20:26 +00:00
|
|
|
${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
|
|
|
|
.endif
|
|
|
|
.else
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.cf \
|
2002-04-14 19:20:26 +00:00
|
|
|
${DEST_SUBMIT_CF}
|
|
|
|
.endif
|
2001-02-22 04:11:52 +00:00
|
|
|
.endif
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \
|
2001-03-01 03:50:28 +00:00
|
|
|
${DESTDIR}/etc/mail/helpfile
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
|
2001-02-22 04:11:52 +00:00
|
|
|
${DESTDIR}/var/log/sendmail.st
|
1998-08-04 15:53:18 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|