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