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