Copyright updates:
[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                         srs.o \
479                         utf8.o
480
481 # Targets for final binaries; the main one has a build number which is
482 # updated each time. We don't bother with that for the auxiliaries.
483
484 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
485
486 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
487         directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
488         filtertest.o globals.o dkim.o dkim_transport.o dnsbl.o hash.o \
489         header.o host.o ip.o log.o lss.o match.o md5.o moan.o \
490         os.o parse.o priv.o queue.o \
491         rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
492         route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
493         std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
494         environment.o macro.o \
495         $(OBJ_LOOKUPS) \
496         local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
497         $(OBJ_EXPERIMENTAL)
498
499 exim:   buildlookups buildauths pdkim/pdkim.a \
500         buildrouters buildtransports \
501         $(OBJ_EXIM) version.o
502         @echo "$(LNCC) -o exim"
503         $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
504           routers/routers.a transports/transports.a lookups/lookups.a \
505           auths/auths.a pdkim/pdkim.a \
506           $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
507           $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
508           $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
509         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
510           echo $(STRIP_COMMAND) exim; \
511           $(STRIP_COMMAND) exim; \
512         fi
513         $(EXIM_CHMOD)
514         @echo " "
515         @echo ">>> exim binary built"
516         @echo " "
517
518 # The utility for dumping the contents of an exim database
519
520 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
521
522 exim_dumpdb: $(OBJ_DUMPDB)
523         @echo "$(LNCC) -o exim_dumpdb"
524         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
525           $(LIBS) $(EXTRALIBS) $(DBMLIB)
526         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
527           echo $(STRIP_COMMAND) exim_dumpdb; \
528           $(STRIP_COMMAND) exim_dumpdb; \
529         fi
530         @echo ">>> exim_dumpdb utility built"
531         @echo " "
532
533 # The utility for interrogating/fixing the contents of an exim database
534
535 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o util-md5.o
536
537 exim_fixdb:  $(OBJ_FIXDB)
538         @echo "$(LNCC) -o exim_fixdb"
539         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
540           $(LIBS) $(EXTRALIBS) $(DBMLIB)
541         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
542           echo $(STRIP_COMMAND) exim_fixdb; \
543           $(STRIP_COMMAND) exim_fixdb; \
544         fi
545         @echo ">>> exim_fixdb utility built"
546         @echo " "
547
548 # The utility for tidying the contents of an exim database
549
550 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
551
552 exim_tidydb: $(OBJ_TIDYDB)
553         @echo "$(LNCC) -o exim_tidydb"
554         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
555           $(LIBS) $(EXTRALIBS) $(DBMLIB)
556         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
557           echo $(STRIP_COMMAND) exim_tidydb; \
558           $(STRIP_COMMAND) exim_tidydb; \
559         fi
560         @echo ">>> exim_tidydb utility built"
561         @echo " "
562
563 # The utility for building dbm files
564
565 exim_dbmbuild: exim_dbmbuild.o
566         @echo "$(LNCC) -o exim_dbmbuild"
567         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
568           $(LIBS) $(EXTRALIBS) $(DBMLIB)
569         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
570           echo $(STRIP_COMMAND) exim_dbmbuild; \
571           $(STRIP_COMMAND) exim_dbmbuild; \
572         fi
573         @echo ">>> exim_dbmbuild utility built"
574         @echo " "
575
576 # The utility for locking a mailbox while messing around with it
577
578 exim_lock: exim_lock.c os.h
579         @echo "$(CC) exim_lock.c"
580         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
581         @echo "$(LNCC) -o exim_lock"
582         $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o  \
583           $(LIBS) $(EXTRALIBS)
584         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
585           echo $(STRIP_COMMAND) exim_lock; \
586           $(STRIP_COMMAND) exim_lock; \
587         fi
588         @echo ">>> exim_lock utility built"
589         @echo " "
590
591 # The X-based Exim monitor program's binary part. There's a macro for cutting
592 # out the modified TextPop module, because some antique link editors cannot
593 # handle the fact that it is redefining things that are found later in the
594 # Xaw library.
595
596 # Object modules that are the unique Eximon modules
597
598 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
599         em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
600         em_text.o em_xs.o
601
602 # The complete modules list also includes some specially compiled versions of
603 # code from the main Exim source tree.
604
605 OBJ_MONBIN = util-spool_in.o \
606              util-store.o \
607              util-string.o \
608              util-queue.o \
609              util-tod.o \
610              util-tree.o \
611              $(MONBIN)
612
613 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) ../exim_monitor/em_version.c \
614                 mytypes.h store.h macros.h
615         @echo "$(CC) exim_monitor/em_version.c"
616         $(FE)$(CC) -o em_version.o -c \
617           $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
618         @echo "$(LNCC) -o eximon.bin"
619         $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
620           $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
621           $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
622         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
623           echo $(STRIP_COMMAND) eximon.bin; \
624           $(STRIP_COMMAND) eximon.bin; \
625         fi
626         @echo ">>> exim monitor binary built"
627         @echo " "
628
629
630 # Compile step for most of the exim modules. HDRS is a list of headers
631 # which cause everything to be rebuilt. PHDRS is the same, for the use
632 # of routers, transports, and authenticators. I can't find a way of doing this
633 # in one. This list is overkill, but it doesn't really take much time to
634 # rebuild Exim on a modern computer.
635
636 HDRS  = blob.h \
637         config.h \
638         dbfunctions.h \
639         dbstuff.h \
640         exim.h \
641         functions.h \
642         globals.h \
643         hash.h \
644         local_scan.h \
645         macros.h \
646         mytypes.h \
647         sha_ver.h \
648         structs.h \
649         os.h
650 PHDRS = ../config.h \
651         ../dbfunctions.h \
652         ../dbstuff.h \
653         ../exim.h \
654         ../functions.h \
655         ../globals.h \
656         ../local_scan.h \
657         ../macros.h \
658         ../mytypes.h \
659         ../structs.h \
660         ../os.h
661
662 .SUFFIXES: .o .c
663 .c.o:;  @echo "$(CC) $*.c"
664         $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
665
666 # Update Exim's version information and build the version object.  The dependency
667 # chain here avoids problems under parallel-make.
668
669 version.sh:
670         @../scripts/reversion
671
672 version.h: version.sh
673
674 cnumber.h: version.h
675
676 version.o: $(HDRS) cnumber.h version.h version.c
677
678 # This is the dummy module for use by test compiles of individual modules. It
679 # contains functions such as log_write() that may be called from bits of Exim
680 # in the tested code.
681
682 dummies.o:       dummies.c
683
684 # Compile instructions for perl.o for when EXIM_PERL is set
685
686 perl.o:          $(HDRS) perl.c
687         @echo "$(PERL_CC) perl.c"
688         $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
689
690 # Compile instructions for the database utility modules
691
692 exim_dumpdb.o:   $(HDRS) exim_dbutil.c
693         @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
694         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
695                                       -DCOMPILE_UTILITY \
696                                       -DEXIM_DUMPDB \
697                                       -o exim_dumpdb.o exim_dbutil.c
698
699 exim_fixdb.o:    $(HDRS) exim_dbutil.c
700         @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
701         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
702                                       -DCOMPILE_UTILITY \
703                                       -DEXIM_FIXDB \
704                                       -o exim_fixdb.o exim_dbutil.c
705
706 exim_tidydb.o:   $(HDRS) exim_dbutil.c
707         @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
708         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
709                                       -DCOMPILE_UTILITY \
710                                       -DEXIM_TIDYDB \
711                                       -o exim_tidydb.o exim_dbutil.c
712
713 # Compile instructions for exim_dbmbuild
714
715 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
716         @echo "$(CC) exim_dbmbuild.c"
717         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
718                 -o exim_dbmbuild.o exim_dbmbuild.c
719
720 # Utilities use special versions of some modules - typically with debugging
721 # calls cut out.
722
723 util-spool_in.o: $(HDRS) spool_in.c
724         @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
725         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
726
727 util-store.o:    $(HDRS) store.c
728         @echo "$(CC) -DCOMPILE_UTILITY store.c"
729         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
730
731 util-string.o:   $(HDRS) string.c
732         @echo "$(CC) -DCOMPILE_UTILITY string.c"
733         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
734
735 util-md5.o:   $(HDRS) md5.c
736         @echo "$(CC) -DCOMPILE_UTILITY queue.c"
737         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-md5.o md5.c
738
739 util-queue.o:   $(HDRS) queue.c
740         @echo "$(CC) -DCOMPILE_UTILITY queue.c"
741         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
742
743 util-tod.o:   $(HDRS) tod.c
744         @echo "$(CC) -DCOMPILE_UTILITY tod.c"
745         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
746
747 util-tree.o:   $(HDRS) tree.c
748         @echo "$(CC) -DCOMPILE_UTILITY tree.c"
749         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tree.o tree.c
750
751 util-os.o:       $(HDRS) os.c
752         @echo "$(CC) -DCOMPILE_UTILITY os.c"
753         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
754                                       -DCOMPILE_UTILITY \
755                                       -DOS_LOAD_AVERAGE \
756                                       -DFIND_RUNNING_INTERFACES \
757                                       -o util-os.o os.c
758
759 # The local scan module depends only on its own special header, and is compiled
760 # from a source whose location is set by configuration.
761
762 local_scan.o:    config local_scan.h ../$(LOCAL_SCAN_SOURCE)
763         @echo "$(CC) local_scan.c"
764         $(FE)$(CC) -DLOCAL_SCAN -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
765
766 # Dependencies for the "ordinary" exim modules
767
768 acl.o:           $(HDRS) acl.c
769 base64.o:        $(HDRS) mime.h base64.c
770 child.o:         $(HDRS) child.c
771 crypt16.o:       $(HDRS) crypt16.c
772 daemon.o:        $(HDRS) daemon.c
773 dbfn.o:          $(HDRS) dbfn.c
774 debug.o:         $(HDRS) debug.c
775 deliver.o:       $(HDRS) transports/smtp.h deliver.c
776 directory.o:     $(HDRS) directory.c
777 dns.o:           $(HDRS) dns.c
778 dnsbl.o:         $(HDRS) dnsbl.c
779 enq.o:           $(HDRS) enq.c
780 exim.o:          $(HDRS) exim.c
781 expand.o:        $(HDRS) expand.c
782 environment.o:   $(HDRS) environment.c
783 filter.o:        $(HDRS) filter.c
784 filtertest.o:    $(HDRS) filtertest.c
785 globals.o:       $(HDRS) globals.c
786 hash.o:          $(HDRS) hash.c
787 header.o:        $(HDRS) header.c
788 host.o:          $(HDRS) host.c
789 ip.o:            $(HDRS) ip.c
790 log.o:           $(HDRS) log.c
791 lss.o:           $(HDRS) lss.c
792 match.o:         $(HDRS) match.c
793 md5.o:           $(HDRS) md5.c
794 moan.o:          $(HDRS) moan.c
795 os.o:            $(HDRS) $(OS_C_INCLUDES) os.c
796 parse.o:         $(HDRS) parse.c
797 priv.o:          $(HDRS) priv.c
798 queue.o:         $(HDRS) queue.c
799 rda.o:           $(HDRS) rda.c
800 readconf.o:      $(HDRS) readconf.c
801 receive.o:       $(HDRS) receive.c
802 retry.o:         $(HDRS) retry.c
803 rewrite.o:       $(HDRS) rewrite.c
804 rfc2047.o:       $(HDRS) rfc2047.c
805 route.o:         $(HDRS) route.c
806 search.o:        $(HDRS) search.c
807 sieve.o:         $(HDRS) sieve.c
808 smtp_in.o:       $(HDRS) smtp_in.c
809 smtp_out.o:      $(HDRS) smtp_out.c
810 spool_in.o:      $(HDRS) spool_in.c
811 spool_out.o:     $(HDRS) spool_out.c
812 std-crypto.o:    $(HDRS) std-crypto.c
813 store.o:         $(HDRS) store.c
814 string.o:        $(HDRS) string.c
815 tls.o:           $(HDRS) tls.c \
816                  tls-gnu.c tlscert-gnu.c \
817                  tls-openssl.c tlscert-openssl.c \
818                  tls-cipher-stdname.c
819 tod.o:           $(HDRS) tod.c
820 transport.o:     $(HDRS) transport.c
821 tree.o:          $(HDRS) tree.c
822 verify.o:        $(HDRS) transports/smtp.h verify.c
823 dkim.o:          $(HDRS) pdkim/pdkim.h dkim.c
824 dkim_transport.o: $(HDRS) dkim_transport.c
825
826 # Dependencies for WITH_CONTENT_SCAN modules
827
828 malware.o:       $(HDRS) malware.c
829 mime.o:          $(HDRS) mime.h mime.c
830 regex.o:         $(HDRS) regex.c
831 spam.o:          $(HDRS) spam.c
832 spool_mbox.o:    $(HDRS) spool_mbox.c
833
834
835 # Dependencies for EXPERIMENTAL_* modules
836
837 arc.o:          $(HDRS) pdkim/pdkim.h arc.c
838 bmi_spam.o:     $(HDRS) bmi_spam.c
839 dane.o:         $(HDRS) dane.c dane-openssl.c
840 dcc.o:          $(HDRS) dcc.h dcc.c
841 dmarc.o:        $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
842 imap_utf7.o:    $(HDRS) imap_utf7.c
843 spf.o:          $(HDRS) spf.h spf.c
844 srs.o:          $(HDRS) srs.h srs.c
845 utf8.o:         $(HDRS) utf8.c
846
847 # The module containing tables of available lookups, routers, auths, and
848 # transports must be rebuilt if any of them are. However, because the makefiles
849 # for the drivers are always run, we don't actually put the dependencies here,
850 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
851 # drtables.o even though the .a files haven't in fact been updated. Instead
852 # it is arranged that the lower-level makefiles remove drtables.o when they
853 # rebuild the .a files.
854
855 drtables.o:      $(HDRS) drtables.c
856
857 # We depend upon object files built as part of building the lookups library
858 # When using parallel make, we don't have the dependency to force building
859 # in the sub-directory unless we force that dependency:
860
861 $(OBJ_LOOKUPS):  buildlookups
862
863 # The exim monitor's private modules - the sources live in a private
864 # subdirectory. The final binary combines the private modules with some
865 # modules from the main exim binary.
866
867 em_StripChart.o: ../exim_monitor/em_StripChart.c
868 em_TextPop.o:    ../exim_monitor/em_TextPop.c
869 em_globals.o:    ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
870 em_init.o:       ../exim_monitor/em_init.c    ../exim_monitor/em_hdr.h
871 em_log.o:        ../exim_monitor/em_log.c     ../exim_monitor/em_hdr.h
872 em_main.o:       ../exim_monitor/em_main.c    ../exim_monitor/em_hdr.h
873 em_menu.o:       ../exim_monitor/em_menu.c    ../exim_monitor/em_hdr.h
874 em_queue.o:      ../exim_monitor/em_queue.c   ../exim_monitor/em_hdr.h
875 em_strip.o:      ../exim_monitor/em_strip.c   ../exim_monitor/em_hdr.h
876 em_text.o:       ../exim_monitor/em_text.c    ../exim_monitor/em_hdr.h
877 em_xs.o:         ../exim_monitor/em_xs.c      ../exim_monitor/em_hdr.h
878 em_version.o:    ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
879 $(MONBIN): $(HDRS)
880                  @echo "$(CC) exim_monitor/$(@:.o=.c)"
881                  $(FE)$(CC) -o $@ -c $(CFLAGS) -DCOMPILE_UTILITY -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
882                    ../exim_monitor/$(@:.o=.c)
883
884
885 # Targets for the various libraries that Exim uses.
886
887 # The lookups library.
888
889 buildlookups: config
890          @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
891            CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
892            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
893            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
894          @echo " "
895
896 # The routers library.
897
898 buildrouters: config
899          @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
900            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
901            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
902          @echo " "
903
904 # The transports library.
905
906 buildtransports: config
907          @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
908            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
909            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
910          @echo " "
911
912 # The library of authorization modules
913
914 buildauths: config
915          @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
916            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
917            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
918          @echo " "
919
920 # The PDKIM library
921
922 buildpdkim: pdkim/pdkim.a
923 pdkim/pdkim.a: config
924          @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
925            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
926            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
927          @echo " "
928
929 # The "clean", "install", and "makefile" targets just pass themselves back to
930 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
931 # for them in the build directory.
932
933 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
934
935 # Targets for building stand-alone testing programs for basic testing of
936 # some of the building blocks. These are not integrated with the makefile-
937 # building targets. If you change something that is going to cause the
938 # makefile to be rebuilt, you must run "make makefile" before running one
939 # of these.
940
941 # The testing programs use different versions of some modules - usually
942 # with bits cut out that are not relevant to the test in hand. For those
943 # that are used by several tests, we use a different name.
944
945 sa-globals.o:    $(HDRS) globals.c
946         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
947
948 sa-os.o:         $(HDRS) os.c
949         $(CC) -c $(CFLAGS) $(INCLUDE) \
950                                       -DFIND_RUNNING_INTERFACES \
951                                       -o sa-os.o os.c
952
953 # These are the test targets themselves
954
955 test_dbfn:   config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
956                string.o tod.o version.o utf8.o
957         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
958         $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
959         $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
960           dummies.o sa-globals.o sa-os.o store.o string.o \
961           tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
962         rm -f dbfn.o store.o
963
964 test_host:   config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
965                store.o string.o tod.o tree.o
966         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
967         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
968         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
969         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
970         $(LNCC) -o test_host $(LFLAGS) \
971           host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
972           tod.o tree.o $(LIBS) $(LIBRESOLV)
973         rm -f child.o dummies.o host.o dns.o
974
975 test_os:     os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
976         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
977         $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
978           sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
979         rm -f os.o
980
981 test_parse:  config.h parse.c dummies.o sa-globals.o \
982              store.o string.o tod.o version.o utf8.o
983         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
984         $(LNCC) -o test_parse $(LFLAGS) parse.o \
985           dummies.o sa-globals.o store.o string.o tod.o version.o \
986           utf8.o $(LDFLAGS)
987         rm -f parse.o
988
989 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
990         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
991         $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
992           dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
993         rm -f string.o
994
995 # End