138032Speter#
238032Speter#  Makefile for configuration files.
338032Speter#
4266527Sgshapiro#	$Id: Makefile,v 8.60 2005-06-14 02:16:34 gshapiro Exp $
538032Speter#
638032Speter
738032Speter#
838032Speter#  Create configuration files using "m4 ../m4/cf.m4 file.mc > file.cf";
938032Speter#  this may be easier than tweaking the Makefile.  You do need to
1038032Speter#  have a fairly modern M4 available (GNU m4 works).  On SunOS, use
1138032Speter#  /usr/5bin/m4.
1238032Speter#
1338032Speter
1490792Sgshapiro# name of source for sendmail.cf (without extension)
1590792SgshapiroCF=	sendmail
1690792Sgshapiro# name of source for submit.cf (without extension)
1790792SgshapiroSUBMIT=	submit
1890792Sgshapiro# directory for .cf files
1990792SgshapiroMAILDIR=/etc/mail
2038032SpeterM4=	m4
2138032SpeterCFDIR=	..
22132943SgshapiroSED=  sed
23132943SgshapiroECHO= echo
2438032SpeterCHMOD=	chmod
2538032SpeterROMODE=	444
2638032SpeterRM=	rm -f
2790792Sgshapiro# use our own install program; should be really confINSTALL
2890792SgshapiroINSTALL=../../devtools/bin/install.sh
2990792Sgshapiro# CF file ownership/permissions
3090792SgshapiroCFOWN=root
3190792SgshapiroCFGRP=bin
3290792SgshapiroCFMODE=0444
3338032Speter
3490792Sgshapiro
3538032Speter.SUFFIXES:  .mc .cf
3638032Speter
3738032Speter.mc.cf:
3838032Speter	$(RM) $@
3938032Speter	$(M4) ${CFDIR}/m4/cf.m4 $*.mc > $@ || ( $(RM) $@ && exit 1 )
40132943Sgshapiro	$(ECHO) "### $*.mc ###" >>$@
41132943Sgshapiro	$(SED) -e 's/^/# /' $*.mc >>$@
4238032Speter	$(CHMOD) $(ROMODE) $@
4338032Speter
4464562SgshapiroGENERIC=generic-bsd4.4.cf generic-hpux9.cf generic-hpux10.cf \
4590792Sgshapiro		generic-linux.cf generic-mpeix.cf generic-nextstep3.3.cf \
4690792Sgshapiro		generic-osf1.cf generic-solaris.cf \
4764562Sgshapiro		generic-sunos4.1.cf generic-ultrix4.cf
4890792SgshapiroBERKELEY=cs-hpux9.cf cs-hpux10.cf cs-osf1.cf cs-solaris.cf \
4964562Sgshapiro	cs-sunos4.1.cf cs-ultrix4.cf \
5038032Speter	s2k-osf1.cf s2k-ultrix4.cf \
5138032Speter	chez.cs.cf huginn.cs.cf mail.cs.cf mail.eecs.cf mailspool.cs.cf \
5264562Sgshapiro	python.cs.cf ucbarpa.cf ucbvax.cf vangogh.cs.cf
5364562SgshapiroOTHER=	knecht.cf
5490792SgshapiroALL=	submit.cf $(GENERIC) $(OTHER)
5538032Speter
5638032Speterall: $(ALL)
5738032Speter
5864562Sgshapiroberkeley: $(BERKELEY)
5964562Sgshapirogeneric: $(GENERIC)
6064562Sgshapiroother: $(OTHER)
6164562Sgshapiro
6238032Speterclean cleandir:
6338032Speter	$(RM) $(ALL) core
6438032Speter
6590792Sgshapiroinstall:
6690792Sgshapiro	@echo "Before installing the .cf files please make sure you have read the"
6790792Sgshapiro	@echo "instructions in the file ../../INSTALL.  You should have prepared the"
6890792Sgshapiro	@echo "files \"submit.mc\" (supplied) and \"sendmail.mc\". Then you can use"
6990792Sgshapiro	@echo ""
7090792Sgshapiro	@echo "	make install-cf"
7190792Sgshapiro	@echo ""
7290792Sgshapiro	@echo "If you use a different name than \"sendmail\" for your main .mc file"
7338032Speter
7490792Sgshapiro	@echo "then you should use"
7590792Sgshapiro	@echo ""
7690792Sgshapiro	@echo "	make install-cf CF=config"
7790792Sgshapiro	@echo ""
7890792Sgshapiro	@echo "where \"config\" is the name of your main .mc file."
7990792Sgshapiro
8090792Sgshapiroinstall-cf:  install-sendmail-cf install-submit-cf
8190792Sgshapiro
8290792Sgshapiroinstall-sendmail-cf: $(CF).cf
8390792Sgshapiro	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
8490792Sgshapiro
8590792Sgshapiroinstall-submit-cf: $(SUBMIT).cf
8690792Sgshapiro	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
8790792Sgshapiro
8890792Sgshapirodepend:
8990792Sgshapiro
9038032Speter# this is overkill, but....
9138032SpeterM4FILES=\
9238032Speter	${CFDIR}/domain/Berkeley.EDU.m4 \
9338032Speter	${CFDIR}/domain/CS.Berkeley.EDU.m4 \
9438032Speter	${CFDIR}/domain/EECS.Berkeley.EDU.m4 \
9538032Speter	${CFDIR}/domain/S2K.Berkeley.EDU.m4 \
9638032Speter	${CFDIR}/domain/berkeley-only.m4 \
9738032Speter	${CFDIR}/domain/generic.m4 \
9838032Speter	${CFDIR}/feature/accept_unqualified_senders.m4 \
9938032Speter	${CFDIR}/feature/accept_unresolvable_domains.m4 \
10038032Speter	${CFDIR}/feature/access_db.m4 \
10138032Speter	${CFDIR}/feature/allmasquerade.m4 \
10238032Speter	${CFDIR}/feature/always_add_domain.m4 \
103285229Sgshapiro	${CFDIR}/feature/bcc.m4 \
10438032Speter	${CFDIR}/feature/bestmx_is_local.m4 \
10538032Speter	${CFDIR}/feature/bitdomain.m4 \
106363466Sgshapiro	${CFDIR}/feature/blocklist_recipients.m4 \
107132943Sgshapiro	${CFDIR}/feature/conncontrol.m4 \
10864562Sgshapiro	${CFDIR}/feature/dnsbl.m4 \
10938032Speter	${CFDIR}/feature/domaintable.m4 \
11064562Sgshapiro	${CFDIR}/feature/generics_entire_domain.m4 \
11138032Speter	${CFDIR}/feature/genericstable.m4 \
11264562Sgshapiro	${CFDIR}/feature/ldap_routing.m4 \
11338032Speter	${CFDIR}/feature/limited_masquerade.m4 \
11438032Speter	${CFDIR}/feature/local_lmtp.m4 \
11538032Speter	${CFDIR}/feature/local_procmail.m4 \
11664562Sgshapiro	${CFDIR}/feature/loose_relay_check.m4 \
11738032Speter	${CFDIR}/feature/mailertable.m4 \
11838032Speter	${CFDIR}/feature/masquerade_entire_domain.m4 \
11938032Speter	${CFDIR}/feature/masquerade_envelope.m4 \
12064562Sgshapiro	${CFDIR}/feature/no_default_msa.m4 \
12138032Speter	${CFDIR}/feature/nocanonify.m4 \
122285229Sgshapiro	${CFDIR}/feature/nopercenthack.m4 \
12338032Speter	${CFDIR}/feature/notsticky.m4 \
12438032Speter	${CFDIR}/feature/nouucp.m4 \
12538032Speter	${CFDIR}/feature/nullclient.m4 \
126285229Sgshapiro	${CFDIR}/feature/prefixmod.m4 \
12738032Speter	${CFDIR}/feature/promiscuous_relay.m4 \
12838032Speter	${CFDIR}/feature/redirect.m4 \
129132943Sgshapiro	${CFDIR}/feature/ratecontrol.m4 \
13038032Speter	${CFDIR}/feature/relay_based_on_MX.m4 \
13138032Speter	${CFDIR}/feature/relay_entire_domain.m4 \
13238032Speter	${CFDIR}/feature/relay_hosts_only.m4 \
13338032Speter	${CFDIR}/feature/relay_local_from.m4 \
13464562Sgshapiro	${CFDIR}/feature/relay_mail_from.m4 \
13538032Speter	${CFDIR}/feature/smrsh.m4 \
13638032Speter	${CFDIR}/feature/stickyhost.m4 \
137285229Sgshapiro	${CFDIR}/feature/tls_session_features.m4 \
13838032Speter	${CFDIR}/feature/use_ct_file.m4 \
13938032Speter	${CFDIR}/feature/use_cw_file.m4 \
14038032Speter	${CFDIR}/feature/uucpdomain.m4 \
14164562Sgshapiro	${CFDIR}/feature/virtuser_entire_domain.m4 \
14238032Speter	${CFDIR}/feature/virtusertable.m4 \
14338032Speter	${CFDIR}/hack/cssubdomain.m4 \
144285229Sgshapiro	${CFDIR}/hack/xconnect.m4 \
14538032Speter	${CFDIR}/m4/cf.m4 \
14638032Speter	${CFDIR}/m4/cfhead.m4 \
14738032Speter	${CFDIR}/m4/proto.m4 \
14838032Speter	${CFDIR}/m4/version.m4 \
14938032Speter	${CFDIR}/mailer/cyrus.m4 \
15038032Speter	${CFDIR}/mailer/fax.m4 \
15138032Speter	${CFDIR}/mailer/local.m4 \
15238032Speter	${CFDIR}/mailer/mail11.m4 \
15364562Sgshapiro	${CFDIR}/mailer/phquery.m4 \
15438032Speter	${CFDIR}/mailer/pop.m4 \
15538032Speter	${CFDIR}/mailer/procmail.m4 \
15664562Sgshapiro	${CFDIR}/mailer/qpage.m4 \
15738032Speter	${CFDIR}/mailer/smtp.m4 \
15838032Speter	${CFDIR}/mailer/usenet.m4 \
15938032Speter	${CFDIR}/mailer/uucp.m4 \
16038032Speter	${CFDIR}/ostype/aix3.m4 \
16164562Sgshapiro	${CFDIR}/ostype/aix4.m4 \
16238032Speter	${CFDIR}/ostype/altos.m4 \
16338032Speter	${CFDIR}/ostype/amdahl-uts.m4 \
16490792Sgshapiro	${CFDIR}/ostype/a-ux.m4 \
16538032Speter	${CFDIR}/ostype/bsd4.3.m4 \
16638032Speter	${CFDIR}/ostype/bsd4.4.m4 \
16764562Sgshapiro	${CFDIR}/ostype/bsdi.m4 \
16838032Speter	${CFDIR}/ostype/bsdi1.0.m4 \
16938032Speter	${CFDIR}/ostype/bsdi2.0.m4 \
17038032Speter	${CFDIR}/ostype/dgux.m4 \
17138032Speter	${CFDIR}/ostype/domainos.m4 \
172141858Sgshapiro	${CFDIR}/ostype/dragonfly.m4 \
17338032Speter	${CFDIR}/ostype/dynix3.2.m4 \
17490792Sgshapiro	${CFDIR}/ostype/freebsd4.m4 \
17590792Sgshapiro	${CFDIR}/ostype/freebsd5.m4 \
176157001Sgshapiro	${CFDIR}/ostype/freebsd6.m4 \
17764562Sgshapiro	${CFDIR}/ostype/gnu.m4 \
17838032Speter	${CFDIR}/ostype/hpux10.m4 \
17964562Sgshapiro	${CFDIR}/ostype/hpux11.m4 \
18038032Speter	${CFDIR}/ostype/hpux9.m4 \
18138032Speter	${CFDIR}/ostype/irix4.m4 \
18238032Speter	${CFDIR}/ostype/irix5.m4 \
18338032Speter	${CFDIR}/ostype/irix6.m4 \
18464562Sgshapiro	${CFDIR}/ostype/isc4.1.m4 \
18538032Speter	${CFDIR}/ostype/linux.m4 \
18638032Speter	${CFDIR}/ostype/maxion.m4 \
18738032Speter	${CFDIR}/ostype/mklinux.m4 \
18890792Sgshapiro	${CFDIR}/ostype/mpeix.m4 \
18938032Speter	${CFDIR}/ostype/nextstep.m4 \
19064562Sgshapiro	${CFDIR}/ostype/openbsd.m4 \
19138032Speter	${CFDIR}/ostype/osf1.m4 \
19238032Speter	${CFDIR}/ostype/powerux.m4 \
19338032Speter	${CFDIR}/ostype/ptx2.m4 \
19438032Speter	${CFDIR}/ostype/qnx.m4 \
19538032Speter	${CFDIR}/ostype/riscos4.5.m4 \
19638032Speter	${CFDIR}/ostype/sco-uw-2.1.m4 \
19738032Speter	${CFDIR}/ostype/sco3.2.m4 \
19864562Sgshapiro	${CFDIR}/ostype/sinix.m4 \
19938032Speter	${CFDIR}/ostype/solaris2.m4 \
20038032Speter	${CFDIR}/ostype/solaris2.ml.m4 \
20164562Sgshapiro	${CFDIR}/ostype/solaris2.pre5.m4 \
20266494Sgshapiro	${CFDIR}/ostype/solaris8.m4 \
20338032Speter	${CFDIR}/ostype/sunos3.5.m4 \
20438032Speter	${CFDIR}/ostype/sunos4.1.m4 \
20538032Speter	${CFDIR}/ostype/svr4.m4 \
20638032Speter	${CFDIR}/ostype/ultrix4.m4 \
20764562Sgshapiro	${CFDIR}/ostype/unixware7.m4 \
20838032Speter	${CFDIR}/ostype/unknown.m4 \
20964562Sgshapiro	${CFDIR}/ostype/uxpds.m4
21038032Speter
21164562Sgshapiro$(ALL): $(M4FILES)
21264562Sgshapiro$(BERKELEY): $(M4FILES)
21364562Sgshapiro$(GENERIC): $(M4FILES)
21464562Sgshapiro$(OTHER): $(M4FILES)
215