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 2016
13 EDITME = ../Local/Makefile
14 EXIMON_EDITME = ../Local/eximon.conf
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.
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.
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.
39 config: $(EDITME) checklocalmake Makefile os.c config.h version.h macro.c
42 @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
43 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
44 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
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); \
52 if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
57 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
58 @echo "*** appropriate changes for your site."
64 @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
65 @echo "*** appropriate changes for your site."
67 @test ! -d ../Local && mkdir ../Local
70 # Check that the local Makefile is up-to-date
72 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
73 $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
75 @echo "*** Makefile needs rebuilding"
76 @echo "*** Please run \"make makefile\" at top level"
80 # Build (link) the os.h file
82 #os.h: $(SCRIPTS)/Configure-os.h \
83 # $(O)/os.h-AIX $(O)/os.h-BSDI $(O)/os.h-cygwin \
84 # $(O)/os.h-Darwin $(O)/os.h-DGUX $(O)/os.h-DragonFly \
85 # $(O)/os.h-FreeBSD $(O)/os.h-GNU $(O)/os.h-GNUkFreeBSD \
86 # $(O)/os.h-GNUkNetBSD $(O)/os.h-HI-OSF \
87 # $(O)/os.h-HI-UX $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \
88 # $(O)/os.h-IRIX $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \
89 # $(O)/os.h-IRIX65 $(O)/os.h-Linux $(O)/os.h-mips \
90 # $(O)/os.h-NetBSD $(O)/os.h-NetBSD-a.out \
91 # $(O)/os.h-OpenBSD $(O)/os.h-OpenUNIX $(O)/os.h-OSF1 \
92 # $(O)/os.h-QNX $(O)/os.h-SCO $(O)/os.h-SCO_SV \
93 # $(O)/os.h-SunOS4 $(O)/os.h-SunOS5 $(O)/os.h-SunOS5-hal \
94 # $(O)/os.h-ULTRIX $(O)/os.h-UNIX_SV \
95 # $(O)/os.h-Unixware7 $(O)/os.h-USG
96 # $(SHELL) $(SCRIPTS)/Configure-os.h
98 os.h: $(SCRIPTS)/Configure-os.h \
103 $(SHELL) $(SCRIPTS)/Configure-os.h
105 # Build the os.c file
108 # $(SCRIPTS)/Configure-os.c \
109 # $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \
110 # $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
111 # $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1
112 # $(SHELL) $(SCRIPTS)/Configure-os.c
115 $(SCRIPTS)/Configure-os.c \
117 $(SHELL) $(SCRIPTS)/Configure-os.c
119 # Build the config.h file.
121 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
122 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
124 # Build the builtin-macros data struct
126 MACRO_CSRC = macro_predef.c globals.c readconf.c route.c transport.c \
128 transports/appendfile.c transports/autoreply.c transports/lmtp.c \
129 transports/pipe.c transports/queuefile.c transports/smtp.c \
130 routers/accept.c routers/dnslookup.c routers/ipliteral.c \
131 routers/iplookup.c routers/manualroute.c routers/queryprogram.c \
133 auths/auth-spa.c auths/cram_md5.c auths/cyrus_sasl.c auths/dovecot.c \
134 auths/gsasl_exim.c auths/heimdal_gssapi.c auths/plaintext.c auths/spa.c \
136 MACRO_HSRC = macro_predef.h os.h globals.h config.h \
137 routers/accept.h routers/dnslookup.h routers/ipliteral.h \
138 routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
141 macro_predef: $(MACRO_CSRC) $(MACRO_HSRC)
142 @echo "$(CC) -DMACRO_PREDEF macro_predef.c"
143 $(FE)$(CC) $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o macro_predef $(MACRO_CSRC)
145 macro.c: macro_predef
146 ./macro_predef > macro.c
148 # This target is recognized specially by GNU make. It records those targets
149 # that do not correspond to files that are being built and which should
150 # therefore always be run, even if the files exist. This shouldn't in fact be a
151 # problem, but it does no harm. Other make programs will just ignore this.
153 .PHONY: all config utils \
154 buildauths buildlookups buildpdkim buildrouters \
155 buildtransports checklocalmake clean
158 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
159 exigrep eximstats exipick exiqgrep exiqsumm \
160 transport-filter.pl convert4r3 convert4r4 \
162 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
165 # Targets for special-purpose configuration header builders
166 buildconfig: buildconfig.c
167 @echo "$(CC) buildconfig.c"
168 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
171 # Target for the exicyclog utility script
172 exicyclog: config ../src/exicyclog.src
175 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
178 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
179 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
180 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
181 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
182 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
183 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
184 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
185 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
186 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
187 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
188 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
189 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
190 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
191 ../src/exicyclog.src > exicyclog-t
192 @mv exicyclog-t exicyclog
194 @echo ">>> exicyclog script built"
196 # Target for the exinext utility script
197 exinext: config ../src/exinext.src
200 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
203 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
204 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
205 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
206 ../src/exinext.src > exinext-t
207 @mv exinext-t exinext
209 @echo ">>> exinext script built"
211 # Target for the exiwhat utility script
212 exiwhat: config ../src/exiwhat.src
215 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
218 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
219 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
220 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
221 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
222 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
223 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
224 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
225 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
226 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
227 ../src/exiwhat.src > exiwhat-t
228 @mv exiwhat-t exiwhat
230 @echo ">>> exiwhat script built"
232 # Target for the exim_checkaccess utility script
233 exim_checkaccess: config ../src/exim_checkaccess.src
234 @rm -f exim_checkaccess
236 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
239 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
240 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
241 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
242 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
243 ../src/exim_checkaccess.src > exim_checkaccess-t
244 @mv exim_checkaccess-t exim_checkaccess
245 @chmod a+x exim_checkaccess
246 @echo ">>> exim_checkaccess script built"; echo ""
248 # Target for the Exim monitor start-up script
249 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
252 $(SHELL) $(SCRIPTS)/Configure-eximon
254 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
257 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
258 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
259 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
260 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
261 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
262 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
263 ../src/eximon.src >> eximon
264 @echo ">>> eximon script built"; echo ""
266 # Targets for utilities; these are all Perl scripts that have to get the
267 # location of Perl put in them. A few need other things as well.
269 exigrep: Makefile ../src/exigrep.src
272 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
275 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
276 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
277 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
278 ../src/exigrep.src > exigrep-t
279 @mv exigrep-t exigrep
281 @echo ">>> exigrep script built"
283 eximstats: Makefile ../src/eximstats.src
286 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
287 ../src/eximstats.src > eximstats-t
288 @mv eximstats-t eximstats
290 @echo ">>> eximstats script built"
292 exiqgrep: Makefile ../src/exiqgrep.src
295 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
298 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
299 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
300 ../src/exiqgrep.src > exiqgrep-t
301 @mv exiqgrep-t exiqgrep
303 @echo ">>> exiqgrep script built"
305 exiqsumm: Makefile ../src/exiqsumm.src
307 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
308 ../src/exiqsumm.src > exiqsumm-t
309 @mv exiqsumm-t exiqsumm
311 @echo ">>> exiqsumm script built"
313 exipick: Makefile ../src/exipick.src
315 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
316 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
317 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
318 ../src/exipick.src > exipick-t
319 @mv exipick-t exipick
321 @echo ">>> exipick script built"
323 transport-filter.pl: Makefile ../src/transport-filter.src
324 @rm -f transport-filter.pl
325 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
326 ../src/transport-filter.src > transport-filter.pl-t
327 @mv transport-filter.pl-t transport-filter.pl
328 @chmod a+x transport-filter.pl
329 @echo ">>> transport-filter.pl script built"
331 convert4r3: Makefile ../src/convert4r3.src
333 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
334 ../src/convert4r3.src > convert4r3-t
335 @mv convert4r3-t convert4r3
336 @chmod a+x convert4r3
337 @echo ">>> convert4r3 script built"
339 convert4r4: Makefile ../src/convert4r4.src
341 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
342 ../src/convert4r4.src > convert4r4-t
343 @mv convert4r4-t convert4r4
344 @chmod a+x convert4r4
345 @echo ">>> convert4r4 script built"
348 # These are objects of optional features. They are always compiled, but
349 # if the corresponding #defines are not set, they wind up empty and
350 # are thrown away by the linker.
352 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
353 OBJ_EXPERIMENTAL = bmi_spam.o \
362 # Targets for final binaries; the main one has a build number which is
363 # updated each time. We don't bother with that for the auxiliaries.
365 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
367 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
368 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
369 filtertest.o globals.o dkim.o dkim_transport.o hash.o \
370 header.o host.o ip.o log.o lss.o match.o moan.o \
371 os.o parse.o queue.o \
372 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
373 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
374 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
375 environment.o macro.o \
377 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
380 exim: buildlookups buildauths pdkim/pdkim.a \
381 buildrouters buildtransports \
382 $(OBJ_EXIM) version.o
383 @echo "$(LNCC) -o exim"
384 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
385 routers/routers.a transports/transports.a lookups/lookups.a \
386 auths/auths.a pdkim/pdkim.a \
387 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
388 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
389 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
390 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
391 echo $(STRIP_COMMAND) exim; \
392 $(STRIP_COMMAND) exim; \
396 @echo ">>> exim binary built"
399 # The utility for dumping the contents of an exim database
401 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
403 exim_dumpdb: $(OBJ_DUMPDB)
404 @echo "$(LNCC) -o exim_dumpdb"
405 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
406 $(LIBS) $(EXTRALIBS) $(DBMLIB)
407 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
408 echo $(STRIP_COMMAND) exim_dumpdb; \
409 $(STRIP_COMMAND) exim_dumpdb; \
411 @echo ">>> exim_dumpdb utility built"
414 # The utility for interrogating/fixing the contents of an exim database
416 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
418 exim_fixdb: $(OBJ_FIXDB) buildauths
419 @echo "$(LNCC) -o exim_fixdb"
420 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
421 auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
422 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
423 echo $(STRIP_COMMAND) exim_fixdb; \
424 $(STRIP_COMMAND) exim_fixdb; \
426 @echo ">>> exim_fixdb utility built"
429 # The utility for tidying the contents of an exim database
431 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
433 exim_tidydb: $(OBJ_TIDYDB)
434 @echo "$(LNCC) -o exim_tidydb"
435 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
436 $(LIBS) $(EXTRALIBS) $(DBMLIB)
437 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
438 echo $(STRIP_COMMAND) exim_tidydb; \
439 $(STRIP_COMMAND) exim_tidydb; \
441 @echo ">>> exim_tidydb utility built"
444 # The utility for building dbm files
446 exim_dbmbuild: exim_dbmbuild.o
447 @echo "$(LNCC) -o exim_dbmbuild"
448 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
449 $(LIBS) $(EXTRALIBS) $(DBMLIB)
450 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
451 echo $(STRIP_COMMAND) exim_dbmbuild; \
452 $(STRIP_COMMAND) exim_dbmbuild; \
454 @echo ">>> exim_dbmbuild utility built"
457 # The utility for locking a mailbox while messing around with it
459 exim_lock: exim_lock.c os.h
460 @echo "$(CC) exim_lock.c"
461 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
462 @echo "$(LNCC) -o exim_lock"
463 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
465 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
466 echo $(STRIP_COMMAND) exim_lock; \
467 $(STRIP_COMMAND) exim_lock; \
469 @echo ">>> exim_lock utility built"
472 # The X-based Exim monitor program's binary part. There's a macro for cutting
473 # out the modified TextPop module, because some antique link editors cannot
474 # handle the fact that it is redefining things that are found later in the
477 # Object modules that are the unique Eximon modules
479 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
480 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
483 # The complete modules list also includes some specially compiled versions of
484 # code from the main Exim source tree.
486 OBJ_MONBIN = util-spool_in.o \
494 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
495 ../exim_monitor/em_version.c
496 @echo "$(CC) exim_monitor/em_version.c"
497 $(FE)$(CC) -o em_version.o -c \
498 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
499 @echo "$(LNCC) -o eximon.bin"
500 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
501 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
502 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
503 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
504 echo $(STRIP_COMMAND) eximon.bin; \
505 $(STRIP_COMMAND) eximon.bin; \
507 @echo ">>> exim monitor binary built"
511 # Compile step for most of the exim modules. HDRS is a list of headers
512 # which cause everything to be rebuilt. PHDRS is the same, for the use
513 # of routers, transports, and authenticators. I can't find a way of doing this
514 # in one. This list is overkill, but it doesn't really take much time to
515 # rebuild Exim on a modern computer.
531 PHDRS = ../config.h \
544 .c.o:; @echo "$(CC) $*.c"
545 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
547 # Update Exim's version information and build the version object.
550 @../scripts/reversion
554 version.o: $(HDRS) cnumber.h version.h version.c
556 # This is the dummy module for use by test compiles of individual modules. It
557 # contains functions such as log_write() that may be called from bits of Exim
558 # in the tested code.
562 # Compile instructions for perl.o for when EXIM_PERL is set
564 perl.o: $(HDRS) perl.c
565 @echo "$(PERL_CC) perl.c"
566 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
568 # Compile instructions for the database utility modules
570 exim_dumpdb.o: $(HDRS) exim_dbutil.c
571 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
572 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
575 -o exim_dumpdb.o exim_dbutil.c
577 exim_fixdb.o: $(HDRS) exim_dbutil.c
578 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
579 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
582 -o exim_fixdb.o exim_dbutil.c
584 exim_tidydb.o: $(HDRS) exim_dbutil.c
585 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
586 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
589 -o exim_tidydb.o exim_dbutil.c
591 # Compile instructions for exim_dbmbuild
593 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
594 @echo "$(CC) exim_dbmbuild.c"
595 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
596 -o exim_dbmbuild.o exim_dbmbuild.c
598 # Utilities use special versions of some modules - typically with debugging
601 util-spool_in.o: $(HDRS) spool_in.c
602 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
603 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
605 util-store.o: $(HDRS) store.c
606 @echo "$(CC) -DCOMPILE_UTILITY store.c"
607 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
609 util-string.o: $(HDRS) string.c
610 @echo "$(CC) -DCOMPILE_UTILITY string.c"
611 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
613 util-queue.o: $(HDRS) queue.c
614 @echo "$(CC) -DCOMPILE_UTILITY queue.c"
615 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
617 util-os.o: $(HDRS) os.c
618 @echo "$(CC) -DCOMPILE_UTILITY os.c"
619 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
622 -DFIND_RUNNING_INTERFACES \
625 # The local scan module depends only on its own special header, and is compiled
626 # from a source whose location is set by configuration.
628 local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
629 @echo "$(CC) local_scan.c"
630 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
632 # Dependencies for the "ordinary" exim modules
635 base64.o: $(HDRS) mime.h base64.c
636 child.o: $(HDRS) child.c
637 crypt16.o: $(HDRS) crypt16.c
638 daemon.o: $(HDRS) daemon.c
639 dbfn.o: $(HDRS) dbfn.c
640 debug.o: $(HDRS) debug.c
641 deliver.o: $(HDRS) transports/smtp.h deliver.c
642 directory.o: $(HDRS) directory.c
645 exim.o: $(HDRS) exim.c
646 expand.o: $(HDRS) expand.c
647 environment.o: $(HDRS) environment.c
648 filter.o: $(HDRS) filter.c
649 filtertest.o: $(HDRS) filtertest.c
650 globals.o: $(HDRS) globals.c
651 hash.o: $(HDRS) hash.c
652 header.o: $(HDRS) header.c
653 host.o: $(HDRS) host.c
657 match.o: $(HDRS) match.c
658 moan.o: $(HDRS) moan.c
659 os.o: $(HDRS) $(OS_C_INCLUDES) os.c
660 parse.o: $(HDRS) parse.c
661 queue.o: $(HDRS) queue.c
663 readconf.o: $(HDRS) readconf.c
664 receive.o: $(HDRS) receive.c
665 retry.o: $(HDRS) retry.c
666 rewrite.o: $(HDRS) rewrite.c
667 rfc2047.o: $(HDRS) rfc2047.c
668 route.o: $(HDRS) route.c
669 search.o: $(HDRS) search.c
670 sieve.o: $(HDRS) sieve.c
671 smtp_in.o: $(HDRS) smtp_in.c
672 smtp_out.o: $(HDRS) smtp_out.c
673 spool_in.o: $(HDRS) spool_in.c
674 spool_out.o: $(HDRS) spool_out.c
675 std-crypto.o: $(HDRS) std-crypto.c
676 store.o: $(HDRS) store.c
677 string.o: $(HDRS) string.c
678 tls.o: $(HDRS) tls.c \
679 tls-gnu.c tlscert-gnu.c \
680 tls-openssl.c tlscert-openssl.c
682 transport.o: $(HDRS) transport.c
683 tree.o: $(HDRS) tree.c
684 verify.o: $(HDRS) transports/smtp.h verify.c
685 dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
686 dkim_transport.o: $(HDRS) dkim_transport.c
688 # Dependencies for WITH_CONTENT_SCAN modules
690 malware.o: $(HDRS) malware.c
691 mime.o: $(HDRS) mime.h mime.c
692 regex.o: $(HDRS) regex.c
693 spam.o: $(HDRS) spam.c
694 spool_mbox.o: $(HDRS) spool_mbox.c
697 # Dependencies for EXPERIMENTAL_* modules
699 bmi_spam.o: $(HDRS) bmi_spam.c
700 dane.o: $(HDRS) dane.c dane-gnu.c dane-openssl.c
701 dcc.o: $(HDRS) dcc.h dcc.c
702 dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
703 imap_utf7.o: $(HDRS) imap_utf7.c
704 spf.o: $(HDRS) spf.h spf.c
705 srs.o: $(HDRS) srs.h srs.c
706 utf8.o: $(HDRS) utf8.c
708 # The module containing tables of available lookups, routers, auths, and
709 # transports must be rebuilt if any of them are. However, because the makefiles
710 # for the drivers are always run, we don't actually put the dependencies here,
711 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
712 # drtables.o even though the .a files haven't in fact been updated. Instead
713 # it is arranged that the lower-level makefiles remove drtables.o when they
714 # rebuild the .a files.
716 drtables.o: $(HDRS) drtables.c
718 # We depend upon object files built as part of building the lookups library
719 # When using parallel make, we don't have the dependency to force building
720 # in the sub-directory unless we force that dependency:
722 $(OBJ_LOOKUPS): buildlookups
724 # The exim monitor's private modules - the sources live in a private
725 # subdirectory. The final binary combines the private modules with some
726 # modules from the main exim binary.
728 em_StripChart.o: ../exim_monitor/em_StripChart.c
729 em_TextPop.o: ../exim_monitor/em_TextPop.c
730 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
731 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
732 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
733 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
734 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
735 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
736 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
737 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
738 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
739 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
741 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
742 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
743 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
746 # Targets for the various libraries that Exim uses.
748 # The lookups library.
751 @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
752 CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
753 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
754 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
757 # The routers library.
760 @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
761 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
762 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
765 # The transports library.
767 buildtransports: config
768 @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
769 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
770 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
773 # The library of authorization modules
776 @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
777 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
778 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
783 buildpdkim: pdkim/pdkim.a
784 pdkim/pdkim.a: config
785 @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
786 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
787 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
790 # The "clean", "install", and "makefile" targets just pass themselves back to
791 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
792 # for them in the build directory.
794 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
796 # Targets for building stand-alone testing programs for basic testing of
797 # some of the building blocks. These are not integrated with the makefile-
798 # building targets. If you change something that is going to cause the
799 # makefile to be rebuilt, you must run "make makefile" before running one
802 # The testing programs use different versions of some modules - usually
803 # with bits cut out that are not relevant to the test in hand. For those
804 # that are used by several tests, we use a different name.
806 sa-globals.o: $(HDRS) globals.c
807 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
809 sa-os.o: $(HDRS) os.c
810 $(CC) -c $(CFLAGS) $(INCLUDE) \
811 -DFIND_RUNNING_INTERFACES \
814 # These are the test targets themselves
816 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
817 string.o tod.o version.o utf8.o
818 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
819 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
820 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
821 dummies.o sa-globals.o sa-os.o store.o string.o \
822 tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
825 test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
826 store.o string.o tod.o tree.o
827 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
828 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
829 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
830 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
831 $(LNCC) -o test_host $(LFLAGS) \
832 host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
833 tod.o tree.o $(LIBS) $(LIBRESOLV)
834 rm -f child.o dummies.o host.o dns.o
836 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
837 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
838 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
839 sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
842 test_parse: config.h parse.c dummies.o sa-globals.o \
843 store.o string.o tod.o version.o utf8.o
844 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
845 $(LNCC) -o test_parse $(LFLAGS) parse.o \
846 dummies.o sa-globals.o store.o string.o tod.o version.o \
850 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
851 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
852 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
853 dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)