Makefile (bee2fe7236bc50719d68149951a4f952ef4f5dcd) Makefile (76bfe4c335937e70cf4d9bf22d4f93f1c7d8116a)
1# @(#)Makefile 8.19 (Berkeley) 1/14/97
1# @(#)Makefile 8.19 (Berkeley) 1/14/97
2# $FreeBSD$
2# $Id$
3
3
4M4= m4
5CHMOD= chmod
6ROMODE= 444
7RM= rm -f
4M4= m4
5CFDIR= ${.CURDIR}/../../contrib/sendmail/cf
6CHMOD= chmod
7ROMODE= 444
8RM= rm -f
8
9
9SENDMAIL_DIR= ${.CURDIR}/../../contrib/sendmail
10SMDIR= ${SENDMAIL_DIR}/src
11SENDMAIL_CF_DIR?=${SENDMAIL_DIR}/cf
10.SUFFIXES: .mc .cf
12
11
13# this is overkill, but....
14M4FILES!= find ${SENDMAIL_CF_DIR} -type f -name '*.m4' -print
12.mc.cf:
13 $(RM) ${.TARGET}
14 (cd ${.CURDIR} && \
15 $(M4) -D_CF_DIR_=${CFDIR}/ ${CFDIR}/m4/cf.m4 ${@:R}.mc) > ${.TARGET}
16 $(CHMOD) $(ROMODE) ${.TARGET}
15
17
16.SUFFIXES: .mc .cf
18ALL= freebsd.cf
17
19
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
24DEST_CF= ${DESTDIR}/etc/mail/sendmail.cf
25DEST_SUBMIT_CF= ${DESTDIR}/etc/mail/submit.cf
26
27ALL= freebsd.cf freebsd.submit.cf
28CLEANFILES= 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!!!
20# Local sendmail.cf, may be set in /etc/make.conf. Warning! If set, this
21# causes 'make install' to always copy it over /etc/sendmail.cf!!!
33# Caveat emptor! Be sure you want this before you enable it.
22# 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)
37INSTALL_CF= ${SENDMAIL_MC:T:R}.cf
38ALL+= ${INSTALL_CF}
39CLEANFILES+= ${SENDMAIL_MC:T:R}.cf
40${INSTALL_CF}: ${SENDMAIL_MC}
41.elif defined(SENDMAIL_CF)
42ALL+= ${SENDMAIL_CF}
43INSTALL_CF= ${SENDMAIL_CF}
23.if defined(SENDMAIL_CF)
24ALL+= ${SENDMAIL_CF}
44.endif
45
25.endif
26
46.if !defined(SENDMAIL_SET_USER_ID) && defined(SENDMAIL_SUBMIT_MC)
47INSTALL_SUBMIT_CF= ${SENDMAIL_SUBMIT_MC:T:R}.cf
48ALL+= ${INSTALL_SUBMIT_CF}
49CLEANFILES+= ${INSTALL_SUBMIT_CF}
50${INSTALL_SUBMIT_CF}: ${SENDMAIL_SUBMIT_MC}
51.endif
27CLEANFILES+=$(ALL)
52
28
53# Additional .cf files to build.
54.if defined(SENDMAIL_ADDITIONAL_MC)
55SENDMAIL_ADDITIONAL_CF= ${SENDMAIL_ADDITIONAL_MC:T:S/.mc$/.cf/}
56ALL+= ${SENDMAIL_ADDITIONAL_CF}
57CLEANFILES+= ${SENDMAIL_ADDITIONAL_CF}
58.for mc in ${SENDMAIL_ADDITIONAL_MC}
59${mc:T:R}.cf: ${mc}
60.endfor
61.endif
29all: $(ALL)
62
30
63all: ${ALL}
31depend:
64
32
65distribution:
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
79install:
33install:
80.if defined(INSTALL_CF) && ${INSTALL_CF} != ${DEST_CF}
81 ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \
82 ${INSTALL_CF} ${DEST_CF}
34.if defined(SENDMAIL_CF)
35 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 ${SENDMAIL_CF} \
36 ${DESTDIR}/etc/sendmail.cf
83.endif
37.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
38
39# Helper for src/etc/Makefile
40etc-sendmail.cf: freebsd.cf
41 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 freebsd.cf \
42 ${DESTDIR}/etc/sendmail.cf
43
44# this is overkill, but....
45M4FILES!= find ${CFDIR} -type f -name '*.m4' -print
46
47$(ALL): $(M4FILES)
48
94.include <bsd.prog.mk>
49.include <bsd.prog.mk>