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 # concatentates 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
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
101 $(SCRIPTS)/Configure-os.c \
102 $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \
103 $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
104 $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1
105 $(SHELL) $(SCRIPTS)/Configure-os.c
107 # Build the config.h file.
109 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
110 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
113 # This target is recognized specially by GNU make. It records those targets
114 # that do not correspond to files that are being built and which should
115 # therefore always be run, even if the files exist. This shouldn't in fact be a
116 # problem, but it does no harm. Other make programs will just ignore this.
118 .PHONY: all config utils \
119 buildauths buildlookups buildpdkim buildrouters \
120 buildtransports checklocalmake clean
123 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
124 exigrep eximstats exipick exiqgrep exiqsumm \
125 transport-filter.pl convert4r3 convert4r4 \
127 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
130 # Targets for special-purpose configuration header builders
131 buildconfig: buildconfig.c
132 @echo "$(CC) buildconfig.c"
133 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
136 # Target for the exicyclog utility script
137 exicyclog: config ../src/exicyclog.src
140 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
143 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
144 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
145 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
146 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
147 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
148 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
149 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
150 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
151 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
152 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
153 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
154 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
155 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
156 ../src/exicyclog.src > exicyclog-t
157 @mv exicyclog-t exicyclog
159 @echo ">>> exicyclog script built"
161 # Target for the exinext utility script
162 exinext: config ../src/exinext.src
165 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
168 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
169 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
170 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
171 ../src/exinext.src > exinext-t
172 @mv exinext-t exinext
174 @echo ">>> exinext script built"
176 # Target for the exiwhat utility script
177 exiwhat: config ../src/exiwhat.src
180 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
183 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
184 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
185 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
186 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
187 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
188 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
189 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
190 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
191 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
192 ../src/exiwhat.src > exiwhat-t
193 @mv exiwhat-t exiwhat
195 @echo ">>> exiwhat script built"
197 # Target for the exim_checkaccess utility script
198 exim_checkaccess: config ../src/exim_checkaccess.src
199 @rm -f exim_checkaccess
201 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
204 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
205 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
206 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
207 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
208 ../src/exim_checkaccess.src > exim_checkaccess-t
209 @mv exim_checkaccess-t exim_checkaccess
210 @chmod a+x exim_checkaccess
211 @echo ">>> exim_checkaccess script built"; echo ""
213 # Target for the Exim monitor start-up script
214 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
217 $(SHELL) $(SCRIPTS)/Configure-eximon
219 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
222 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
223 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
224 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
225 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
226 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
227 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
228 ../src/eximon.src >> eximon
229 @echo ">>> eximon script built"; echo ""
231 # Targets for utilities; these are all Perl scripts that have to get the
232 # location of Perl put in them. A few need other things as well.
234 exigrep: Makefile ../src/exigrep.src
237 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
240 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
241 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
242 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
243 ../src/exigrep.src > exigrep-t
244 @mv exigrep-t exigrep
246 @echo ">>> exigrep script built"
248 eximstats: Makefile ../src/eximstats.src
251 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
252 ../src/eximstats.src > eximstats-t
253 @mv eximstats-t eximstats
255 @echo ">>> eximstats script built"
257 exiqgrep: Makefile ../src/exiqgrep.src
260 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
263 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
264 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
265 ../src/exiqgrep.src > exiqgrep-t
266 @mv exiqgrep-t exiqgrep
268 @echo ">>> exiqgrep script built"
270 exiqsumm: Makefile ../src/exiqsumm.src
272 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
273 ../src/exiqsumm.src > exiqsumm-t
274 @mv exiqsumm-t exiqsumm
276 @echo ">>> exiqsumm script built"
278 exipick: Makefile ../src/exipick.src
280 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
281 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
282 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
283 ../src/exipick.src > exipick-t
284 @mv exipick-t exipick
286 @echo ">>> exipick script built"
288 transport-filter.pl: Makefile ../src/transport-filter.src
289 @rm -f transport-filter.pl
290 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
291 ../src/transport-filter.src > transport-filter.pl-t
292 @mv transport-filter.pl-t transport-filter.pl
293 @chmod a+x transport-filter.pl
294 @echo ">>> transport-filter.pl script built"
296 convert4r3: Makefile ../src/convert4r3.src
298 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
299 ../src/convert4r3.src > convert4r3-t
300 @mv convert4r3-t convert4r3
301 @chmod a+x convert4r3
302 @echo ">>> convert4r3 script built"
304 convert4r4: Makefile ../src/convert4r4.src
306 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
307 ../src/convert4r4.src > convert4r4-t
308 @mv convert4r4-t convert4r4
309 @chmod a+x convert4r4
310 @echo ">>> convert4r4 script built"
313 # These are objects of optional features. They are always compiled, but
314 # if the corresponding #defines are not set, they wind up empty and
315 # are thrown away by the linker.
317 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
318 OBJ_EXPERIMENTAL = bmi_spam.o \
327 # Targets for final binaries; the main one has a build number which is
328 # updated each time. We don't bother with that for the auxiliaries.
330 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
332 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
333 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
334 filtertest.o globals.o dkim.o \
335 header.o host.o ip.o log.o lss.o match.o moan.o \
336 os.o parse.o queue.o \
337 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
338 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
339 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
342 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
345 exim: buildlookups buildauths pdkim/pdkim.a \
346 buildrouters buildtransports \
347 $(OBJ_EXIM) version.o
348 @echo "$(LNCC) -o exim"
349 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
350 routers/routers.a transports/transports.a lookups/lookups.a \
351 auths/auths.a pdkim/pdkim.a \
352 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
353 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
354 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
355 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
356 echo $(STRIP_COMMAND) exim; \
357 $(STRIP_COMMAND) exim; \
361 @echo ">>> exim binary built"
364 # The utility for dumping the contents of an exim database
366 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
368 exim_dumpdb: $(OBJ_DUMPDB)
369 @echo "$(LNCC) -o exim_dumpdb"
370 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
371 $(LIBS) $(EXTRALIBS) $(DBMLIB)
372 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
373 echo $(STRIP_COMMAND) exim_dumpdb; \
374 $(STRIP_COMMAND) exim_dumpdb; \
376 @echo ">>> exim_dumpdb utility built"
379 # The utility for interrogating/fixing the contents of an exim database
381 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
383 exim_fixdb: $(OBJ_FIXDB) buildauths
384 @echo "$(LNCC) -o exim_fixdb"
385 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
386 auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
387 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
388 echo $(STRIP_COMMAND) exim_fixdb; \
389 $(STRIP_COMMAND) exim_fixdb; \
391 @echo ">>> exim_fixdb utility built"
394 # The utility for tidying the contents of an exim database
396 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
398 exim_tidydb: $(OBJ_TIDYDB)
399 @echo "$(LNCC) -o exim_tidydb"
400 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
401 $(LIBS) $(EXTRALIBS) $(DBMLIB)
402 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
403 echo $(STRIP_COMMAND) exim_tidydb; \
404 $(STRIP_COMMAND) exim_tidydb; \
406 @echo ">>> exim_tidydb utility built"
409 # The utility for building dbm files
411 exim_dbmbuild: exim_dbmbuild.o
412 @echo "$(LNCC) -o exim_dbmbuild"
413 $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
414 $(LIBS) $(EXTRALIBS) $(DBMLIB)
415 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
416 echo $(STRIP_COMMAND) exim_dbmbuild; \
417 $(STRIP_COMMAND) exim_dbmbuild; \
419 @echo ">>> exim_dbmbuild utility built"
422 # The utility for locking a mailbox while messing around with it
424 exim_lock: exim_lock.c os.h
425 @echo "$(CC) exim_lock.c"
426 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
427 @echo "$(LNCC) -o exim_lock"
428 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
430 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
431 echo $(STRIP_COMMAND) exim_lock; \
432 $(STRIP_COMMAND) exim_lock; \
434 @echo ">>> exim_lock utility built"
437 # The X-based Exim monitor program's binary part. There's a macro for cutting
438 # out the modified TextPop module, because some antique link editors cannot
439 # handle the fact that it is redefining things that are found later in the
442 # Object modules that are the unique Eximon modules
444 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
445 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
448 # The complete modules list also includes some specially compiled versions of
449 # code from the main Exim source tree.
451 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
453 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
454 ../exim_monitor/em_version.c
455 @echo "$(CC) exim_monitor/em_version.c"
456 $(FE)$(CC) -o em_version.o -c \
457 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
458 @echo "$(LNCC) -o eximon.bin"
459 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
460 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
461 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
462 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
463 echo $(STRIP_COMMAND) eximon.bin; \
464 $(STRIP_COMMAND) eximon.bin; \
466 @echo ">>> exim monitor binary built"
470 # Compile step for most of the exim modules. HDRS is a list of headers
471 # which cause everthing to be rebuilt. PHDRS is the same, for the use
472 # of routers, transports, and authenticators. I can't find a way of doing this
473 # in one. This list is overkill, but it doesn't really take much time to
474 # rebuild Exim on a modern computer.
487 PHDRS = ../config.h \
500 .c.o:; @echo "$(CC) $*.c"
501 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
503 # Update Exim's version information and build the version object.
506 @../scripts/reversion
510 version.o: $(HDRS) cnumber.h version.h version.c
512 # This is the dummy module for use by test compiles of individual modules. It
513 # contains functions such as log_write() that may be called from bits of Exim
514 # in the tested code.
518 # Compile instructions for perl.o for when EXIM_PERL is set
520 perl.o: $(HDRS) perl.c
521 @echo "$(PERL_CC) perl.c"
522 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
524 # Compile instructions for the database utility modules
526 exim_dumpdb.o: $(HDRS) exim_dbutil.c
527 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
528 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
531 -o exim_dumpdb.o exim_dbutil.c
533 exim_fixdb.o: $(HDRS) exim_dbutil.c
534 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
535 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
538 -o exim_fixdb.o exim_dbutil.c
540 exim_tidydb.o: $(HDRS) exim_dbutil.c
541 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
542 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
545 -o exim_tidydb.o exim_dbutil.c
547 # Compile instructions for exim_dbmbuild
549 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
550 @echo "$(CC) exim_dbmbuild.c"
551 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
553 # Utilities use special versions of some modules - typically with debugging
556 util-spool_in.o: $(HDRS) spool_in.c
557 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
558 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
560 util-store.o: $(HDRS) store.c
561 @echo "$(CC) -DCOMPILE_UTILITY store.c"
562 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
564 util-string.o: $(HDRS) string.c
565 @echo "$(CC) -DCOMPILE_UTILITY string.c"
566 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
568 util-os.o: $(HDRS) os.c
569 @echo "$(CC) -DCOMPILE_UTILITY os.c"
570 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
573 -DFIND_RUNNING_INTERFACES \
576 # The local scan module depends only on its own special header, and is compiled
577 # from a source whose location is set by configuration.
579 local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
580 @echo "$(CC) local_scan.c"
581 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
583 # Dependencies for the "ordinary" exim modules
586 base64.o: $(HDRS) mime.h base64.c
587 child.o: $(HDRS) child.c
588 crypt16.o: $(HDRS) crypt16.c
589 daemon.o: $(HDRS) daemon.c
590 dbfn.o: $(HDRS) dbfn.c
591 debug.o: $(HDRS) debug.c
592 deliver.o: $(HDRS) deliver.c
593 directory.o: $(HDRS) directory.c
596 exim.o: $(HDRS) exim.c
597 expand.o: $(HDRS) expand.c
598 environment.o: $(HDRS) environment.c
599 filter.o: $(HDRS) filter.c
600 filtertest.o: $(HDRS) filtertest.c
601 globals.o: $(HDRS) globals.c
602 header.o: $(HDRS) header.c
603 host.o: $(HDRS) host.c
607 match.o: $(HDRS) match.c
608 moan.o: $(HDRS) moan.c
609 os.o: $(HDRS) $(OS_C_INCLUDES) os.c
610 parse.o: $(HDRS) parse.c
611 queue.o: $(HDRS) queue.c
613 readconf.o: $(HDRS) readconf.c
614 receive.o: $(HDRS) receive.c
615 retry.o: $(HDRS) retry.c
616 rewrite.o: $(HDRS) rewrite.c
617 rfc2047.o: $(HDRS) rfc2047.c
618 route.o: $(HDRS) route.c
619 search.o: $(HDRS) search.c
620 sieve.o: $(HDRS) sieve.c
621 smtp_in.o: $(HDRS) smtp_in.c
622 smtp_out.o: $(HDRS) smtp_out.c
623 spool_in.o: $(HDRS) spool_in.c
624 spool_out.o: $(HDRS) spool_out.c
625 std-crypto.o: $(HDRS) std-crypto.c
626 store.o: $(HDRS) store.c
627 string.o: $(HDRS) string.c
628 tls.o: $(HDRS) tls.c \
629 tls-gnu.c tlscert-gnu.c \
630 tls-openssl.c tlscert-openssl.c
632 transport.o: $(HDRS) transport.c
633 tree.o: $(HDRS) tree.c
634 verify.o: $(HDRS) verify.c
635 dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
637 # Dependencies for WITH_CONTENT_SCAN modules
639 malware.o: $(HDRS) malware.c
640 mime.o: $(HDRS) mime.h mime.c
641 regex.o: $(HDRS) regex.c
642 spam.o: $(HDRS) spam.c
643 spool_mbox.o: $(HDRS) spool_mbox.c
646 # Dependencies for EXPERIMENTAL_* modules
648 bmi_spam.o: $(HDRS) bmi_spam.c
649 dane.o: $(HDRS) dane.c dane-gnu.c dane-openssl.c
650 dcc.o: $(HDRS) dcc.h dcc.c
651 dmarc.o: $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
652 imap_utf7.o: $(HDRS) imap_utf7.c
653 spf.o: $(HDRS) spf.h spf.c
654 srs.o: $(HDRS) srs.h srs.c
655 utf8.o: $(HDRS) utf8.c
657 # The module containing tables of available lookups, routers, auths, and
658 # transports must be rebuilt if any of them are. However, because the makefiles
659 # for the drivers are always run, we don't actually put the dependencies here,
660 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
661 # drtables.o even though the .a files haven't in fact been updated. Instead
662 # it is arranged that the lower-level makefiles remove drtables.o when they
663 # rebuild the .a files.
665 drtables.o: $(HDRS) drtables.c
667 # We depend upon object files built as part of building the lookups library
668 # When using parallel make, we don't have the dependency to force building
669 # in the sub-directory unless we force that dependency:
671 $(OBJ_LOOKUPS): buildlookups
673 # The exim monitor's private modules - the sources live in a private
674 # subdirectory. The final binary combines the private modules with some
675 # modules from the main exim binary.
677 em_StripChart.o: ../exim_monitor/em_StripChart.c
678 em_TextPop.o: ../exim_monitor/em_TextPop.c
679 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
680 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
681 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
682 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
683 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
684 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
685 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
686 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
687 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
688 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
690 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
691 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
692 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
695 # Targets for the various libraries that Exim uses.
697 # The lookups library.
700 @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
701 CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
702 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
703 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
706 # The routers library.
709 @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
710 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
711 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
714 # The transports library.
716 buildtransports: config
717 @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
718 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
719 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
722 # The library of authorization modules
725 @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
726 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
727 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
732 buildpdkim: pdkim/pdkim.a
733 pdkim/pdkim.a: config
734 @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
735 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
736 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
739 # The "clean", "install", and "makefile" targets just pass themselves back to
740 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
741 # for them in the build directory.
743 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
745 # Targets for building stand-alone testing programs for basic testing of
746 # some of the building blocks. These are not integrated with the makefile-
747 # building targets. If you change something that is going to cause the
748 # makefile to be rebuilt, you must run "make makefile" before running one
751 # The testing programs use different versions of some modules - usually
752 # with bits cut out that are not relevant to the test in hand. For those
753 # that are used by several tests, we use a different name.
755 sa-globals.o: $(HDRS) globals.c
756 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
758 sa-os.o: $(HDRS) os.c
759 $(CC) -c $(CFLAGS) $(INCLUDE) \
760 -DFIND_RUNNING_INTERFACES \
763 # These are the test targets themselves
765 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
766 string.o tod.o version.o utf8.o
767 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
768 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
769 dummies.o sa-globals.o sa-os.o store.o string.o \
770 tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
773 test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
774 store.o string.o tod.o tree.o
775 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
776 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
777 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
778 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
779 $(LNCC) -o test_host $(LFLAGS) \
780 host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
781 tod.o tree.o $(LIBS) $(LIBRESOLV)
782 rm -f child.o dummies.o host.o dns.o
784 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
785 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
786 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
787 sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
790 test_parse: config.h parse.c dummies.o sa-globals.o \
791 store.o string.o tod.o version.o utf8.o
792 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
793 $(LNCC) -o test_parse $(LFLAGS) parse.o \
794 dummies.o sa-globals.o store.o string.o tod.o version.o \
798 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
799 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
800 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
801 dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)