Build: fix dependencies for platform-specific os.[ch]
[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 \
6eea004b 83 $(O)/os.h-Darwin \
0d7474f1
JH
84 $(O)/os.h-FreeBSD \
85 $(O)/os.h-Linux \
86 $(O)/os.h-OpenBSD \
87 $(O)/os.h-SunOS5
61ec970d
PH
88 $(SHELL) $(SCRIPTS)/Configure-os.h
89
90# Build the os.c file
91
dfc7c07a
JH
92os.c: ../src/os.c \
93 $(SCRIPTS)/Configure-os.c \
6eea004b
JH
94 $(O)/os.c-FreeBSD \
95 $(O)/os.c-Linux \
96 $(O)/os.c-SunOS5
61ec970d
PH
97 $(SHELL) $(SCRIPTS)/Configure-os.c
98
99# Build the config.h file.
100
101config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
9176e9f0 102 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
61ec970d 103
d185889f
JH
104# Build the builtin-macros data struct
105
b10c87b3 106MACRO_HSRC = macro_predef.h os.h globals.h config.h macros.h \
d185889f
JH
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
5f69a529 111OBJ_MACRO = macro_predef.o \
eb27621d 112 macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
8442641e 113 macro-tls.o \
eb27621d 114 macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
5f69a529
JH
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 \
eb27621d 117 macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
b53c265b 118 macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-authtls.o macro-external.o \
1a7c9a48 119 macro-dkim.o macro-malware.o macro-signing.o
eb27621d
JH
120
121$(OBJ_MACRO): $(MACRO_HSRC)
122
5f69a529
JH
123macro_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
126macro-globals.o : globals.c
127 @echo "$(CC) -DMACRO_PREDEF globals.c"
128 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
129macro-readconf.o : readconf.c
130 @echo "$(CC) -DMACRO_PREDEF readconf.c"
131 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
132macro-route.o : route.c
133 @echo "$(CC) -DMACRO_PREDEF route.c"
134 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
135macro-transport.o: transport.c
136 @echo "$(CC) -DMACRO_PREDEF transport.c"
137 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
138macro-drtables.o : drtables.c
139 @echo "$(CC) -DMACRO_PREDEF drtables.c"
140 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
b10c87b3 141macro-tls.o: tls.c tls-gnu.c tls-openssl.c
8442641e
JH
142 @echo "$(CC) -DMACRO_PREDEF tls.c"
143 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ tls.c
5f69a529
JH
144macro-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
147macro-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
150macro-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
153macro-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
156macro-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
159macro-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
162macro-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
165macro-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
168macro-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
171macro-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
174macro-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
177macro-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
180macro-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
183macro-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
186macro-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
189macro-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
192macro-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
b53c265b
JH
195macro-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
5f69a529
JH
198macro-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
201macro-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
204macro-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
207macro-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
260958d6 210macro-authtls.o: auths/tls.c
5f69a529
JH
211 @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
212 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
213macro-dkim.o: dkim.c
214 @echo "$(CC) -DMACRO_PREDEF dkim.c"
215 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
c11d665d
JH
216macro-malware.o: malware.c
217 @echo "$(CC) -DMACRO_PREDEF malware.c"
218 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ malware.c
260958d6
JH
219macro-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
eb27621d
JH
222
223macro_predef: $(OBJ_MACRO)
89dd53df 224 @echo "$(LNCC) -o $@"
eb27621d 225 $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
d185889f 226
1a7c9a48
JH
227macro.c: macro_predef
228 ./macro_predef > macro.c
61ec970d
PH
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
8497e842
JH
235.PHONY: all config utils \
236 buildauths buildlookups buildpdkim buildrouters \
61ec970d
PH
237 buildtransports checklocalmake clean
238
239
8497e842 240utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
61ec970d
PH
241 exigrep eximstats exipick exiqgrep exiqsumm \
242 transport-filter.pl convert4r3 convert4r4 \
243 exim_checkaccess \
8497e842 244 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
61ec970d
PH
245
246
247# Targets for special-purpose configuration header builders
248buildconfig: buildconfig.c
c1ac6996
PH
249 @echo "$(CC) buildconfig.c"
250 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
61ec970d
PH
251
252
253# Target for the exicyclog utility script
7864a644 254exicyclog: config ../src/exicyclog.src
61ec970d 255 @rm -f exicyclog
983da878 256 @. ./version.sh && sed \
61ec970d
PH
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)?" \
61ec970d 267 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
5c3a378f
TF
268 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
269 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
61ec970d
PH
270 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
271 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
5c3a378f 272 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
983da878
HSHR
273 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
274 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
275 ../src/exicyclog.src > exicyclog-t
276 @mv exicyclog-t exicyclog
277 @chmod a+x exicyclog
c1ac6996 278 @echo ">>> exicyclog script built"
61ec970d
PH
279
280# Target for the exinext utility script
7864a644 281exinext: config ../src/exinext.src
61ec970d 282 @rm -f exinext
983da878 283 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
290 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
291 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
292 ../src/exinext.src > exinext-t
293 @mv exinext-t exinext
294 @chmod a+x exinext
c1ac6996 295 @echo ">>> exinext script built"
61ec970d
PH
296
297# Target for the exiwhat utility script
7864a644 298exiwhat: config ../src/exiwhat.src
61ec970d 299 @rm -f exiwhat
983da878 300 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
313 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
314 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
6d56f3f4 315 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
61ec970d
PH
316 ../src/exiwhat.src > exiwhat-t
317 @mv exiwhat-t exiwhat
318 @chmod a+x exiwhat
c1ac6996 319 @echo ">>> exiwhat script built"
61ec970d
PH
320
321# Target for the exim_checkaccess utility script
7864a644 322exim_checkaccess: config ../src/exim_checkaccess.src
61ec970d 323 @rm -f exim_checkaccess
983da878 324 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
332 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
333 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
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
7864a644 340eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
61ec970d
PH
341 ../Local/eximon.conf
342 @rm -f eximon
343 $(SHELL) $(SCRIPTS)/Configure-eximon
983da878 344 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
354 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
355 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
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
983da878 362exigrep: config ../src/exigrep.src
61ec970d 363 @rm -f exigrep
983da878 364 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
371 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
372 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
373 ../src/exigrep.src > exigrep-t
374 @mv exigrep-t exigrep
375 @chmod a+x exigrep
c1ac6996 376 @echo ">>> exigrep script built"
61ec970d 377
983da878 378eximstats: config ../src/eximstats.src
61ec970d 379 @rm -f eximstats
983da878 380 @. ./version.sh && sed \
61ec970d 381 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
983da878
HSHR
382 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
383 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
384 ../src/eximstats.src > eximstats-t
385 @mv eximstats-t eximstats
386 @chmod a+x eximstats
c1ac6996 387 @echo ">>> eximstats script built"
61ec970d 388
983da878 389exiqgrep: config ../src/exiqgrep.src
61ec970d 390 @rm -f exiqgrep
983da878 391 @. ./version.sh && sed \
61ec970d
PH
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)?" \
983da878
HSHR
397 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
398 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
399 ../src/exiqgrep.src > exiqgrep-t
400 @mv exiqgrep-t exiqgrep
401 @chmod a+x exiqgrep
c1ac6996 402 @echo ">>> exiqgrep script built"
61ec970d 403
983da878 404exiqsumm: config ../src/exiqsumm.src
61ec970d 405 @rm -f exiqsumm
983da878
HSHR
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}?" \
61ec970d
PH
410 ../src/exiqsumm.src > exiqsumm-t
411 @mv exiqsumm-t exiqsumm
412 @chmod a+x exiqsumm
c1ac6996 413 @echo ">>> exiqsumm script built"
61ec970d 414
983da878 415exipick: config ../src/exipick.src
61ec970d 416 @rm -f exipick
983da878
HSHR
417 @. ./version.sh && sed \
418 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
61ec970d 419 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
57397119 420 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
983da878
HSHR
421 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
422 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
61ec970d
PH
423 ../src/exipick.src > exipick-t
424 @mv exipick-t exipick
425 @chmod a+x exipick
c1ac6996 426 @echo ">>> exipick script built"
61ec970d 427
983da878 428transport-filter.pl: config ../src/transport-filter.src
61ec970d 429 @rm -f transport-filter.pl
983da878
HSHR
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}?" \
61ec970d
PH
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
c1ac6996 437 @echo ">>> transport-filter.pl script built"
61ec970d 438
983da878 439convert4r3: config ../src/convert4r3.src
61ec970d 440 @rm -f convert4r3
983da878
HSHR
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}?" \
61ec970d
PH
445 ../src/convert4r3.src > convert4r3-t
446 @mv convert4r3-t convert4r3
447 @chmod a+x convert4r3
c1ac6996 448 @echo ">>> convert4r3 script built"
61ec970d 449
983da878 450convert4r4: config ../src/convert4r4.src
61ec970d 451 @rm -f convert4r4
983da878
HSHR
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}?" \
61ec970d
PH
456 ../src/convert4r4.src > convert4r4-t
457 @mv convert4r4-t convert4r4
458 @chmod a+x convert4r4
c1ac6996 459 @echo ">>> convert4r4 script built"
61ec970d
PH
460
461
8523533c
TK
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
466OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
617d3932
JH
467OBJ_EXPERIMENTAL = arc.o \
468 bmi_spam.o \
899b8bbc
JH
469 dane.o \
470 dcc.o \
471 dmarc.o \
472 imap_utf7.o \
473 spf.o \
474 srs.o \
475 utf8.o
8523533c 476
61ec970d
PH
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
c6fa5dfa
PP
480OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
481
f4d091fb 482OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
1a7c9a48
JH
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 \
d6e81e5f 485 header.o host.o ip.o log.o lss.o match.o md5.o moan.o \
61ec970d
PH
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 \
a799883d 489 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
1a7c9a48 490 environment.o macro.o \
c6fa5dfa 491 $(OBJ_LOOKUPS) \
8523533c 492 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
03d5892b 493 $(OBJ_EXPERIMENTAL)
61ec970d 494
24697698
JH
495exim: buildlookups buildauths pdkim/pdkim.a \
496 buildrouters buildtransports \
5901f0ab 497 $(OBJ_EXIM) version.o
c1ac6996
PH
498 @echo "$(LNCC) -o exim"
499 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
61ec970d 500 routers/routers.a transports/transports.a lookups/lookups.a \
80a47a2c 501 auths/auths.a pdkim/pdkim.a \
61ec970d
PH
502 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
503 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
8eb9f5bd 504 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
61ec970d
PH
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
516OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
517
518exim_dumpdb: $(OBJ_DUMPDB)
c1ac6996
PH
519 @echo "$(LNCC) -o exim_dumpdb"
520 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
61ec970d
PH
521 $(LIBS) $(EXTRALIBS) $(DBMLIB)
522 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
523 echo $(STRIP_COMMAND) exim_dumpdb; \
524 $(STRIP_COMMAND) exim_dumpdb; \
525 fi
61ec970d
PH
526 @echo ">>> exim_dumpdb utility built"
527 @echo " "
528
529# The utility for interrogating/fixing the contents of an exim database
530
d6e81e5f 531OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o util-md5.o
61ec970d 532
d6e81e5f 533exim_fixdb: $(OBJ_FIXDB)
c1ac6996
PH
534 @echo "$(LNCC) -o exim_fixdb"
535 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
d6e81e5f 536 $(LIBS) $(EXTRALIBS) $(DBMLIB)
61ec970d
PH
537 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
538 echo $(STRIP_COMMAND) exim_fixdb; \
539 $(STRIP_COMMAND) exim_fixdb; \
540 fi
61ec970d
PH
541 @echo ">>> exim_fixdb utility built"
542 @echo " "
543
544# The utility for tidying the contents of an exim database
545
546OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
547
548exim_tidydb: $(OBJ_TIDYDB)
c1ac6996
PH
549 @echo "$(LNCC) -o exim_tidydb"
550 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
61ec970d
PH
551 $(LIBS) $(EXTRALIBS) $(DBMLIB)
552 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
553 echo $(STRIP_COMMAND) exim_tidydb; \
554 $(STRIP_COMMAND) exim_tidydb; \
555 fi
61ec970d
PH
556 @echo ">>> exim_tidydb utility built"
557 @echo " "
558
559# The utility for building dbm files
560
561exim_dbmbuild: exim_dbmbuild.o
c1ac6996 562 @echo "$(LNCC) -o exim_dbmbuild"
9070e423 563 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
61ec970d
PH
564 $(LIBS) $(EXTRALIBS) $(DBMLIB)
565 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
566 echo $(STRIP_COMMAND) exim_dbmbuild; \
567 $(STRIP_COMMAND) exim_dbmbuild; \
568 fi
61ec970d
PH
569 @echo ">>> exim_dbmbuild utility built"
570 @echo " "
571
572# The utility for locking a mailbox while messing around with it
573
3ae1aa79 574exim_lock: exim_lock.c os.h
c1ac6996
PH
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 \
61ec970d
PH
579 $(LIBS) $(EXTRALIBS)
580 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
581 echo $(STRIP_COMMAND) exim_lock; \
582 $(STRIP_COMMAND) exim_lock; \
583 fi
61ec970d
PH
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
594MONBIN = 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
41313d92
JH
601OBJ_MONBIN = util-spool_in.o \
602 util-store.o \
603 util-string.o \
604 util-queue.o \
571b2715 605 util-tod.o \
e59797e3 606 util-tree.o \
41313d92 607 $(MONBIN)
61ec970d 608
e59797e3
JH
609eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) ../exim_monitor/em_version.c \
610 mytypes.h store.h macros.h
c1ac6996
PH
611 @echo "$(CC) exim_monitor/em_version.c"
612 $(FE)$(CC) -o em_version.o -c \
61ec970d 613 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
c1ac6996
PH
614 @echo "$(LNCC) -o eximon.bin"
615 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
48dd94fd 616 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
61ec970d
PH
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
61ec970d
PH
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
4c04137d 627# which cause everything to be rebuilt. PHDRS is the same, for the use
61ec970d
PH
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
5fb822fc
JH
632HDRS = blob.h \
633 config.h \
13510a25
HSHR
634 dbfunctions.h \
635 dbstuff.h \
636 exim.h \
637 functions.h \
638 globals.h \
5fb822fc 639 hash.h \
13510a25
HSHR
640 local_scan.h \
641 macros.h \
642 mytypes.h \
5fb822fc 643 sha_ver.h \
13510a25
HSHR
644 structs.h \
645 os.h
646PHDRS = ../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
61ec970d
PH
657
658.SUFFIXES: .o .c
c1ac6996
PH
659.c.o:; @echo "$(CC) $*.c"
660 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
61ec970d 661
5901f0ab
TF
662# Update Exim's version information and build the version object.
663
983da878 664version.h version.sh::
5901f0ab
TF
665 @../scripts/reversion
666
c6fa5dfa
PP
667cnumber.h: version.h
668
5901f0ab
TF
669version.o: $(HDRS) cnumber.h version.h version.c
670
61ec970d
PH
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
675dummies.o: dummies.c
676
677# Compile instructions for perl.o for when EXIM_PERL is set
678
679perl.o: $(HDRS) perl.c
c1ac6996
PH
680 @echo "$(PERL_CC) perl.c"
681 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
61ec970d
PH
682
683# Compile instructions for the database utility modules
684
685exim_dumpdb.o: $(HDRS) exim_dbutil.c
c1ac6996
PH
686 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
687 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
61ec970d
PH
688 -DCOMPILE_UTILITY \
689 -DEXIM_DUMPDB \
690 -o exim_dumpdb.o exim_dbutil.c
691
692exim_fixdb.o: $(HDRS) exim_dbutil.c
c1ac6996
PH
693 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
694 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
61ec970d
PH
695 -DCOMPILE_UTILITY \
696 -DEXIM_FIXDB \
697 -o exim_fixdb.o exim_dbutil.c
698
699exim_tidydb.o: $(HDRS) exim_dbutil.c
c1ac6996
PH
700 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
701 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
61ec970d
PH
702 -DCOMPILE_UTILITY \
703 -DEXIM_TIDYDB \
704 -o exim_tidydb.o exim_dbutil.c
705
706# Compile instructions for exim_dbmbuild
707
708exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
c1ac6996 709 @echo "$(CC) exim_dbmbuild.c"
0a6c178c
JH
710 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
711 -o exim_dbmbuild.o exim_dbmbuild.c
61ec970d
PH
712
713# Utilities use special versions of some modules - typically with debugging
714# calls cut out.
715
716util-spool_in.o: $(HDRS) spool_in.c
c1ac6996
PH
717 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
718 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
61ec970d
PH
719
720util-store.o: $(HDRS) store.c
c1ac6996
PH
721 @echo "$(CC) -DCOMPILE_UTILITY store.c"
722 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
61ec970d
PH
723
724util-string.o: $(HDRS) string.c
c1ac6996
PH
725 @echo "$(CC) -DCOMPILE_UTILITY string.c"
726 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
61ec970d 727
d6e81e5f
JH
728util-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
41313d92
JH
732util-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
571b2715
JH
736util-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
e59797e3
JH
740util-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
61ec970d 744util-os.o: $(HDRS) os.c
c1ac6996
PH
745 @echo "$(CC) -DCOMPILE_UTILITY os.c"
746 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
61ec970d
PH
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
7864a644 755local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
c1ac6996 756 @echo "$(CC) local_scan.c"
e59797e3 757 $(FE)$(CC) -DLOCAL_SCAN -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
61ec970d
PH
758
759# Dependencies for the "ordinary" exim modules
760
761acl.o: $(HDRS) acl.c
f4d091fb 762base64.o: $(HDRS) mime.h base64.c
61ec970d
PH
763child.o: $(HDRS) child.c
764crypt16.o: $(HDRS) crypt16.c
765daemon.o: $(HDRS) daemon.c
766dbfn.o: $(HDRS) dbfn.c
767debug.o: $(HDRS) debug.c
e39fdc85 768deliver.o: $(HDRS) transports/smtp.h deliver.c
61ec970d
PH
769directory.o: $(HDRS) directory.c
770dns.o: $(HDRS) dns.c
771enq.o: $(HDRS) enq.c
772exim.o: $(HDRS) exim.c
773expand.o: $(HDRS) expand.c
bc3c7bb7 774environment.o: $(HDRS) environment.c
61ec970d
PH
775filter.o: $(HDRS) filter.c
776filtertest.o: $(HDRS) filtertest.c
777globals.o: $(HDRS) globals.c
5fb822fc 778hash.o: $(HDRS) hash.c
61ec970d
PH
779header.o: $(HDRS) header.c
780host.o: $(HDRS) host.c
781ip.o: $(HDRS) ip.c
782log.o: $(HDRS) log.c
783lss.o: $(HDRS) lss.c
784match.o: $(HDRS) match.c
d6e81e5f 785md5.o: $(HDRS) md5.c
61ec970d 786moan.o: $(HDRS) moan.c
43ff44e9 787os.o: $(HDRS) $(OS_C_INCLUDES) os.c
61ec970d
PH
788parse.o: $(HDRS) parse.c
789queue.o: $(HDRS) queue.c
790rda.o: $(HDRS) rda.c
791readconf.o: $(HDRS) readconf.c
792receive.o: $(HDRS) receive.c
793retry.o: $(HDRS) retry.c
794rewrite.o: $(HDRS) rewrite.c
795rfc2047.o: $(HDRS) rfc2047.c
796route.o: $(HDRS) route.c
797search.o: $(HDRS) search.c
798sieve.o: $(HDRS) sieve.c
799smtp_in.o: $(HDRS) smtp_in.c
800smtp_out.o: $(HDRS) smtp_out.c
801spool_in.o: $(HDRS) spool_in.c
802spool_out.o: $(HDRS) spool_out.c
a799883d 803std-crypto.o: $(HDRS) std-crypto.c
61ec970d
PH
804store.o: $(HDRS) store.c
805string.o: $(HDRS) string.c
dfe7d917 806tls.o: $(HDRS) tls.c \
06cf6fdc 807 tls-gnu.c tlscert-gnu.c \
f1be21cf
JH
808 tls-openssl.c tlscert-openssl.c \
809 tls-cipher-stdname.c
61ec970d
PH
810tod.o: $(HDRS) tod.c
811transport.o: $(HDRS) transport.c
812tree.o: $(HDRS) tree.c
9be4572b 813verify.o: $(HDRS) transports/smtp.h verify.c
1a7c9a48
JH
814dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
815dkim_transport.o: $(HDRS) dkim_transport.c
8523533c
TK
816
817# Dependencies for WITH_CONTENT_SCAN modules
818
819malware.o: $(HDRS) malware.c
f4d091fb 820mime.o: $(HDRS) mime.h mime.c
8523533c
TK
821regex.o: $(HDRS) regex.c
822spam.o: $(HDRS) spam.c
823spool_mbox.o: $(HDRS) spool_mbox.c
824
825
8523533c
TK
826# Dependencies for EXPERIMENTAL_* modules
827
617d3932 828arc.o: $(HDRS) pdkim/pdkim.h arc.c
3b957582 829bmi_spam.o: $(HDRS) bmi_spam.c
899b8bbc 830dane.o: $(HDRS) dane.c dane-openssl.c
3b957582
JB
831dcc.o: $(HDRS) dcc.h dcc.c
832dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
ed0512a1 833imap_utf7.o: $(HDRS) imap_utf7.c
3b957582
JB
834spf.o: $(HDRS) spf.h spf.c
835srs.o: $(HDRS) srs.h srs.c
836utf8.o: $(HDRS) utf8.c
8523533c 837
61ec970d
PH
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
846drtables.o: $(HDRS) drtables.c
847
c6fa5dfa
PP
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
24697698 852$(OBJ_LOOKUPS): buildlookups
61ec970d
PH
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
858em_StripChart.o: ../exim_monitor/em_StripChart.c
859em_TextPop.o: ../exim_monitor/em_TextPop.c
860em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
861em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
862em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
863em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
864em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
865em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
866em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
867em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
868em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
869em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
870$(MONBIN): $(HDRS)
c1ac6996
PH
871 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
872 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
61ec970d
PH
873 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
874
875
23510047 876# Targets for the various libraries that Exim uses.
61ec970d 877
61ec970d
PH
878# The lookups library.
879
7864a644 880buildlookups: config
7f2a2a43 881 @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
5901f0ab
TF
882 CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
883 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
7f2a2a43
PP
884 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
885 @echo " "
61ec970d
PH
886
887# The routers library.
888
7864a644 889buildrouters: config
7f2a2a43 890 @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
ebcb507f 891 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
7f2a2a43
PP
892 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
893 @echo " "
61ec970d
PH
894
895# The transports library.
896
7864a644 897buildtransports: config
7f2a2a43 898 @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
ebcb507f 899 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
7f2a2a43
PP
900 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
901 @echo " "
61ec970d
PH
902
903# The library of authorization modules
904
7864a644 905buildauths: config
7f2a2a43 906 @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
ebcb507f 907 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
7f2a2a43
PP
908 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
909 @echo " "
61ec970d 910
80a47a2c
TK
911# The PDKIM library
912
22476721 913buildpdkim: pdkim/pdkim.a
7864a644 914pdkim/pdkim.a: config
7f2a2a43 915 @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
80a47a2c 916 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
7f2a2a43
PP
917 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
918 @echo " "
80a47a2c 919
61ec970d
PH
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
924clean 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
936sa-globals.o: $(HDRS) globals.c
937 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
938
939sa-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
946test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
505d976a 947 string.o tod.o version.o utf8.o
61ec970d 948 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
92e84038 949 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
61ec970d
PH
950 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
951 dummies.o sa-globals.o sa-os.o store.o string.o \
505d976a 952 tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
92e84038 953 rm -f dbfn.o store.o
61ec970d 954
9edc04ce 955test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
e7726cbf
PH
956 store.o string.o tod.o tree.o
957 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
61ec970d
PH
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) \
e7726cbf
PH
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
61ec970d 965
505d976a 966test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
61ec970d
PH
967 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
968 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
505d976a 969 sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
61ec970d
PH
970 rm -f os.o
971
972test_parse: config.h parse.c dummies.o sa-globals.o \
505d976a 973 store.o string.o tod.o version.o utf8.o
61ec970d
PH
974 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
975 $(LNCC) -o test_parse $(LFLAGS) parse.o \
505d976a
HSHR
976 dummies.o sa-globals.o store.o string.o tod.o version.o \
977 utf8.o $(LDFLAGS)
61ec970d
PH
978 rm -f parse.o
979
505d976a 980test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
61ec970d
PH
981 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
982 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
505d976a 983 dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
61ec970d
PH
984 rm -f string.o
985
986# End