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