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