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