]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/sendmail/Makefile
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / sendmail / Makefile
1 #       @(#)Makefile    8.19 (Berkeley) 1/14/97
2 # $FreeBSD$
3
4 M4=             m4
5 CHMOD=          chmod
6 ROMODE=         444
7 RM=             rm -f
8
9 SENDMAIL_DIR=   ${.CURDIR}/../../contrib/sendmail
10 SMDIR=          ${SENDMAIL_DIR}/src
11 SENDMAIL_CF_DIR?=${SENDMAIL_DIR}/cf
12
13 # this is overkill, but....
14 M4FILES!=       find ${SENDMAIL_CF_DIR} -type f -name '*.m4' -print
15
16 .SUFFIXES: .mc .cf
17
18 .mc.cf: ${M4FILES}
19         ${RM} ${.TARGET}
20         ${M4} -D_CF_DIR_=${SENDMAIL_CF_DIR}/ ${SENDMAIL_M4_FLAGS} \
21             ${SENDMAIL_CF_DIR}/m4/cf.m4 ${.IMPSRC} > ${.TARGET}
22         ${CHMOD} ${ROMODE} ${.TARGET}
23
24 DEST_CF=        ${DESTDIR}/etc/mail/sendmail.cf
25 DEST_SUBMIT_CF= ${DESTDIR}/etc/mail/submit.cf
26
27 ALL=            freebsd.cf freebsd.submit.cf
28 CLEANFILES=     freebsd.cf freebsd.submit.cf
29
30 # Local SENDMAIL_MC or SENDMAIL_CF may be set in /etc/make.conf.
31 # Warning!  If set, this causes 'make install' to always copy it
32 # over /etc/mail/sendmail.cf!!!
33 # Caveat emptor!  Be sure you want this before you enable it.
34 .if defined(SENDMAIL_MC) && defined(SENDMAIL_CF)
35 .error Both SENDMAIL_MC and SENDMAIL_CF cannot be set.
36 .elif defined(SENDMAIL_MC)
37 INSTALL_CF=     ${SENDMAIL_MC:T:R}.cf
38 ALL+=           ${INSTALL_CF}
39 CLEANFILES+=    ${SENDMAIL_MC:T:R}.cf
40 ${INSTALL_CF}: ${SENDMAIL_MC}
41 .elif defined(SENDMAIL_CF)
42 ALL+=           ${SENDMAIL_CF}
43 INSTALL_CF=     ${SENDMAIL_CF}
44 .endif
45
46 .if !defined(SENDMAIL_SET_USER_ID) && defined(SENDMAIL_SUBMIT_MC)
47 INSTALL_SUBMIT_CF= ${SENDMAIL_SUBMIT_MC:T:R}.cf
48 ALL+=           ${INSTALL_SUBMIT_CF}
49 CLEANFILES+=    ${INSTALL_SUBMIT_CF}
50 ${INSTALL_SUBMIT_CF}: ${SENDMAIL_SUBMIT_MC}
51 .endif
52
53 # Additional .cf files to build.
54 .if defined(SENDMAIL_ADDITIONAL_MC)
55 SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:T:S/.mc$/.cf/}
56 ALL+=           ${SENDMAIL_ADDITIONAL_CF}
57 CLEANFILES+=    ${SENDMAIL_ADDITIONAL_CF}
58 .for mc in ${SENDMAIL_ADDITIONAL_MC}
59 ${mc:T:R}.cf: ${mc}
60 .endfor
61 .endif
62
63 all: ${ALL}
64
65 distribution:
66         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
67             ${.CURDIR}/freebsd.mc freebsd.cf ${DESTDIR}/etc/mail
68         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
69             ${.CURDIR}/freebsd.submit.mc freebsd.submit.cf ${DESTDIR}/etc/mail
70         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
71             ${SMDIR}/helpfile ${DESTDIR}/etc/mail
72         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 640 \
73             /dev/null ${DESTDIR}/var/log/sendmail.st
74         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
75             freebsd.cf ${DEST_CF}
76         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
77             freebsd.submit.cf ${DEST_SUBMIT_CF}
78
79 install:
80 .if defined(INSTALL_CF) && ${INSTALL_CF} != ${DEST_CF}
81         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
82             ${INSTALL_CF} ${DEST_CF}
83 .endif
84 .if defined(SENDMAIL_ADDITIONAL_CF)
85         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
86             ${SENDMAIL_ADDITIONAL_CF} ${DESTDIR}/etc/mail
87 .endif
88 .if !defined(SENDMAIL_SET_USER_ID) && \
89     defined(INSTALL_SUBMIT_CF) && ${INSTALL_SUBMIT_CF} != ${DEST_SUBMIT_CF}
90         ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
91             ${INSTALL_SUBMIT_CF} ${DEST_SUBMIT_CF}
92 .endif
93
94 .include <bsd.prog.mk>