1#
2#  Makefile for configuration files.
3#
4#	$Id: Makefile,v 8.60 2005/06/14 02:16:34 gshapiro Exp $
5#
6
7#
8#  Create configuration files using "m4 ../m4/cf.m4 file.mc > file.cf";
9#  this may be easier than tweaking the Makefile.  You do need to
10#  have a fairly modern M4 available (GNU m4 works).  On SunOS, use
11#  /usr/5bin/m4.
12#
13
14# name of source for sendmail.cf (without extension)
15CF=	sendmail
16# name of source for submit.cf (without extension)
17SUBMIT=	submit
18# directory for .cf files
19MAILDIR=/etc/mail
20M4=	m4
21CFDIR=	..
22SED=  sed
23ECHO= echo
24CHMOD=	chmod
25ROMODE=	444
26RM=	rm -f
27# use our own install program; should be really confINSTALL
28INSTALL=../../devtools/bin/install.sh
29# CF file ownership/permissions
30CFOWN=root
31CFGRP=bin
32CFMODE=0444
33
34
35.SUFFIXES:  .mc .cf
36
37.mc.cf:
38	$(RM) $@
39	$(M4) ${CFDIR}/m4/cf.m4 $*.mc > $@ || ( $(RM) $@ && exit 1 )
40	$(ECHO) "### $*.mc ###" >>$@
41	$(SED) -e 's/^/# /' $*.mc >>$@
42	$(CHMOD) $(ROMODE) $@
43
44GENERIC=generic-bsd4.4.cf generic-hpux9.cf generic-hpux10.cf \
45		generic-linux.cf generic-mpeix.cf generic-nextstep3.3.cf \
46		generic-osf1.cf generic-solaris.cf \
47		generic-sunos4.1.cf generic-ultrix4.cf
48BERKELEY=cs-hpux9.cf cs-hpux10.cf cs-osf1.cf cs-solaris.cf \
49	cs-sunos4.1.cf cs-ultrix4.cf \
50	s2k-osf1.cf s2k-ultrix4.cf \
51	chez.cs.cf huginn.cs.cf mail.cs.cf mail.eecs.cf mailspool.cs.cf \
52	python.cs.cf ucbarpa.cf ucbvax.cf vangogh.cs.cf
53OTHER=	knecht.cf
54ALL=	submit.cf $(GENERIC) $(OTHER)
55
56all: $(ALL)
57
58berkeley: $(BERKELEY)
59generic: $(GENERIC)
60other: $(OTHER)
61
62clean cleandir:
63	$(RM) $(ALL) core
64
65install:
66	@echo "Before installing the .cf files please make sure you have read the"
67	@echo "instructions in the file ../../INSTALL.  You should have prepared the"
68	@echo "files \"submit.mc\" (supplied) and \"sendmail.mc\". Then you can use"
69	@echo ""
70	@echo "	make install-cf"
71	@echo ""
72	@echo "If you use a different name than \"sendmail\" for your main .mc file"
73
74	@echo "then you should use"
75	@echo ""
76	@echo "	make install-cf CF=config"
77	@echo ""
78	@echo "where \"config\" is the name of your main .mc file."
79
80install-cf:  install-sendmail-cf install-submit-cf
81
82install-sendmail-cf: $(CF).cf
83	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(CF).cf ${DESTDIR}$(MAILDIR)/sendmail.cf
84
85install-submit-cf: $(SUBMIT).cf
86	$(INSTALL) -c -o $(CFOWN) -g $(CFGRP) -m $(CFMODE) $(SUBMIT).cf ${DESTDIR}$(MAILDIR)/submit.cf
87
88depend:
89
90# this is overkill, but....
91M4FILES=\
92	${CFDIR}/domain/Berkeley.EDU.m4 \
93	${CFDIR}/domain/CS.Berkeley.EDU.m4 \
94	${CFDIR}/domain/EECS.Berkeley.EDU.m4 \
95	${CFDIR}/domain/S2K.Berkeley.EDU.m4 \
96	${CFDIR}/domain/berkeley-only.m4 \
97	${CFDIR}/domain/generic.m4 \
98	${CFDIR}/feature/accept_unqualified_senders.m4 \
99	${CFDIR}/feature/accept_unresolvable_domains.m4 \
100	${CFDIR}/feature/access_db.m4 \
101	${CFDIR}/feature/allmasquerade.m4 \
102	${CFDIR}/feature/always_add_domain.m4 \
103	${CFDIR}/feature/bestmx_is_local.m4 \
104	${CFDIR}/feature/bitdomain.m4 \
105	${CFDIR}/feature/blacklist_recipients.m4 \
106	${CFDIR}/feature/conncontrol.m4 \
107	${CFDIR}/feature/dnsbl.m4 \
108	${CFDIR}/feature/domaintable.m4 \
109	${CFDIR}/feature/generics_entire_domain.m4 \
110	${CFDIR}/feature/genericstable.m4 \
111	${CFDIR}/feature/ldap_routing.m4 \
112	${CFDIR}/feature/limited_masquerade.m4 \
113	${CFDIR}/feature/local_lmtp.m4 \
114	${CFDIR}/feature/local_procmail.m4 \
115	${CFDIR}/feature/loose_relay_check.m4 \
116	${CFDIR}/feature/mailertable.m4 \
117	${CFDIR}/feature/masquerade_entire_domain.m4 \
118	${CFDIR}/feature/masquerade_envelope.m4 \
119	${CFDIR}/feature/no_default_msa.m4 \
120	${CFDIR}/feature/nocanonify.m4 \
121	${CFDIR}/feature/notsticky.m4 \
122	${CFDIR}/feature/nouucp.m4 \
123	${CFDIR}/feature/nullclient.m4 \
124	${CFDIR}/feature/promiscuous_relay.m4 \
125	${CFDIR}/feature/redirect.m4 \
126	${CFDIR}/feature/ratecontrol.m4 \
127	${CFDIR}/feature/relay_based_on_MX.m4 \
128	${CFDIR}/feature/relay_entire_domain.m4 \
129	${CFDIR}/feature/relay_hosts_only.m4 \
130	${CFDIR}/feature/relay_local_from.m4 \
131	${CFDIR}/feature/relay_mail_from.m4 \
132	${CFDIR}/feature/smrsh.m4 \
133	${CFDIR}/feature/stickyhost.m4 \
134	${CFDIR}/feature/use_ct_file.m4 \
135	${CFDIR}/feature/use_cw_file.m4 \
136	${CFDIR}/feature/uucpdomain.m4 \
137	${CFDIR}/feature/virtuser_entire_domain.m4 \
138	${CFDIR}/feature/virtusertable.m4 \
139	${CFDIR}/hack/cssubdomain.m4 \
140	${CFDIR}/m4/cf.m4 \
141	${CFDIR}/m4/cfhead.m4 \
142	${CFDIR}/m4/proto.m4 \
143	${CFDIR}/m4/version.m4 \
144	${CFDIR}/mailer/cyrus.m4 \
145	${CFDIR}/mailer/fax.m4 \
146	${CFDIR}/mailer/local.m4 \
147	${CFDIR}/mailer/mail11.m4 \
148	${CFDIR}/mailer/phquery.m4 \
149	${CFDIR}/mailer/pop.m4 \
150	${CFDIR}/mailer/procmail.m4 \
151	${CFDIR}/mailer/qpage.m4 \
152	${CFDIR}/mailer/smtp.m4 \
153	${CFDIR}/mailer/usenet.m4 \
154	${CFDIR}/mailer/uucp.m4 \
155	${CFDIR}/ostype/aix3.m4 \
156	${CFDIR}/ostype/aix4.m4 \
157	${CFDIR}/ostype/altos.m4 \
158	${CFDIR}/ostype/amdahl-uts.m4 \
159	${CFDIR}/ostype/a-ux.m4 \
160	${CFDIR}/ostype/bsd4.3.m4 \
161	${CFDIR}/ostype/bsd4.4.m4 \
162	${CFDIR}/ostype/bsdi.m4 \
163	${CFDIR}/ostype/bsdi1.0.m4 \
164	${CFDIR}/ostype/bsdi2.0.m4 \
165	${CFDIR}/ostype/dgux.m4 \
166	${CFDIR}/ostype/domainos.m4 \
167	${CFDIR}/ostype/dragonfly.m4 \
168	${CFDIR}/ostype/dynix3.2.m4 \
169	${CFDIR}/ostype/freebsd4.m4 \
170	${CFDIR}/ostype/freebsd5.m4 \
171	${CFDIR}/ostype/freebsd6.m4 \
172	${CFDIR}/ostype/gnu.m4 \
173	${CFDIR}/ostype/hpux10.m4 \
174	${CFDIR}/ostype/hpux11.m4 \
175	${CFDIR}/ostype/hpux9.m4 \
176	${CFDIR}/ostype/irix4.m4 \
177	${CFDIR}/ostype/irix5.m4 \
178	${CFDIR}/ostype/irix6.m4 \
179	${CFDIR}/ostype/isc4.1.m4 \
180	${CFDIR}/ostype/linux.m4 \
181	${CFDIR}/ostype/maxion.m4 \
182	${CFDIR}/ostype/mklinux.m4 \
183	${CFDIR}/ostype/mpeix.m4 \
184	${CFDIR}/ostype/nextstep.m4 \
185	${CFDIR}/ostype/openbsd.m4 \
186	${CFDIR}/ostype/osf1.m4 \
187	${CFDIR}/ostype/powerux.m4 \
188	${CFDIR}/ostype/ptx2.m4 \
189	${CFDIR}/ostype/qnx.m4 \
190	${CFDIR}/ostype/riscos4.5.m4 \
191	${CFDIR}/ostype/sco-uw-2.1.m4 \
192	${CFDIR}/ostype/sco3.2.m4 \
193	${CFDIR}/ostype/sinix.m4 \
194	${CFDIR}/ostype/solaris2.m4 \
195	${CFDIR}/ostype/solaris2.ml.m4 \
196	${CFDIR}/ostype/solaris2.pre5.m4 \
197	${CFDIR}/ostype/solaris8.m4 \
198	${CFDIR}/ostype/sunos3.5.m4 \
199	${CFDIR}/ostype/sunos4.1.m4 \
200	${CFDIR}/ostype/svr4.m4 \
201	${CFDIR}/ostype/ultrix4.m4 \
202	${CFDIR}/ostype/unixware7.m4 \
203	${CFDIR}/ostype/unknown.m4 \
204	${CFDIR}/ostype/uxpds.m4
205
206$(ALL): $(M4FILES)
207$(BERKELEY): $(M4FILES)
208$(GENERIC): $(M4FILES)
209$(OTHER): $(M4FILES)
210