Makefile revision 93853
1# @(#)Makefile 8.19 (Berkeley) 1/14/97 2# $FreeBSD: head/etc/sendmail/Makefile 93853 2002-04-05 02:30:49Z 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 26CLEANFILES+= freebsd.cf 27 28# Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf. 29# Warning! If set, this causes 'make install' to always copy it 30# over /etc/mail/sendmail.cf!!! 31# Caveat emptor! Be sure you want this before you enable it. 32.if defined(SENDMAIL_MC) 33INSTALL_CF= ${SENDMAIL_MC:R}.cf 34.else 35.if defined(SENDMAIL_CF) 36INSTALL_CF= ${SENDMAIL_CF} 37.endif 38.endif 39 40DEST_CF= ${DESTDIR}/etc/mail/sendmail.cf 41 42ALL+= ${INSTALL_CF} 43 44# Make sure we don't remove /etc/mail/sendmail.cf on make clean 45# since this will break a running system during a buildworld. 46.if defined(INSTALL_CF) 47.if ${INSTALL_CF} != ${DEST_CF} 48CLEANFILES+= ${INSTALL_CF} 49.endif 50.endif 51 52# Additional .cf files to build 53.if defined(SENDMAIL_ADDITIONAL_MC) 54SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:S/.mc$/.cf/g} 55ALL+= ${SENDMAIL_ADDITIONAL_CF} 56CLEANFILES+= ${SENDMAIL_ADDITIONAL_CF} 57.endif 58 59all: ${ALL} 60 61depend: 62 63install: ${INSTALL_CF} 64.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF)) 65 @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set" 66 @false 67.endif 68.if defined(INSTALL_CF) 69.if ${INSTALL_CF} != ${DEST_CF} 70 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \ 71 ${DEST_CF} 72.endif 73.if defined(SENDMAIL_ADDITIONAL_CF) 74 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 \ 75 ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail 76.endif 77.endif 78 79# Helper for src/etc/Makefile 80distribution: freebsd.cf freebsd.mc ${INSTALL_CF} 81.if (defined(SENDMAIL_MC) && defined(SENDMAIL_CF)) 82 @echo ">>> ERROR: Both SENDMAIL_CF and SENDMAIL_MC can not be set" 83 @false 84.endif 85 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/rc.sendmail \ 86 ${DESTDIR}/etc 87 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${.CURDIR}/freebsd.mc \ 88 ${DESTDIR}/etc/mail/freebsd.mc 89 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \ 90 ${DESTDIR}/etc/mail/freebsd.cf 91.if defined(INSTALL_CF) 92.if ${INSTALL_CF} != ${DEST_CF} 93 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${INSTALL_CF} \ 94 ${DEST_CF} 95.endif 96.else 97 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \ 98 ${DEST_CF} 99.endif 100.ifndef SENDMAIL_SET_USER_ID 101 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.mc \ 102 ${DESTDIR}/etc/mail/submit.mc 103 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${CFDIR}/cf/submit.cf \ 104 ${DESTDIR}/etc/mail/submit.cf 105.endif 106 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 ${SMDIR}/helpfile \ 107 ${DESTDIR}/etc/mail/helpfile 108 ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \ 109 ${DESTDIR}/var/log/sendmail.st 110 111.include <bsd.prog.mk> 112