2880b0ce3a94f5c0d569886aa096d6aa07c73b69
[exim.git] / src / OS / Makefile-Base
1 # This file is the basis of the main makefile for Exim and friends. The
2 # makefile at the top level arranges to build the main makefile by calling
3 # scripts/Configure-Makefile from within the build directory. This
4 # concatenates the configuration settings from Local/Makefile and other,
5 # optional, Local/* files at the front of this file, to create Makefile in the
6 # build directory.
7 #
8 # Copyright (c) The Exim Maintainers 1995 - 2018
9 # Copyright (c) The Exim Maintainers 2020
10
11 SHELL      = $(MAKE_SHELL)
12 SCRIPTS    = ../scripts
13 O          = ../OS
14 EDITME     = ../Local/Makefile
15 EXIMON_EDITME = ../Local/eximon.conf
16
17 # The compiler used for linking is normally the same as the compiler used for
18 # compiling. However, by giving it a different name, we can override it from
19 # the command line, and this is helpful for certain types of testing.
20
21 LNCC = $(CC)
22
23 # The compile commands can be very long. To make the output look better,
24 # they are not normally echoed in full. To get full echoing, the caller
25 # must set FULLECHO='' on the command line and call make with -e. We default
26 # FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
27
28 FULLECHO = @
29 FE       = $(FULLECHO)
30
31 # The default target double-checks the existence of $(EDITME) and then arranges
32 # to touch it if it exists and any of the optional configuration files, which
33 # depend on the os or the architecture, have been altered. The same sub-target
34 # does the same thing for the eximon configuration file if it exists. Then
35 # there is a check that the Makefile (the one built from this file) is
36 # up-to-date. Then the os-specific source files and the C configuration file
37 # are set up, and finally it goes to the main Exim target.
38
39 all:       utils exim
40 config:    $(EDITME) checklocalmake Makefile os.c config.h version.h version.sh macro.c
41
42 checklocalmake:
43         @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
44           $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
45           $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
46         then \
47           touch $(EDITME); \
48         fi
49         @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
50           $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
51           $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
52         then \
53           if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
54         fi
55
56 $(EDITME):
57         @echo " "
58         @echo "*** Please create Local/Makefile by copying src/EDITME and making"
59         @echo "*** appropriate changes for your site."
60         @echo " "
61         @false
62
63 $(EXIMON_EDITME):
64         @echo " "
65         @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
66         @echo "*** appropriate changes for your site."
67         @echo " "
68         @test ! -d ../Local && mkdir ../Local
69         @false
70
71 # Check that the local Makefile is up-to-date
72
73 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
74           $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
75         @echo " "
76         @echo "*** Makefile needs rebuilding"
77         @echo "*** Please run \"make makefile\" at top level"
78         @echo " "
79         @false
80
81 # Build (link) the os.h file
82
83 os.h:   $(SCRIPTS)/Configure-os.h \
84         $(O)/os.h-FreeBSD       \
85         $(O)/os.h-GNU           \
86         $(O)/os.h-Linux         \
87         $(O)/os.h-OpenBSD       \
88         $(O)/os.h-SunOS5
89         $(SHELL) $(SCRIPTS)/Configure-os.h
90
91 # Build the os.c file
92
93 os.c:   ../src/os.c \
94         $(SCRIPTS)/Configure-os.c \
95         $(O)/os.c-FreeBSD       \
96         $(O)/os.c-GNU           \
97         $(O)/os.c-Linux         \
98         $(O)/os.c-SunOS5
99         $(SHELL) $(SCRIPTS)/Configure-os.c
100
101 # Build the config.h file.
102
103 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
104         $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
105
106 # Build the builtin-macros data struct
107
108 MACRO_HSRC = macro_predef.h os.h globals.h config.h macros.h \
109         routers/accept.h routers/dnslookup.h routers/ipliteral.h \
110         routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
111         routers/redirect.h
112
113 OBJ_MACRO = macro_predef.o \
114         macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
115         macro-acl.o macro-tls.o \
116         macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
117         macro-smtp.o macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
118         macro-manualroute.o macro-queryprogram.o macro-redirect.o \
119         macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
120         macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-authtls.o macro-external.o \
121         macro-dkim.o macro-malware.o macro-signing.o
122
123 $(OBJ_MACRO):   $(MACRO_HSRC)
124
125 macro_predef.o :        macro_predef.c
126         @echo "$(CC) -DMACRO_PREDEF macro_predef.c"
127         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ macro_predef.c
128 macro-globals.o :       globals.c
129         @echo "$(CC) -DMACRO_PREDEF globals.c"
130         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
131 macro-readconf.o :      readconf.c
132         @echo "$(CC) -DMACRO_PREDEF readconf.c"
133         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
134 macro-route.o :         route.c
135         @echo "$(CC) -DMACRO_PREDEF route.c"
136         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
137 macro-transport.o:      transport.c
138         @echo "$(CC) -DMACRO_PREDEF transport.c"
139         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
140 macro-drtables.o :      drtables.c
141         @echo "$(CC) -DMACRO_PREDEF drtables.c"
142         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
143 macro-acl.o:    acl.c
144         @echo "$(CC) -DMACRO_PREDEF acl.c"
145         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ acl.c
146 macro-tls.o:    tls.c tls-gnu.c tls-openssl.c
147         @echo "$(CC) -DMACRO_PREDEF tls.c"
148         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ tls.c
149 macro-appendfile.o :    transports/appendfile.c
150         @echo "$(CC) -DMACRO_PREDEF transports/appendfile.c"
151         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/appendfile.c
152 macro-autoreply.o :     transports/autoreply.c
153         @echo "$(CC) -DMACRO_PREDEF transports/autoreply.c"
154         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/autoreply.c
155 macro-lmtp.o:           transports/lmtp.c
156         @echo "$(CC) -DMACRO_PREDEF transports/lmtp.c"
157         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/lmtp.c
158 macro-pipe.o :          transports/pipe.c
159         @echo "$(CC) -DMACRO_PREDEF transports/pipe.c"
160         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/pipe.c
161 macro-queuefile.o :     transports/queuefile.c
162         @echo "$(CC) -DMACRO_PREDEF transports/queuefile.c"
163         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/queuefile.c
164 macro-smtp.o :          transports/smtp.c
165         @echo "$(CC) -DMACRO_PREDEF transports/smtp.c"
166         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/smtp.c
167 macro-accept.o :        routers/accept.c
168         @echo "$(CC) -DMACRO_PREDEF routers/accept.c"
169         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/accept.c
170 macro-dnslookup.o :     routers/dnslookup.c
171         @echo "$(CC) -DMACRO_PREDEF routers/dnslookup.c"
172         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/dnslookup.c
173 macro-ipliteral.o :     routers/ipliteral.c
174         @echo "$(CC) -DMACRO_PREDEF routers/ipliteral.c"
175         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/ipliteral.c
176 macro-iplookup.o :      routers/iplookup.c
177         @echo "$(CC) -DMACRO_PREDEF routers/iplookup.c"
178         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/iplookup.c
179 macro-manualroute.o :   routers/manualroute.c
180         @echo "$(CC) -DMACRO_PREDEF routers/manualroute.c"
181         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/manualroute.c
182 macro-queryprogram.o :  routers/queryprogram.c
183         @echo "$(CC) -DMACRO_PREDEF routers/queryprogram.c"
184         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/queryprogram.c
185 macro-redirect.o :      routers/redirect.c
186         @echo "$(CC) -DMACRO_PREDEF routers/redirect.c"
187         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/redirect.c
188 macro-auth-spa.o :      auths/auth-spa.c
189         @echo "$(CC) -DMACRO_PREDEF auths/auth-spa.c"
190         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/auth-spa.c
191 macro-cram_md5.o :      auths/cram_md5.c
192         @echo "$(CC) -DMACRO_PREDEF auths/cram_md5.c"
193         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cram_md5.c
194 macro-cyrus_sasl.o :    auths/cyrus_sasl.c
195         @echo "$(CC) -DMACRO_PREDEF auths/cyrus_sasl.c"
196         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cyrus_sasl.c
197 macro-dovecot.o:        auths/dovecot.c
198         @echo "$(CC) -DMACRO_PREDEF auths/dovecot.c"
199         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/dovecot.c
200 macro-external.o:       auths/external.c
201         @echo "$(CC) -DMACRO_PREDEF auths/external.c"
202         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/external.c
203 macro-gsasl_exim.o :    auths/gsasl_exim.c
204         @echo "$(CC) -DMACRO_PREDEF auths/gsasl_exim.c"
205         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/gsasl_exim.c
206 macro-heimdal_gssapi.o: auths/heimdal_gssapi.c
207         @echo "$(CC) -DMACRO_PREDEF auths/heimdal_gssapi.c"
208         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/heimdal_gssapi.c
209 macro-plaintext.o :     auths/plaintext.c
210         @echo "$(CC) -DMACRO_PREDEF auths/plaintext.c"
211         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/plaintext.c
212 macro-spa.o :           auths/spa.c
213         @echo "$(CC) -DMACRO_PREDEF auths/spa.c"
214         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/spa.c
215 macro-authtls.o:        auths/tls.c
216         @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
217         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
218 macro-dkim.o:           dkim.c
219         @echo "$(CC) -DMACRO_PREDEF dkim.c"
220         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
221 macro-malware.o:        malware.c
222         @echo "$(CC) -DMACRO_PREDEF malware.c"
223         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ malware.c
224 macro-signing.o:        pdkim/signing.c
225         @echo "$(CC) -DMACRO_PREDEF pdkim/signing.c"
226         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ pdkim/signing.c
227
228 macro_predef: $(OBJ_MACRO)
229         @echo "$(LNCC) -o $@"
230         $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
231
232 macro.c: macro_predef
233         ./macro_predef > macro.c
234
235 # This target is recognized specially by GNU make. It records those targets
236 # that do not correspond to files that are being built and which should
237 # therefore always be run, even if the files exist. This shouldn't in fact be a
238 # problem, but it does no harm. Other make programs will just ignore this.
239
240 .PHONY: all config utils \
241         buildauths buildlookups buildpdkim buildrouters \
242         buildtransports checklocalmake clean
243
244
245 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
246         exigrep eximstats exipick exiqgrep exiqsumm \
247         transport-filter.pl convert4r3 convert4r4 \
248         exim_checkaccess \
249         exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
250
251
252 # Targets for special-purpose configuration header builders
253 buildconfig: buildconfig.c
254         @echo "$(CC) buildconfig.c"
255         $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
256
257
258 # Target for the exicyclog utility script
259 exicyclog: config ../src/exicyclog.src
260         @rm -f exicyclog
261         @. ./version.sh && sed \
262           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
263           -e "/^# /p" \
264           -e "/^# /d" \
265           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
266           -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
267           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
268           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
269           -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
270           -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
271           -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
272           -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
273           -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
274           -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
275           -e "s?MV_COMMAND?$(MV_COMMAND)?" \
276           -e "s?RM_COMMAND?$(RM_COMMAND)?" \
277           -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
278           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
279           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
280           ../src/exicyclog.src > exicyclog-t
281         @mv exicyclog-t exicyclog
282         @chmod a+x exicyclog
283         @echo ">>> exicyclog script built"
284
285 # Target for the exinext utility script
286 exinext: config ../src/exinext.src
287         @rm -f exinext
288         @. ./version.sh && sed \
289           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
290           -e "/^# /p" \
291           -e "/^# /d" \
292           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
293           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
294           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
295           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
296           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
297           ../src/exinext.src > exinext-t
298         @mv exinext-t exinext
299         @chmod a+x exinext
300         @echo ">>> exinext script built"
301
302 # Target for the exiwhat utility script
303 exiwhat: config ../src/exiwhat.src
304         @rm -f exiwhat
305         @. ./version.sh && sed \
306           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
307           -e "/^# /p" \
308           -e "/^# /d" \
309           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
310           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
311           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
312           -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
313           -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
314           -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
315           -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
316           -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
317           -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
318           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
319           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
320           -e "s?RM_COMMAND?$(RM_COMMAND)?" \
321           ../src/exiwhat.src > exiwhat-t
322         @mv exiwhat-t exiwhat
323         @chmod a+x exiwhat
324         @echo ">>> exiwhat script built"
325
326 # Target for the exim_checkaccess utility script
327 exim_checkaccess: config ../src/exim_checkaccess.src
328         @rm -f exim_checkaccess
329         @. ./version.sh && sed \
330           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
331           -e "/^# /p" \
332           -e "/^# /d" \
333           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
334           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
335           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
336           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
337           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
338           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
339           ../src/exim_checkaccess.src > exim_checkaccess-t
340         @mv exim_checkaccess-t exim_checkaccess
341         @chmod a+x exim_checkaccess
342         @echo ">>> exim_checkaccess script built"; echo ""
343
344 # Target for the Exim monitor start-up script
345 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
346           ../Local/eximon.conf
347         @rm -f eximon
348         $(SHELL) $(SCRIPTS)/Configure-eximon
349         @. ./version.sh && sed \
350           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
351           -e "/^# /p" \
352           -e "/^# /d" \
353           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
354           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
355           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
356           -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
357           -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
358           -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
359           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
360           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
361           ../src/eximon.src >> eximon
362         @echo ">>> eximon script built"; echo ""
363
364 # Targets for utilities; these are all Perl scripts that have to get the
365 # location of Perl put in them. A few need other things as well.
366
367 exigrep: config ../src/exigrep.src
368         @rm -f exigrep
369         @. ./version.sh && sed \
370           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
371           -e "/^# /p" \
372           -e "/^# /d" \
373           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
374           -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
375           -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
376           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
377           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
378           ../src/exigrep.src > exigrep-t
379         @mv exigrep-t exigrep
380         @chmod a+x exigrep
381         @echo ">>> exigrep script built"
382
383 eximstats: config ../src/eximstats.src
384         @rm -f eximstats
385         @. ./version.sh && sed \
386           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
387           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
388           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
389           ../src/eximstats.src > eximstats-t
390         @mv eximstats-t eximstats
391         @chmod a+x eximstats
392         @echo ">>> eximstats script built"
393
394 exiqgrep: config ../src/exiqgrep.src
395         @rm -f exiqgrep
396         @. ./version.sh && sed \
397           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
398           -e "/^# /p" \
399           -e "/^# /d" \
400           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
401           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
402           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
403           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
404           ../src/exiqgrep.src > exiqgrep-t
405         @mv exiqgrep-t exiqgrep
406         @chmod a+x exiqgrep
407         @echo ">>> exiqgrep script built"
408
409 exiqsumm: config ../src/exiqsumm.src
410         @rm -f exiqsumm
411         @. ./version.sh && sed \
412           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
413           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
414           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
415           ../src/exiqsumm.src > exiqsumm-t
416         @mv exiqsumm-t exiqsumm
417         @chmod a+x exiqsumm
418         @echo ">>> exiqsumm script built"
419
420 exipick: config ../src/exipick.src
421         @rm -f exipick
422         @. ./version.sh && sed \
423           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
424           -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
425           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
426           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
427           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
428           ../src/exipick.src > exipick-t
429         @mv exipick-t exipick
430         @chmod a+x exipick
431         @echo ">>> exipick script built"
432
433 transport-filter.pl: config ../src/transport-filter.src
434         @rm -f transport-filter.pl
435         @. ./version.sh && sed \
436           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
437           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
438           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
439           ../src/transport-filter.src > transport-filter.pl-t
440         @mv transport-filter.pl-t transport-filter.pl
441         @chmod a+x transport-filter.pl
442         @echo ">>> transport-filter.pl script built"
443
444 convert4r3: config ../src/convert4r3.src
445         @rm -f convert4r3
446         @. ./version.sh && sed \
447           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
448           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
449           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
450           ../src/convert4r3.src > convert4r3-t
451         @mv convert4r3-t convert4r3
452         @chmod a+x convert4r3
453         @echo ">>> convert4r3 script built"
454
455 convert4r4: config ../src/convert4r4.src
456         @rm -f convert4r4
457         @. ./version.sh && sed \
458           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
459           -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
460           -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
461           ../src/convert4r4.src > convert4r4-t
462         @mv convert4r4-t convert4r4
463         @chmod a+x convert4r4
464         @echo ">>> convert4r4 script built"
465
466
467 # These are objects of optional features. They are always compiled, but
468 # if the corresponding #defines are not set, they wind up empty and
469 # are thrown away by the linker.
470
471 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
472 OBJ_EXPERIMENTAL =      arc.o \
473                         bmi_spam.o \
474                         dane.o \
475                         dcc.o \
476                         dmarc.o \
477                         imap_utf7.o \
478                         spf.o \
479                         srs.o \
480                         utf8.o
481
482 # Targets for final binaries; the main one has a build number which is
483 # updated each time. We don't bother with that for the auxiliaries.
484
485 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
486
487 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
488         directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
489         filtertest.o globals.o dkim.o dkim_transport.o dnsbl.o hash.o \
490         header.o host.o ip.o log.o lss.o match.o md5.o moan.o \
491         os.o parse.o priv.o queue.o \
492         rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
493         route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
494         std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
495         environment.o macro.o \
496         $(OBJ_LOOKUPS) \
497         local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
498         $(OBJ_EXPERIMENTAL)
499
500 exim:   buildlookups buildauths pdkim/pdkim.a \
501         buildrouters buildtransports \
502         $(OBJ_EXIM) version.o
503         @echo "$(LNCC) -o exim"
504         $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
505           routers/routers.a transports/transports.a lookups/lookups.a \
506           auths/auths.a pdkim/pdkim.a \
507           $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
508           $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
509           $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
510         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
511           echo $(STRIP_COMMAND) exim; \
512           $(STRIP_COMMAND) exim; \
513         fi
514         $(EXIM_CHMOD)
515         @echo " "
516         @echo ">>> exim binary built"
517         @echo " "
518
519 # The utility for dumping the contents of an exim database
520
521 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
522
523 exim_dumpdb: $(OBJ_DUMPDB)
524         @echo "$(LNCC) -o exim_dumpdb"
525         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
526           $(LIBS) $(EXTRALIBS) $(DBMLIB)
527         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
528           echo $(STRIP_COMMAND) exim_dumpdb; \
529           $(STRIP_COMMAND) exim_dumpdb; \
530         fi
531         @echo ">>> exim_dumpdb utility built"
532         @echo " "
533
534 # The utility for interrogating/fixing the contents of an exim database
535
536 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o util-md5.o
537
538 exim_fixdb:  $(OBJ_FIXDB)
539         @echo "$(LNCC) -o exim_fixdb"
540         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
541           $(LIBS) $(EXTRALIBS) $(DBMLIB)
542         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
543           echo $(STRIP_COMMAND) exim_fixdb; \
544           $(STRIP_COMMAND) exim_fixdb; \
545         fi
546         @echo ">>> exim_fixdb utility built"
547         @echo " "
548
549 # The utility for tidying the contents of an exim database
550
551 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
552
553 exim_tidydb: $(OBJ_TIDYDB)
554         @echo "$(LNCC) -o exim_tidydb"
555         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
556           $(LIBS) $(EXTRALIBS) $(DBMLIB)
557         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
558           echo $(STRIP_COMMAND) exim_tidydb; \
559           $(STRIP_COMMAND) exim_tidydb; \
560         fi
561         @echo ">>> exim_tidydb utility built"
562         @echo " "
563
564 # The utility for building dbm files
565
566 exim_dbmbuild: exim_dbmbuild.o
567         @echo "$(LNCC) -o exim_dbmbuild"
568         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
569           $(LIBS) $(EXTRALIBS) $(DBMLIB)
570         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
571           echo $(STRIP_COMMAND) exim_dbmbuild; \
572           $(STRIP_COMMAND) exim_dbmbuild; \
573         fi
574         @echo ">>> exim_dbmbuild utility built"
575         @echo " "
576
577 # The utility for locking a mailbox while messing around with it
578
579 exim_lock: exim_lock.c os.h
580         @echo "$(CC) exim_lock.c"
581         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
582         @echo "$(LNCC) -o exim_lock"
583         $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o  \
584           $(LIBS) $(EXTRALIBS)
585         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
586           echo $(STRIP_COMMAND) exim_lock; \
587           $(STRIP_COMMAND) exim_lock; \
588         fi
589         @echo ">>> exim_lock utility built"
590         @echo " "
591
592 # The X-based Exim monitor program's binary part. There's a macro for cutting
593 # out the modified TextPop module, because some antique link editors cannot
594 # handle the fact that it is redefining things that are found later in the
595 # Xaw library.
596
597 # Object modules that are the unique Eximon modules
598
599 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
600         em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
601         em_text.o em_xs.o
602
603 # The complete modules list also includes some specially compiled versions of
604 # code from the main Exim source tree.
605
606 OBJ_MONBIN = util-spool_in.o \
607              util-store.o \
608              util-string.o \
609              util-queue.o \
610              util-tod.o \
611              util-tree.o \
612              $(MONBIN)
613
614 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) ../exim_monitor/em_version.c \
615                 mytypes.h store.h macros.h
616         @echo "$(CC) exim_monitor/em_version.c"
617         $(FE)$(CC) -o em_version.o -c \
618           $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
619         @echo "$(LNCC) -o eximon.bin"
620         $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
621           $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
622           $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
623         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
624           echo $(STRIP_COMMAND) eximon.bin; \
625           $(STRIP_COMMAND) eximon.bin; \
626         fi
627         @echo ">>> exim monitor binary built"
628         @echo " "
629
630
631 # Compile step for most of the exim modules. HDRS is a list of headers
632 # which cause everything to be rebuilt. PHDRS is the same, for the use
633 # of routers, transports, and authenticators. I can't find a way of doing this
634 # in one. This list is overkill, but it doesn't really take much time to
635 # rebuild Exim on a modern computer.
636
637 HDRS  = blob.h \
638         config.h \
639         dbfunctions.h \
640         dbstuff.h \
641         exim.h \
642         functions.h \
643         globals.h \
644         hash.h \
645         local_scan.h \
646         macros.h \
647         mytypes.h \
648         sha_ver.h \
649         structs.h \
650         os.h
651 PHDRS = ../config.h \
652         ../dbfunctions.h \
653         ../dbstuff.h \
654         ../exim.h \
655         ../functions.h \
656         ../globals.h \
657         ../local_scan.h \
658         ../macros.h \
659         ../mytypes.h \
660         ../structs.h \
661         ../os.h
662
663 .SUFFIXES: .o .c
664 .c.o:;  @echo "$(CC) $*.c"
665         $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
666
667 # Update Exim's version information and build the version object.  The dependency
668 # chain here avoids problems under parallel-make.
669
670 version.sh:
671         @../scripts/reversion
672
673 version.h: version.sh
674
675 cnumber.h: version.h
676
677 version.o: $(HDRS) cnumber.h version.h version.c
678
679 # This is the dummy module for use by test compiles of individual modules. It
680 # contains functions such as log_write() that may be called from bits of Exim
681 # in the tested code.
682
683 dummies.o:       dummies.c
684
685 # Compile instructions for perl.o for when EXIM_PERL is set
686
687 perl.o:          $(HDRS) perl.c
688         @echo "$(PERL_CC) perl.c"
689         $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
690
691 # Compile instructions for the database utility modules
692
693 exim_dumpdb.o:   $(HDRS) exim_dbutil.c
694         @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
695         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
696                                       -DCOMPILE_UTILITY \
697                                       -DEXIM_DUMPDB \
698                                       -o exim_dumpdb.o exim_dbutil.c
699
700 exim_fixdb.o:    $(HDRS) exim_dbutil.c
701         @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
702         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
703                                       -DCOMPILE_UTILITY \
704                                       -DEXIM_FIXDB \
705                                       -o exim_fixdb.o exim_dbutil.c
706
707 exim_tidydb.o:   $(HDRS) exim_dbutil.c
708         @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
709         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
710                                       -DCOMPILE_UTILITY \
711                                       -DEXIM_TIDYDB \
712                                       -o exim_tidydb.o exim_dbutil.c
713
714 # Compile instructions for exim_dbmbuild
715
716 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
717         @echo "$(CC) exim_dbmbuild.c"
718         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
719                 -o exim_dbmbuild.o exim_dbmbuild.c
720
721 # Utilities use special versions of some modules - typically with debugging
722 # calls cut out.
723
724 util-spool_in.o: $(HDRS) spool_in.c
725         @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
726         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
727
728 util-store.o:    $(HDRS) store.c
729         @echo "$(CC) -DCOMPILE_UTILITY store.c"
730         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
731
732 util-string.o:   $(HDRS) string.c
733         @echo "$(CC) -DCOMPILE_UTILITY string.c"
734         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
735
736 util-md5.o:   $(HDRS) md5.c
737         @echo "$(CC) -DCOMPILE_UTILITY queue.c"
738         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-md5.o md5.c
739
740 util-queue.o:   $(HDRS) queue.c
741         @echo "$(CC) -DCOMPILE_UTILITY queue.c"
742         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
743
744 util-tod.o:   $(HDRS) tod.c
745         @echo "$(CC) -DCOMPILE_UTILITY tod.c"
746         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
747
748 util-tree.o:   $(HDRS) tree.c
749         @echo "$(CC) -DCOMPILE_UTILITY tree.c"
750         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tree.o tree.c
751
752 util-os.o:       $(HDRS) os.c
753         @echo "$(CC) -DCOMPILE_UTILITY os.c"
754         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
755                                       -DCOMPILE_UTILITY \
756                                       -DOS_LOAD_AVERAGE \
757                                       -DFIND_RUNNING_INTERFACES \
758                                       -o util-os.o os.c
759
760 # The local scan module depends only on its own special header, and is compiled
761 # from a source whose location is set by configuration.
762
763 local_scan.o:    config local_scan.h ../$(LOCAL_SCAN_SOURCE)
764         @echo "$(CC) local_scan.c"
765         $(FE)$(CC) -DLOCAL_SCAN -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
766
767 # Dependencies for the "ordinary" exim modules
768
769 acl.o:           $(HDRS) acl.c
770 base64.o:        $(HDRS) mime.h base64.c
771 child.o:         $(HDRS) child.c
772 crypt16.o:       $(HDRS) crypt16.c
773 daemon.o:        $(HDRS) daemon.c
774 dbfn.o:          $(HDRS) dbfn.c
775 debug.o:         $(HDRS) debug.c
776 deliver.o:       $(HDRS) transports/smtp.h deliver.c
777 directory.o:     $(HDRS) directory.c
778 dns.o:           $(HDRS) dns.c
779 dnsbl.o:         $(HDRS) dnsbl.c
780 enq.o:           $(HDRS) enq.c
781 exim.o:          $(HDRS) exim.c
782 expand.o:        $(HDRS) expand.c
783 environment.o:   $(HDRS) environment.c
784 filter.o:        $(HDRS) filter.c
785 filtertest.o:    $(HDRS) filtertest.c
786 globals.o:       $(HDRS) globals.c
787 hash.o:          $(HDRS) hash.c
788 header.o:        $(HDRS) header.c
789 host.o:          $(HDRS) host.c
790 ip.o:            $(HDRS) ip.c
791 log.o:           $(HDRS) log.c
792 lss.o:           $(HDRS) lss.c
793 match.o:         $(HDRS) match.c
794 md5.o:           $(HDRS) md5.c
795 moan.o:          $(HDRS) moan.c
796 os.o:            $(HDRS) $(OS_C_INCLUDES) os.c
797 parse.o:         $(HDRS) parse.c
798 priv.o:          $(HDRS) priv.c
799 queue.o:         $(HDRS) queue.c
800 rda.o:           $(HDRS) rda.c
801 readconf.o:      $(HDRS) readconf.c
802 receive.o:       $(HDRS) receive.c
803 retry.o:         $(HDRS) retry.c
804 rewrite.o:       $(HDRS) rewrite.c
805 rfc2047.o:       $(HDRS) rfc2047.c
806 route.o:         $(HDRS) route.c
807 search.o:        $(HDRS) search.c
808 sieve.o:         $(HDRS) sieve.c
809 smtp_in.o:       $(HDRS) smtp_in.c
810 smtp_out.o:      $(HDRS) smtp_out.c
811 spool_in.o:      $(HDRS) spool_in.c
812 spool_out.o:     $(HDRS) spool_out.c
813 std-crypto.o:    $(HDRS) std-crypto.c
814 store.o:         $(HDRS) store.c
815 string.o:        $(HDRS) string.c
816 tls.o:           $(HDRS) tls.c \
817                  tls-gnu.c tlscert-gnu.c \
818                  tls-openssl.c tlscert-openssl.c \
819                  tls-cipher-stdname.c
820 tod.o:           $(HDRS) tod.c
821 transport.o:     $(HDRS) transport.c
822 tree.o:          $(HDRS) tree.c
823 verify.o:        $(HDRS) transports/smtp.h verify.c
824 dkim.o:          $(HDRS) pdkim/pdkim.h dkim.c
825 dkim_transport.o: $(HDRS) dkim_transport.c
826
827 # Dependencies for WITH_CONTENT_SCAN modules
828
829 malware.o:       $(HDRS) malware.c
830 mime.o:          $(HDRS) mime.h mime.c
831 regex.o:         $(HDRS) regex.c
832 spam.o:          $(HDRS) spam.c
833 spool_mbox.o:    $(HDRS) spool_mbox.c
834
835
836 # Dependencies for EXPERIMENTAL_* modules
837
838 arc.o:          $(HDRS) pdkim/pdkim.h arc.c
839 bmi_spam.o:     $(HDRS) bmi_spam.c
840 dane.o:         $(HDRS) dane.c dane-openssl.c
841 dcc.o:          $(HDRS) dcc.h dcc.c
842 dmarc.o:        $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
843 imap_utf7.o:    $(HDRS) imap_utf7.c
844 spf.o:          $(HDRS) spf.h spf.c
845 srs.o:          $(HDRS) srs.h srs.c
846 utf8.o:         $(HDRS) utf8.c
847
848 # The module containing tables of available lookups, routers, auths, and
849 # transports must be rebuilt if any of them are. However, because the makefiles
850 # for the drivers are always run, we don't actually put the dependencies here,
851 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
852 # drtables.o even though the .a files haven't in fact been updated. Instead
853 # it is arranged that the lower-level makefiles remove drtables.o when they
854 # rebuild the .a files.
855
856 drtables.o:      $(HDRS) drtables.c
857
858 # We depend upon object files built as part of building the lookups library
859 # When using parallel make, we don't have the dependency to force building
860 # in the sub-directory unless we force that dependency:
861
862 $(OBJ_LOOKUPS):  buildlookups
863
864 # The exim monitor's private modules - the sources live in a private
865 # subdirectory. The final binary combines the private modules with some
866 # modules from the main exim binary.
867
868 em_StripChart.o: ../exim_monitor/em_StripChart.c
869 em_TextPop.o:    ../exim_monitor/em_TextPop.c
870 em_globals.o:    ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
871 em_init.o:       ../exim_monitor/em_init.c    ../exim_monitor/em_hdr.h
872 em_log.o:        ../exim_monitor/em_log.c     ../exim_monitor/em_hdr.h
873 em_main.o:       ../exim_monitor/em_main.c    ../exim_monitor/em_hdr.h
874 em_menu.o:       ../exim_monitor/em_menu.c    ../exim_monitor/em_hdr.h
875 em_queue.o:      ../exim_monitor/em_queue.c   ../exim_monitor/em_hdr.h
876 em_strip.o:      ../exim_monitor/em_strip.c   ../exim_monitor/em_hdr.h
877 em_text.o:       ../exim_monitor/em_text.c    ../exim_monitor/em_hdr.h
878 em_xs.o:         ../exim_monitor/em_xs.c      ../exim_monitor/em_hdr.h
879 em_version.o:    ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
880 $(MONBIN): $(HDRS)
881                  @echo "$(CC) exim_monitor/$(@:.o=.c)"
882                  $(FE)$(CC) -o $@ -c $(CFLAGS) -DCOMPILE_UTILITY -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
883                    ../exim_monitor/$(@:.o=.c)
884
885
886 # Targets for the various libraries that Exim uses.
887
888 # The lookups library.
889
890 buildlookups: config
891          @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
892            CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
893            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
894            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
895          @echo " "
896
897 # The routers library.
898
899 buildrouters: config
900          @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
901            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
902            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
903          @echo " "
904
905 # The transports library.
906
907 buildtransports: config
908          @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
909            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
910            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
911          @echo " "
912
913 # The library of authorization modules
914
915 buildauths: config
916          @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
917            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
918            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
919          @echo " "
920
921 # The PDKIM library
922
923 buildpdkim: pdkim/pdkim.a
924 pdkim/pdkim.a: config
925          @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
926            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
927            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
928          @echo " "
929
930 # The "clean", "install", and "makefile" targets just pass themselves back to
931 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
932 # for them in the build directory.
933
934 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
935
936 # Targets for building stand-alone testing programs for basic testing of
937 # some of the building blocks. These are not integrated with the makefile-
938 # building targets. If you change something that is going to cause the
939 # makefile to be rebuilt, you must run "make makefile" before running one
940 # of these.
941
942 # The testing programs use different versions of some modules - usually
943 # with bits cut out that are not relevant to the test in hand. For those
944 # that are used by several tests, we use a different name.
945
946 sa-globals.o:    $(HDRS) globals.c
947         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
948
949 sa-os.o:         $(HDRS) os.c
950         $(CC) -c $(CFLAGS) $(INCLUDE) \
951                                       -DFIND_RUNNING_INTERFACES \
952                                       -o sa-os.o os.c
953
954 # These are the test targets themselves
955
956 test_dbfn:   config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
957                string.o tod.o version.o utf8.o
958         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
959         $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
960         $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
961           dummies.o sa-globals.o sa-os.o store.o string.o \
962           tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
963         rm -f dbfn.o store.o
964
965 test_host:   config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
966                store.o string.o tod.o tree.o
967         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
968         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
969         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
970         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
971         $(LNCC) -o test_host $(LFLAGS) \
972           host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
973           tod.o tree.o $(LIBS) $(LIBRESOLV)
974         rm -f child.o dummies.o host.o dns.o
975
976 test_os:     os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
977         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
978         $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
979           sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
980         rm -f os.o
981
982 test_parse:  config.h parse.c dummies.o sa-globals.o \
983              store.o string.o tod.o version.o utf8.o
984         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
985         $(LNCC) -o test_parse $(LFLAGS) parse.o \
986           dummies.o sa-globals.o store.o string.o tod.o version.o \
987           utf8.o $(LDFLAGS)
988         rm -f parse.o
989
990 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
991         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
992         $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
993           dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
994         rm -f string.o
995
996 # End