1 # This file is the basis of the main makefile for Exim and friends. The
2 # makefile at the top level arranges to build the main makefile by calling
3 # scripts/Configure-Makefile from within the build directory. This
4 # concatenates the configuration settings from Local/Makefile and other,
5 # optional, Local/* files at the front of this file, to create Makefile in the
8 # Copyright (c) The Exim Maintainers 1995 - 2022
9 # SPDX-License-Identifier: GPL-2.0-or-later
14 EDITME = ../Local/Makefile
15 EXIMON_EDITME = ../Local/eximon.conf
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.
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.
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.
40 config: $(EDITME) checklocalmake Makefile os.c config.h version.h version.sh macro.c
43 @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
44 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
45 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
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); \
53 if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
58 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
59 @echo "*** appropriate changes for your site."
65 @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
66 @echo "*** appropriate changes for your site."
68 @test ! -d ../Local && mkdir ../Local
71 # Check that the local Makefile is up-to-date
73 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
74 $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
76 @echo "*** Makefile needs rebuilding"
77 @echo "*** Please run \"make makefile\" at top level"
81 # Build (link) the os.h file
83 os.h: $(SCRIPTS)/Configure-os.h \
89 $(SHELL) $(SCRIPTS)/Configure-os.h
94 $(SCRIPTS)/Configure-os.c \
99 $(SHELL) $(SCRIPTS)/Configure-os.c
101 # Build the config.h file.
103 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
104 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
106 # Build the builtin-macros data struct
108 MACRO_HSRC = macro_predef.h os.h globals.h config.h macros.h \
109 routers/accept.h routers/dnslookup.h routers/ipliteral.h \
110 routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
113 OBJ_MACRO = macro_predef.o \
114 macro-globals.o macro-readconf.o macro-expand.o macro-route.o \
115 macro-transport.o macro-drtables.o macro-acl.o macro-tls.o \
116 macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
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 \
119 macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
120 macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-authtls.o macro-external.o \
121 macro-dkim.o macro-malware.o macro-signing.o
123 $(OBJ_MACRO): $(MACRO_HSRC)
125 macro_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
128 macro-globals.o : globals.c
129 @echo "$(CC) -DMACRO_PREDEF globals.c"
130 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
131 macro-readconf.o : readconf.c
132 @echo "$(CC) -DMACRO_PREDEF readconf.c"
133 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
134 macro-expand.o : expand.c
135 @echo "$(CC) -DMACRO_PREDEF expand.c"
136 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ expand.c
137 macro-route.o : route.c
138 @echo "$(CC) -DMACRO_PREDEF route.c"
139 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
140 macro-transport.o: transport.c
141 @echo "$(CC) -DMACRO_PREDEF transport.c"
142 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
143 macro-drtables.o : drtables.c
144 @echo "$(CC) -DMACRO_PREDEF drtables.c"
145 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
147 @echo "$(CC) -DMACRO_PREDEF acl.c"
148 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ acl.c
149 macro-tls.o: tls.c tls-gnu.c tls-openssl.c
150 @echo "$(CC) -DMACRO_PREDEF tls.c"
151 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ tls.c
152 macro-appendfile.o : transports/appendfile.c
153 @echo "$(CC) -DMACRO_PREDEF transports/appendfile.c"
154 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/appendfile.c
155 macro-autoreply.o : transports/autoreply.c
156 @echo "$(CC) -DMACRO_PREDEF transports/autoreply.c"
157 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/autoreply.c
158 macro-lmtp.o: transports/lmtp.c
159 @echo "$(CC) -DMACRO_PREDEF transports/lmtp.c"
160 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/lmtp.c
161 macro-pipe.o : transports/pipe.c
162 @echo "$(CC) -DMACRO_PREDEF transports/pipe.c"
163 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/pipe.c
164 macro-queuefile.o : transports/queuefile.c
165 @echo "$(CC) -DMACRO_PREDEF transports/queuefile.c"
166 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/queuefile.c
167 macro-smtp.o : transports/smtp.c
168 @echo "$(CC) -DMACRO_PREDEF transports/smtp.c"
169 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/smtp.c
170 macro-accept.o : routers/accept.c
171 @echo "$(CC) -DMACRO_PREDEF routers/accept.c"
172 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/accept.c
173 macro-dnslookup.o : routers/dnslookup.c
174 @echo "$(CC) -DMACRO_PREDEF routers/dnslookup.c"
175 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/dnslookup.c
176 macro-ipliteral.o : routers/ipliteral.c
177 @echo "$(CC) -DMACRO_PREDEF routers/ipliteral.c"
178 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/ipliteral.c
179 macro-iplookup.o : routers/iplookup.c
180 @echo "$(CC) -DMACRO_PREDEF routers/iplookup.c"
181 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/iplookup.c
182 macro-manualroute.o : routers/manualroute.c
183 @echo "$(CC) -DMACRO_PREDEF routers/manualroute.c"
184 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/manualroute.c
185 macro-queryprogram.o : routers/queryprogram.c
186 @echo "$(CC) -DMACRO_PREDEF routers/queryprogram.c"
187 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/queryprogram.c
188 macro-redirect.o : routers/redirect.c
189 @echo "$(CC) -DMACRO_PREDEF routers/redirect.c"
190 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/redirect.c
191 macro-auth-spa.o : auths/auth-spa.c
192 @echo "$(CC) -DMACRO_PREDEF auths/auth-spa.c"
193 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/auth-spa.c
194 macro-cram_md5.o : auths/cram_md5.c
195 @echo "$(CC) -DMACRO_PREDEF auths/cram_md5.c"
196 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cram_md5.c
197 macro-cyrus_sasl.o : auths/cyrus_sasl.c
198 @echo "$(CC) -DMACRO_PREDEF auths/cyrus_sasl.c"
199 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cyrus_sasl.c
200 macro-dovecot.o: auths/dovecot.c
201 @echo "$(CC) -DMACRO_PREDEF auths/dovecot.c"
202 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/dovecot.c
203 macro-external.o: auths/external.c
204 @echo "$(CC) -DMACRO_PREDEF auths/external.c"
205 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/external.c
206 macro-gsasl_exim.o : auths/gsasl_exim.c
207 @echo "$(CC) -DMACRO_PREDEF auths/gsasl_exim.c"
208 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/gsasl_exim.c
209 macro-heimdal_gssapi.o: auths/heimdal_gssapi.c
210 @echo "$(CC) -DMACRO_PREDEF auths/heimdal_gssapi.c"
211 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/heimdal_gssapi.c
212 macro-plaintext.o : auths/plaintext.c
213 @echo "$(CC) -DMACRO_PREDEF auths/plaintext.c"
214 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/plaintext.c
215 macro-spa.o : auths/spa.c
216 @echo "$(CC) -DMACRO_PREDEF auths/spa.c"
217 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/spa.c
218 macro-authtls.o: auths/tls.c
219 @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
220 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
222 @echo "$(CC) -DMACRO_PREDEF dkim.c"
223 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ dkim.c
224 macro-malware.o: malware.c
225 @echo "$(CC) -DMACRO_PREDEF malware.c"
226 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ malware.c
227 macro-signing.o: pdkim/signing.c
228 @echo "$(CC) -DMACRO_PREDEF pdkim/signing.c"
229 $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ pdkim/signing.c
231 macro_predef: $(OBJ_MACRO)
232 @echo "$(LNCC) -o $@"
233 $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
235 macro.c: macro_predef
236 ./macro_predef > macro.c
238 # This target is recognized specially by GNU make. It records those targets
239 # that do not correspond to files that are being built and which should
240 # therefore always be run, even if the files exist. This shouldn't in fact be a
241 # problem, but it does no harm. Other make programs will just ignore this.
243 .PHONY: all config utils \
244 buildauths buildlookups buildpdkim buildrouters \
245 buildtransports checklocalmake clean
248 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
249 exigrep eximstats exipick exiqgrep exiqsumm \
250 transport-filter.pl convert4r3 convert4r4 \
252 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock \
256 # Targets for special-purpose configuration header builders
257 buildconfig: buildconfig.c
258 @echo "$(CC) buildconfig.c"
259 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
262 # Target for the exicyclog utility script
263 exicyclog: config ../src/exicyclog.src
265 @. ./version.sh && sed \
266 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
269 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
270 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
271 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
272 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
273 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
274 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
275 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
276 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
277 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
278 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
279 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
280 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
281 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
282 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
283 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
284 ../src/exicyclog.src > exicyclog-t
285 @mv exicyclog-t exicyclog
287 @echo ">>> exicyclog script built"
289 # Target for the exinext utility script
290 exinext: config ../src/exinext.src
292 @. ./version.sh && sed \
293 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
296 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
297 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
298 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
299 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
300 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
301 ../src/exinext.src > exinext-t
302 @mv exinext-t exinext
304 @echo ">>> exinext script built"
306 # Target for the exiwhat utility script
307 exiwhat: config ../src/exiwhat.src
309 @. ./version.sh && sed \
310 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
313 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
314 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
315 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
316 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
317 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
318 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
319 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
320 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
321 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
322 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
323 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
324 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
325 ../src/exiwhat.src > exiwhat-t
326 @mv exiwhat-t exiwhat
328 @echo ">>> exiwhat script built"
330 # Target for the exim_checkaccess utility script
331 exim_checkaccess: config ../src/exim_checkaccess.src
332 @rm -f exim_checkaccess
333 @. ./version.sh && sed \
334 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
337 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
338 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
339 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
340 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
341 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
342 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
343 ../src/exim_checkaccess.src > exim_checkaccess-t
344 @mv exim_checkaccess-t exim_checkaccess
345 @chmod a+x exim_checkaccess
346 @echo ">>> exim_checkaccess script built"; echo ""
348 # Target for the Exim monitor start-up script
349 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
352 $(SHELL) $(SCRIPTS)/Configure-eximon
353 @. ./version.sh && sed \
354 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
357 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
358 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
359 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
360 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
361 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
362 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
363 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
364 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
365 ../src/eximon.src >> eximon
366 @echo ">>> eximon script built"; echo ""
368 # Targets for utilities; these are all Perl scripts that have to get the
369 # location of Perl put in them. A few need other things as well.
371 exigrep: config ../src/exigrep.src
373 @. ./version.sh && sed \
374 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
377 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
378 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
379 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
380 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
381 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
382 ../src/exigrep.src > exigrep-t
383 @mv exigrep-t exigrep
385 @echo ">>> exigrep script built"
387 exim_msgdate: config ../src/exim_msgdate.src
389 @. ./version.sh && sed \
390 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
393 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
394 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
395 -e "s?BASE_62?$${BASE_62:-62}?" \
396 -e "s?CONFIGURE_FILE\"?$(CONFIGURE_FILE)\"?" \
397 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
398 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
399 ../src/exim_msgdate.src > exim_msgdate-t
400 @mv exim_msgdate-t exim_msgdate
401 @chmod a+x exim_msgdate
402 @echo ">>> exim_msgdate script built"
404 eximstats: config ../src/eximstats.src
406 @. ./version.sh && sed \
407 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
408 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
409 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
410 ../src/eximstats.src > eximstats-t
411 @mv eximstats-t eximstats
413 @echo ">>> eximstats script built"
415 exiqgrep: config ../src/exiqgrep.src
417 @. ./version.sh && sed \
418 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
421 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
422 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
423 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
424 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
425 ../src/exiqgrep.src > exiqgrep-t
426 @mv exiqgrep-t exiqgrep
428 @echo ">>> exiqgrep script built"
430 exiqsumm: config ../src/exiqsumm.src
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}?" \
436 ../src/exiqsumm.src > exiqsumm-t
437 @mv exiqsumm-t exiqsumm
439 @echo ">>> exiqsumm script built"
441 exipick: config ../src/exipick.src
443 @. ./version.sh && sed \
444 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
445 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
446 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
447 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
448 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
449 ../src/exipick.src > exipick-t
450 @mv exipick-t exipick
452 @echo ">>> exipick script built"
454 transport-filter.pl: config ../src/transport-filter.src
455 @rm -f transport-filter.pl
456 @. ./version.sh && sed \
457 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
458 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
459 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
460 ../src/transport-filter.src > transport-filter.pl-t
461 @mv transport-filter.pl-t transport-filter.pl
462 @chmod a+x transport-filter.pl
463 @echo ">>> transport-filter.pl script built"
465 convert4r3: config ../src/convert4r3.src
467 @. ./version.sh && sed \
468 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
469 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
470 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
471 ../src/convert4r3.src > convert4r3-t
472 @mv convert4r3-t convert4r3
473 @chmod a+x convert4r3
474 @echo ">>> convert4r3 script built"
476 convert4r4: config ../src/convert4r4.src
478 @. ./version.sh && sed \
479 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
480 -e "s?EXIM_RELEASE_VERSION?$${EXIM_RELEASE_VERSION}?" \
481 -e "s?EXIM_VARIANT_VERSION?$${EXIM_VARIANT_VERSION}?" \
482 ../src/convert4r4.src > convert4r4-t
483 @mv convert4r4-t convert4r4
484 @chmod a+x convert4r4
485 @echo ">>> convert4r4 script built"
488 # These are objects of optional features. They are always compiled, but
489 # if the corresponding #defines are not set, they wind up empty and
490 # are thrown away by the linker.
492 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
493 OBJ_EXPERIMENTAL = arc.o \
503 # Targets for final binaries; the main one has a build number which is
504 # updated each time. We don't bother with that for the auxiliaries.
506 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
508 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
509 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
510 filtertest.o globals.o dkim.o dkim_transport.o dnsbl.o hash.o \
511 header.o host.o host_address.o ip.o log.o lss.o match.o md5.o moan.o \
512 os.o parse.o priv.o proxy.o queue.o \
513 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o regex_cache.o \
514 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
515 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
516 environment.o macro.o \
518 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
521 exim: buildlookups buildauths pdkim/pdkim.a \
522 buildrouters buildtransports \
523 $(OBJ_EXIM) version.o
524 @echo "$(LNCC) -o exim"
525 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
526 routers/routers.a transports/transports.a lookups/lookups.a \
527 auths/auths.a pdkim/pdkim.a \
528 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
529 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
530 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
531 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
532 echo $(STRIP_COMMAND) exim; \
533 $(STRIP_COMMAND) exim; \
537 @echo ">>> exim binary built"
540 # The utility for dumping the contents of an exim database
542 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
544 exim_dumpdb: $(OBJ_DUMPDB)
545 @echo "$(LNCC) -o exim_dumpdb"
546 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
547 $(LIBS) $(EXTRALIBS) $(DBMLIB)
548 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
549 echo $(STRIP_COMMAND) exim_dumpdb; \
550 $(STRIP_COMMAND) exim_dumpdb; \
552 @echo ">>> exim_dumpdb utility built"
555 # The utility for interrogating/fixing the contents of an exim database
557 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o util-md5.o
559 exim_fixdb: $(OBJ_FIXDB)
560 @echo "$(LNCC) -o exim_fixdb"
561 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
562 $(LIBS) $(EXTRALIBS) $(DBMLIB)
563 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
564 echo $(STRIP_COMMAND) exim_fixdb; \
565 $(STRIP_COMMAND) exim_fixdb; \
567 @echo ">>> exim_fixdb utility built"
570 # The utility for tidying the contents of an exim database
572 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
574 exim_tidydb: $(OBJ_TIDYDB)
575 @echo "$(LNCC) -o exim_tidydb"
576 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
577 $(LIBS) $(EXTRALIBS) $(DBMLIB)
578 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
579 echo $(STRIP_COMMAND) exim_tidydb; \
580 $(STRIP_COMMAND) exim_tidydb; \
582 @echo ">>> exim_tidydb utility built"
585 # The utility for building dbm files
587 exim_dbmbuild: exim_dbmbuild.o
588 @echo "$(LNCC) -o exim_dbmbuild"
589 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
590 $(LIBS) $(EXTRALIBS) $(DBMLIB)
591 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
592 echo $(STRIP_COMMAND) exim_dbmbuild; \
593 $(STRIP_COMMAND) exim_dbmbuild; \
595 @echo ">>> exim_dbmbuild utility built"
598 # The utility for locking a mailbox while messing around with it
600 exim_lock: exim_lock.c os.h
601 @echo "$(CC) exim_lock.c"
602 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
603 @echo "$(LNCC) -o exim_lock"
604 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
606 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
607 echo $(STRIP_COMMAND) exim_lock; \
608 $(STRIP_COMMAND) exim_lock; \
610 @echo ">>> exim_lock utility built"
613 # The X-based Exim monitor program's binary part. There's a macro for cutting
614 # out the modified TextPop module, because some antique link editors cannot
615 # handle the fact that it is redefining things that are found later in the
618 # Object modules that are the unique Eximon modules
620 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
621 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
624 # The complete modules list also includes some specially compiled versions of
625 # code from the main Exim source tree.
627 OBJ_MONBIN = util-host_address.o \
636 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) ../exim_monitor/em_version.c \
637 mytypes.h store.h macros.h
638 @echo "$(CC) exim_monitor/em_version.c"
639 $(FE)$(CC) -o em_version.o -c \
640 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
641 @echo "$(LNCC) -o eximon.bin"
642 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
643 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
644 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
645 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
646 echo $(STRIP_COMMAND) eximon.bin; \
647 $(STRIP_COMMAND) eximon.bin; \
649 @echo ">>> exim monitor binary built"
653 # Compile step for most of the exim modules. HDRS is a list of headers
654 # which cause everything to be rebuilt. PHDRS is the same, for the use
655 # of routers, transports, and authenticators. I can't find a way of doing this
656 # in one. This list is overkill, but it doesn't really take much time to
657 # rebuild Exim on a modern computer.
674 PHDRS = ../config.h \
680 ../hintsdb_structs.h \
688 .c.o:; @echo "$(CC) $*.c"
689 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
691 # Update Exim's version information and build the version object. The dependency
692 # chain here avoids problems under parallel-make.
695 @../scripts/reversion
697 version.h: version.sh
701 version.o: $(HDRS) cnumber.h version.h version.c
703 # This is the dummy module for use by test compiles of individual modules. It
704 # contains functions such as log_write() that may be called from bits of Exim
705 # in the tested code.
709 # Compile instructions for perl.o for when EXIM_PERL is set
711 perl.o: $(HDRS) perl.c
712 @echo "$(PERL_CC) perl.c"
713 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
715 # Compile instructions for the database utility modules
717 exim_dumpdb.o: $(HDRS) exim_dbutil.c
718 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
719 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
722 -o exim_dumpdb.o exim_dbutil.c
724 exim_fixdb.o: $(HDRS) exim_dbutil.c
725 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
726 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
729 -o exim_fixdb.o exim_dbutil.c
731 exim_tidydb.o: $(HDRS) exim_dbutil.c
732 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
733 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
736 -o exim_tidydb.o exim_dbutil.c
738 # Compile instructions for exim_dbmbuild
740 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
741 @echo "$(CC) exim_dbmbuild.c"
742 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
743 -o exim_dbmbuild.o exim_dbmbuild.c
745 # Utilities use special versions of some modules - typically with debugging
748 util-host_address.o: $(HDRS) host_address.c
749 @echo "$(CC) -DCOMPILE_UTILITY host_address.c"
750 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-host_address.o host_address.c
752 util-md5.o: $(HDRS) md5.c
753 @echo "$(CC) -DCOMPILE_UTILITY queue.c"
754 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-md5.o md5.c
756 util-spool_in.o: $(HDRS) spool_in.c
757 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
758 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
760 util-store.o: $(HDRS) store.c
761 @echo "$(CC) -DCOMPILE_UTILITY store.c"
762 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
764 util-string.o: $(HDRS) string.c
765 @echo "$(CC) -DCOMPILE_UTILITY string.c"
766 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
768 util-queue.o: $(HDRS) queue.c
769 @echo "$(CC) -DCOMPILE_UTILITY queue.c"
770 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
772 util-tod.o: $(HDRS) tod.c
773 @echo "$(CC) -DCOMPILE_UTILITY tod.c"
774 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
776 util-tree.o: $(HDRS) tree.c
777 @echo "$(CC) -DCOMPILE_UTILITY tree.c"
778 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tree.o tree.c
780 util-os.o: $(HDRS) os.c
781 @echo "$(CC) -DCOMPILE_UTILITY os.c"
782 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
785 -DFIND_RUNNING_INTERFACES \
788 # The local scan module depends only on its own special header, and is compiled
789 # from a source whose location is set by configuration.
791 local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
792 @echo "$(CC) local_scan.c"
793 $(FE)$(CC) -DLOCAL_SCAN -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
795 # Dependencies for the "ordinary" exim modules
798 base64.o: $(HDRS) mime.h base64.c
799 child.o: $(HDRS) child.c
800 crypt16.o: $(HDRS) crypt16.c
801 daemon.o: $(HDRS) daemon.c
802 dbfn.o: $(HDRS) dbfn.c
803 debug.o: $(HDRS) debug.c
804 deliver.o: $(HDRS) transports/smtp.h deliver.c
805 directory.o: $(HDRS) directory.c
807 dnsbl.o: $(HDRS) dnsbl.c
809 exim.o: $(HDRS) exim.c
810 expand.o: $(HDRS) expand.c
811 environment.o: $(HDRS) environment.c
812 filter.o: $(HDRS) filter.c
813 filtertest.o: $(HDRS) filtertest.c
814 globals.o: $(HDRS) globals.c
815 hash.o: $(HDRS) hash.c
816 header.o: $(HDRS) header.c
817 host.o: $(HDRS) host.c
818 host_address.o: $(HDRS) host_address.c
822 match.o: $(HDRS) match.c
824 moan.o: $(HDRS) moan.c
825 os.o: $(HDRS) $(OS_C_INCLUDES) os.c
826 parse.o: $(HDRS) parse.c
827 priv.o: $(HDRS) priv.c
828 proxy.o: $(HDRS) proxy.c
829 queue.o: $(HDRS) queue.c
831 readconf.o: $(HDRS) readconf.c
832 receive.o: $(HDRS) receive.c
833 retry.o: $(HDRS) retry.c
834 rewrite.o: $(HDRS) rewrite.c
835 regex_cache.o: $(HDRS) regex_cache.c
836 rfc2047.o: $(HDRS) rfc2047.c
837 route.o: $(HDRS) route.c
838 search.o: $(HDRS) search.c
839 sieve.o: $(HDRS) sieve.c
840 smtp_in.o: $(HDRS) smtp_in.c
841 smtp_out.o: $(HDRS) smtp_out.c
842 spool_in.o: $(HDRS) spool_in.c
843 spool_out.o: $(HDRS) spool_out.c
844 std-crypto.o: $(HDRS) std-crypto.c
845 store.o: $(HDRS) store.c
846 string.o: $(HDRS) string.c
847 tls.o: $(HDRS) tls.c \
848 tls-gnu.c tlscert-gnu.c \
849 tls-openssl.c tlscert-openssl.c \
852 transport.o: $(HDRS) transport.c
853 tree.o: $(HDRS) tree.c
854 verify.o: $(HDRS) transports/smtp.h verify.c
855 dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
856 dkim_transport.o: $(HDRS) dkim_transport.c
858 # Dependencies for WITH_CONTENT_SCAN modules
860 malware.o: $(HDRS) malware.c
861 mime.o: $(HDRS) mime.h mime.c
862 regex.o: $(HDRS) regex.c
863 spam.o: $(HDRS) spam.c
864 spool_mbox.o: $(HDRS) spool_mbox.c
867 # Dependencies for EXPERIMENTAL_* modules
869 arc.o: $(HDRS) pdkim/pdkim.h arc.c
870 bmi_spam.o: $(HDRS) bmi_spam.c
871 dane.o: $(HDRS) dane.c dane-openssl.c
872 dcc.o: $(HDRS) dcc.h dcc.c
873 dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
874 imap_utf7.o: $(HDRS) imap_utf7.c
875 spf.o: $(HDRS) spf.h spf.c
876 utf8.o: $(HDRS) utf8.c
877 xclient.o: $(HDRS) xclient.c
879 # The module containing tables of available lookups, routers, auths, and
880 # transports must be rebuilt if any of them are. However, because the makefiles
881 # for the drivers are always run, we don't actually put the dependencies here,
882 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
883 # drtables.o even though the .a files haven't in fact been updated. Instead
884 # it is arranged that the lower-level makefiles remove drtables.o when they
885 # rebuild the .a files.
887 drtables.o: $(HDRS) drtables.c
889 # We depend upon object files built as part of building the lookups library
890 # When using parallel make, we don't have the dependency to force building
891 # in the sub-directory unless we force that dependency:
893 $(OBJ_LOOKUPS): buildlookups
895 # The exim monitor's private modules - the sources live in a private
896 # subdirectory. The final binary combines the private modules with some
897 # modules from the main exim binary.
899 em_StripChart.o: ../exim_monitor/em_StripChart.c
900 em_TextPop.o: ../exim_monitor/em_TextPop.c
901 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
902 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
903 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
904 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
905 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
906 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
907 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
908 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
909 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
910 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
912 @echo "$(CC) exim_monitor/$(@:.o=.c)"
913 $(FE)$(CC) -o $@ -c $(CFLAGS) -DCOMPILE_UTILITY -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
914 ../exim_monitor/$(@:.o=.c)
917 # Targets for the various libraries that Exim uses.
919 # The lookups library.
922 @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
923 CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
924 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
925 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
928 # The routers library.
931 @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
932 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
933 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
936 # The transports library.
938 buildtransports: config
939 @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
940 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
941 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
944 # The library of authorization modules
947 @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
948 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
949 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
954 buildpdkim: pdkim/pdkim.a
955 pdkim/pdkim.a: config
956 @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
957 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
958 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
961 # The "clean", "install", and "makefile" targets just pass themselves back to
962 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
963 # for them in the build directory.
965 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
967 # Targets for building stand-alone testing programs for basic testing of
968 # some of the building blocks. These are not integrated with the makefile-
969 # building targets. If you change something that is going to cause the
970 # makefile to be rebuilt, you must run "make makefile" before running one
973 # The testing programs use different versions of some modules - usually
974 # with bits cut out that are not relevant to the test in hand. For those
975 # that are used by several tests, we use a different name.
977 sa-globals.o: $(HDRS) globals.c
978 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
980 sa-os.o: $(HDRS) os.c
981 $(CC) -c $(CFLAGS) $(INCLUDE) \
982 -DFIND_RUNNING_INTERFACES \
985 # These are the test targets themselves
987 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
988 string.o tod.o version.o utf8.o
989 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
990 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
991 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
992 dummies.o sa-globals.o sa-os.o store.o string.o \
993 tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
996 test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
997 host_address.o store.o string.o tod.o tree.o
998 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
999 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
1000 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
1001 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
1002 $(LNCC) -o test_host $(LFLAGS) \
1003 host.o host_address.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
1004 tod.o tree.o $(LIBS) $(LIBRESOLV)
1005 rm -f child.o dummies.o host.o dns.o
1007 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
1008 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
1009 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
1010 sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
1013 test_parse: config.h parse.c dummies.o sa-globals.o \
1014 store.o string.o tod.o version.o utf8.o
1015 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
1016 $(LNCC) -o test_parse $(LFLAGS) parse.o \
1017 dummies.o sa-globals.o store.o string.o tod.o version.o \
1021 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
1022 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
1023 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
1024 dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)