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