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