1SHELL	= /bin/sh
2
3# For now, just hard-coded rules for daemons, commands, config files.
4
5DAEMONS	= man8/bounce.8 man8/defer.8 man8/cleanup.8 man8/error.8 man8/local.8 \
6	man8/lmtp.8 man8/master.8 man8/pickup.8 man8/pipe.8 man8/qmgr.8 \
7	man8/showq.8 man8/smtp.8 man8/smtpd.8 man8/trivial-rewrite.8 \
8	man8/oqmgr.8 man8/spawn.8 man8/flush.8 man8/virtual.8 man8/qmqpd.8 \
9	man8/verify.8 man8/trace.8 man8/proxymap.8 man8/anvil.8 \
10	man8/scache.8 man8/discard.8 man8/tlsmgr.8 man8/postscreen.8 \
11	man8/dnsblog.8 man8/tlsproxy.8
12COMMANDS= man1/postalias.1 man1/postcat.1 man1/postconf.1 man1/postfix.1 \
13	man1/postkick.1 man1/postlock.1 man1/postlog.1 man1/postdrop.1 \
14	man1/postmap.1 man1/postmulti.1 man1/postqueue.1 man1/postsuper.1 \
15	man1/sendmail.1 man1/mailq.1 man1/newaliases.1
16CONFIG	= man5/access.5 man5/aliases.5 man5/canonical.5 man5/relocated.5 \
17	man5/transport.5 man5/virtual.5 man5/pcre_table.5 man5/regexp_table.5 \
18	man5/cidr_table.5 man5/tcp_table.5 man5/header_checks.5 \
19	man5/body_checks.5 man5/ldap_table.5 man5/mysql_table.5 \
20	man5/pgsql_table.5 man5/master.5 man5/nisplus_table.5 \
21	man5/generic.5 man5/bounce.5 man5/postfix-wrapper.5 \
22	man5/sqlite_table.5
23TOOLS	= man1/smtp-sink.1 man1/smtp-source.1 man1/qmqp-sink.1 \
24	man1/qmqp-source.1 man1/qshape.1
25
26update:	$(DAEMONS) $(COMMANDS) $(CONFIG) $(TOOLS)
27
28clean:
29	rm -f cat?/*
30
31tidy:	clean
32
33clobber:
34	rm -f $(DAEMONS) $(COMMANDS) $(CONFIG)
35
36man8/bounce.8: ../src/bounce/bounce.c
37	../mantools/fixman ../proto/postconf.proto $? >junk && \
38	    (cmp -s junk $? || mv junk $?) && rm -f junk
39	../mantools/srctoman $? >$@
40
41man8/defer.8:
42	echo .so man8/bounce.8 >$@
43
44man8/cleanup.8: ../src/cleanup/cleanup.c
45	../mantools/fixman ../proto/postconf.proto $? >junk && \
46	    (cmp -s junk $? || mv junk $?) && rm -f junk
47	../mantools/srctoman $? >$@
48
49man8/anvil.8: ../src/anvil/anvil.c
50	../mantools/fixman ../proto/postconf.proto $? >junk && \
51	    (cmp -s junk $? || mv junk $?) && rm -f junk
52	../mantools/srctoman $? >$@
53
54man8/scache.8: ../src/scache/scache.c
55	../mantools/fixman ../proto/postconf.proto $? >junk && \
56	    (cmp -s junk $? || mv junk $?) && rm -f junk
57	../mantools/srctoman $? >$@
58
59man8/discard.8: ../src/discard/discard.c
60	../mantools/fixman ../proto/postconf.proto $? >junk && \
61	    (cmp -s junk $? || mv junk $?) && rm -f junk
62	../mantools/srctoman $? >$@
63
64man8/dnsblog.8: ../src/dnsblog/dnsblog.c
65	../mantools/fixman ../proto/postconf.proto $? >junk && \
66	    (cmp -s junk $? || mv junk $?) && rm -f junk
67	../mantools/srctoman $? >$@
68
69man8/error.8: ../src/error/error.c
70	../mantools/fixman ../proto/postconf.proto $? >junk && \
71	    (cmp -s junk $? || mv junk $?) && rm -f junk
72	../mantools/srctoman $? >$@
73
74man8/flush.8: ../src/flush/flush.c
75	../mantools/fixman ../proto/postconf.proto $? >junk && \
76	    (cmp -s junk $? || mv junk $?) && rm -f junk
77	../mantools/srctoman $? >$@
78
79man8/local.8: ../src/local/local.c
80	../mantools/fixman ../proto/postconf.proto $? >junk && \
81	    (cmp -s junk $? || mv junk $?) && rm -f junk
82	../mantools/srctoman $? >$@
83
84man8/lmtp.8:
85	echo .so man8/smtp.8 >$@
86
87man8/master.8: ../src/master/master.c
88	../mantools/fixman ../proto/postconf.proto $? >junk && \
89	    (cmp -s junk $? || mv junk $?) && rm -f junk
90	../mantools/srctoman $? >$@
91
92man8/oqmgr.8: ../src/oqmgr/qmgr.c
93	../mantools/fixman ../proto/postconf.proto $? >junk && \
94	    (cmp -s junk $? || mv junk $?) && rm -f junk
95	../mantools/srctoman $? | \
96		sed -e 's/qmgr[^_]/o&/' \
97		    -e 's/qmgr$$/o&/' \
98		    -e 's/QMGR[^_]/O&/' >$@
99
100man8/pickup.8: ../src/pickup/pickup.c
101	../mantools/fixman ../proto/postconf.proto $? >junk && \
102	    (cmp -s junk $? || mv junk $?) && rm -f junk
103	../mantools/srctoman $? >$@
104
105man8/pipe.8: ../src/pipe/pipe.c
106	../mantools/fixman ../proto/postconf.proto $? >junk && \
107	    (cmp -s junk $? || mv junk $?) && rm -f junk
108	../mantools/srctoman $? >$@
109
110man8/postscreen.8: ../src/postscreen/postscreen.c
111	../mantools/fixman ../proto/postconf.proto $? >junk && \
112	    (cmp -s junk $? || mv junk $?) && rm -f junk
113	../mantools/srctoman $? >$@
114
115man8/proxymap.8: ../src/proxymap/proxymap.c
116	../mantools/fixman ../proto/postconf.proto $? >junk && \
117	    (cmp -s junk $? || mv junk $?) && rm -f junk
118	../mantools/srctoman $? >$@
119
120man8/qmgr.8: ../src/qmgr/qmgr.c
121	../mantools/fixman ../proto/postconf.proto $? >junk && \
122	    (cmp -s junk $? || mv junk $?) && rm -f junk
123	../mantools/srctoman $? >$@
124
125man8/qmqpd.8: ../src/qmqpd/qmqpd.c
126	../mantools/fixman ../proto/postconf.proto $? >junk && \
127	    (cmp -s junk $? || mv junk $?) && rm -f junk
128	../mantools/srctoman $? >$@
129
130man8/showq.8: ../src/showq/showq.c
131	../mantools/fixman ../proto/postconf.proto $? >junk && \
132	    (cmp -s junk $? || mv junk $?) && rm -f junk
133	../mantools/srctoman $? >$@
134
135man8/spawn.8: ../src/spawn/spawn.c
136	../mantools/fixman ../proto/postconf.proto $? >junk && \
137	    (cmp -s junk $? || mv junk $?) && rm -f junk
138	../mantools/srctoman $? >$@
139
140man8/smtp.8: ../src/smtp/smtp.c
141	../mantools/fixman ../proto/postconf.proto $? >junk && \
142	    (cmp -s junk $? || mv junk $?) && rm -f junk
143	../mantools/srctoman $? >$@
144
145man8/smtpd.8: ../src/smtpd/smtpd.c
146	../mantools/fixman ../proto/postconf.proto $? >junk && \
147	    (cmp -s junk $? || mv junk $?) && rm -f junk
148	../mantools/srctoman $? >$@
149
150man8/tlsproxy.8: ../src/tlsproxy/tlsproxy.c
151	../mantools/fixman ../proto/postconf.proto $? >junk && \
152	    (cmp -s junk $? || mv junk $?) && rm -f junk
153	../mantools/srctoman $? >$@
154
155man8/virtual.8: ../src/virtual/virtual.c
156	../mantools/fixman ../proto/postconf.proto $? >junk && \
157	    (cmp -s junk $? || mv junk $?) && rm -f junk
158	../mantools/srctoman $? >$@
159
160man8/verify.8: ../src/verify/verify.c
161	../mantools/fixman ../proto/postconf.proto $? >junk && \
162	    (cmp -s junk $? || mv junk $?) && rm -f junk
163	../mantools/srctoman $? >$@
164
165man8/trace.8:
166	echo .so man8/bounce.8 >$@
167
168man8/tlsmgr.8: ../src/tlsmgr/tlsmgr.c
169	../mantools/fixman ../proto/postconf.proto $? >junk && \
170	    (cmp -s junk $? || mv junk $?) && rm -f junk
171	../mantools/srctoman $? >$@
172
173man8/trivial-rewrite.8: ../src/trivial-rewrite/trivial-rewrite.c
174	../mantools/fixman ../proto/postconf.proto $? >junk && \
175	    (cmp -s junk $? || mv junk $?) && rm -f junk
176	../mantools/srctoman $? >$@
177
178man1/postalias.1: ../src/postalias/postalias.c
179	../mantools/fixman ../proto/postconf.proto $? >junk && \
180	    (cmp -s junk $? || mv junk $?) && rm -f junk
181	../mantools/srctoman $? >$@
182
183man1/postcat.1: ../src/postcat/postcat.c
184	../mantools/fixman ../proto/postconf.proto $? >junk && \
185	    (cmp -s junk $? || mv junk $?) && rm -f junk
186	../mantools/srctoman $? >$@
187
188man1/postconf.1: ../src/postconf/postconf.c
189	../mantools/fixman ../proto/postconf.proto $? >junk && \
190	    (cmp -s junk $? || mv junk $?) && rm -f junk
191	../mantools/srctoman $? >$@
192
193man1/postdrop.1: ../src/postdrop/postdrop.c
194	../mantools/fixman ../proto/postconf.proto $? >junk && \
195	    (cmp -s junk $? || mv junk $?) && rm -f junk
196	../mantools/srctoman $? >$@
197
198man1/postfix.1: ../src/postfix/postfix.c
199	../mantools/fixman ../proto/postconf.proto $? >junk && \
200	    (cmp -s junk $? || mv junk $?) && rm -f junk
201	../mantools/srctoman $? >$@
202
203man1/postkick.1: ../src/postkick/postkick.c
204	../mantools/fixman ../proto/postconf.proto $? >junk && \
205	    (cmp -s junk $? || mv junk $?) && rm -f junk
206	../mantools/srctoman $? >$@
207
208man1/postlock.1: ../src/postlock/postlock.c
209	../mantools/fixman ../proto/postconf.proto $? >junk && \
210	    (cmp -s junk $? || mv junk $?) && rm -f junk
211	../mantools/srctoman $? >$@
212
213man1/postlog.1: ../src/postlog/postlog.c
214	../mantools/fixman ../proto/postconf.proto $? >junk && \
215	    (cmp -s junk $? || mv junk $?) && rm -f junk
216	../mantools/srctoman $? >$@
217
218man1/postmap.1: ../src/postmap/postmap.c
219	../mantools/fixman ../proto/postconf.proto $? >junk && \
220	    (cmp -s junk $? || mv junk $?) && rm -f junk
221	../mantools/srctoman $? >$@
222
223man1/postmulti.1: ../src/postmulti/postmulti.c
224	../mantools/fixman ../proto/postconf.proto $? >junk && \
225	    (cmp -s junk $? || mv junk $?) && rm -f junk
226	../mantools/srctoman $? >$@
227
228man1/postqueue.1: ../src/postqueue/postqueue.c
229	../mantools/fixman ../proto/postconf.proto $? >junk && \
230	    (cmp -s junk $? || mv junk $?) && rm -f junk
231	../mantools/srctoman $? >$@
232
233man1/postsuper.1: ../src/postsuper/postsuper.c
234	../mantools/fixman ../proto/postconf.proto $? >junk && \
235	    (cmp -s junk $? || mv junk $?) && rm -f junk
236	../mantools/srctoman $? >$@
237
238man1/sendmail.1: ../src/sendmail/sendmail.c
239	../mantools/fixman ../proto/postconf.proto $? >junk && \
240	    (cmp -s junk $? || mv junk $?) && rm -f junk
241	../mantools/srctoman $? >$@
242
243man1/mailq.1:
244	echo .so man1/sendmail.1 >$@
245
246man1/newaliases.1:
247	echo .so man1/sendmail.1 >$@
248
249man5/access.5: ../proto/access
250	../mantools/srctoman - $? >$@
251
252man5/aliases.5: ../proto/aliases
253	../mantools/srctoman - $? >$@
254
255man5/bounce.5: ../proto/bounce
256	../mantools/srctoman - $? >$@
257
258man5/canonical.5: ../proto/canonical
259	../mantools/srctoman - $? >$@
260
261man5/cidr_table.5: ../proto/cidr_table
262	../mantools/srctoman - $? >$@
263
264man5/generic.5: ../proto/generic
265	../mantools/srctoman - $? >$@
266
267man5/header_checks.5: ../proto/header_checks
268	../mantools/srctoman - $? >$@
269
270man5/body_checks.5: ../proto/header_checks
271	echo .so man5/header_checks.5 >$@
272
273man5/ldap_table.5: ../proto/ldap_table
274	../mantools/srctoman - $? >$@
275
276man5/master.5: ../proto/master
277	../mantools/srctoman - $? >$@
278
279man5/mysql_table.5: ../proto/mysql_table
280	../mantools/srctoman - $? >$@
281
282man5/sqlite_table.5: ../proto/sqlite_table
283	../mantools/srctoman - $? >$@
284
285man5/nisplus_table.5: ../proto/nisplus_table
286	../mantools/srctoman - $? >$@
287
288man5/pcre_table.5: ../proto/pcre_table
289	../mantools/srctoman - $? >$@
290
291man5/pgsql_table.5: ../proto/pgsql_table
292	../mantools/srctoman - $? >$@
293
294man5/regexp_table.5: ../proto/regexp_table
295	../mantools/srctoman - $? >$@
296
297man5/relocated.5: ../proto/relocated
298	../mantools/srctoman - $? >$@
299
300man5/transport.5: ../proto/transport
301	../mantools/srctoman - $? >$@
302
303man5/virtual.5: ../proto/virtual
304	../mantools/srctoman - $? >$@
305
306man5/postfix-wrapper.5: ../proto/postfix-wrapper
307	../mantools/fixman ../proto/postconf.proto $? >junk && \
308	    (cmp -s junk $? || mv junk $?) && rm -f junk
309	../mantools/srctoman - $? >$@
310
311man1/smtp-sink.1: ../src/smtpstone/smtp-sink.c
312	../mantools/fixman ../proto/postconf.proto $? >junk && \
313	    (cmp -s junk $? || mv junk $?) && rm -f junk
314	../mantools/srctoman $? >$@
315
316man1/smtp-source.1: ../src/smtpstone/smtp-source.c
317	../mantools/fixman ../proto/postconf.proto $? >junk && \
318	    (cmp -s junk $? || mv junk $?) && rm -f junk
319	../mantools/srctoman $? >$@
320
321man5/tcp_table.5: ../proto/tcp_table
322	../mantools/srctoman - $? >$@
323
324man1/qmqp-sink.1: ../src/smtpstone/qmqp-sink.c
325	../mantools/fixman ../proto/postconf.proto $? >junk && \
326	    (cmp -s junk $? || mv junk $?) && rm -f junk
327	../mantools/srctoman $? >$@
328
329man1/qmqp-source.1: ../src/smtpstone/qmqp-source.c
330	../mantools/fixman ../proto/postconf.proto $? >junk && \
331	    (cmp -s junk $? || mv junk $?) && rm -f junk
332	../mantools/srctoman $? >$@
333
334man1/qshape.1: ../auxiliary/qshape/qshape.pl
335	#../mantools/fixman ../proto/postconf.proto $? >junk && \
336	#    (cmp -s junk $? || mv junk $?) && rm -f junk
337	../mantools/srctoman - $? >$@
338