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
11 EDITME = ../Local/Makefile
12 EXIMON_EDITME = ../Local/eximon.conf
14 # The compiler used for linking is normally the same as the compiler used for
15 # compiling. However, by giving it a different name, we can override it from
16 # the command line, and this is helpful for certain types of testing.
20 # The compile commands can be very long. To make the output look better,
21 # they are not normally echoed in full. To get full echoing, the caller
22 # must set FULLECHO='' on the command line and call make with -e. We default
23 # FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
28 # The default target double-checks the existence of $(EDITME) and then arranges
29 # to touch it if it exists and any of the optional configuration files, which
30 # depend on the os or the architecture, have been altered. The same sub-target
31 # does the same thing for the eximon configuration file if it exists. Then
32 # there is a check that the Makefile (the one built from this file) is
33 # up-to-date. Then the os-specific source files and the C configuration file
34 # are set up, and finally it goes to the main Exim target.
37 config: $(EDITME) checklocalmake Makefile os.c config.h version.h
40 @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
41 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
42 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
46 @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
47 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
48 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
50 if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
55 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
56 @echo "*** appropriate changes for your site."
62 @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
63 @echo "*** appropriate changes for your site."
65 @test ! -d ../Local && mkdir ../Local
68 # Check that the local Makefile is up-to-date
70 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
71 $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
73 @echo "*** Makefile needs rebuilding"
74 @echo "*** Please run \"make makefile\" at top level"
78 # Build (link) the os.h file
80 os.h: $(SCRIPTS)/Configure-os.h \
81 $(O)/os.h-AIX $(O)/os.h-BSDI $(O)/os.h-cygwin \
82 $(O)/os.h-Darwin $(O)/os.h-DGUX $(O)/os.h-DragonFly \
83 $(O)/os.h-FreeBSD $(O)/os.h-GNU $(O)/os.h-GNUkFreeBSD \
84 $(O)/os.h-GNUkNetBSD $(O)/os.h-HI-OSF \
85 $(O)/os.h-HI-UX $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \
86 $(O)/os.h-IRIX $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \
87 $(O)/os.h-IRIX65 $(O)/os.h-Linux $(O)/os.h-mips \
88 $(O)/os.h-NetBSD $(O)/os.h-NetBSD-a.out \
89 $(O)/os.h-OpenBSD $(O)/os.h-OpenUNIX $(O)/os.h-OSF1 \
90 $(O)/os.h-QNX $(O)/os.h-SCO $(O)/os.h-SCO_SV \
91 $(O)/os.h-SunOS4 $(O)/os.h-SunOS5 $(O)/os.h-SunOS5-hal \
92 $(O)/os.h-ULTRIX $(O)/os.h-UNIX_SV \
93 $(O)/os.h-Unixware7 $(O)/os.h-USG
94 $(SHELL) $(SCRIPTS)/Configure-os.h
99 $(SCRIPTS)/Configure-os.c \
100 $(O)/os.c-cygwin $(O)/os.c-GNU $(O)/os.c-HI-OSF \
101 $(O)/os.c-IRIX $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
102 $(O)/os.c-IRIX65 $(O)/os.c-Linux $(O)/os.c-OSF1
103 $(SHELL) $(SCRIPTS)/Configure-os.c
105 # Build the config.h file.
107 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
108 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
111 # This target is recognized specially by GNU make. It records those targets
112 # that do not correspond to files that are being built and which should
113 # therefore always be run, even if the files exist. This shouldn't in fact be a
114 # problem, but it does no harm. Other make programs will just ignore this.
116 .PHONY: all config utils \
117 buildauths buildlookups buildpdkim buildrouters \
118 buildtransports checklocalmake clean
121 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
122 exigrep eximstats exipick exiqgrep exiqsumm \
123 transport-filter.pl convert4r3 convert4r4 \
125 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
128 # Targets for special-purpose configuration header builders
129 buildconfig: buildconfig.c
130 @echo "$(CC) buildconfig.c"
131 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
134 # Target for the exicyclog utility script
135 exicyclog: config ../src/exicyclog.src
138 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
141 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
142 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
143 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
144 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
145 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
146 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
147 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
148 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
149 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
150 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
151 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
152 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
153 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
154 ../src/exicyclog.src > exicyclog-t
155 @mv exicyclog-t exicyclog
157 @echo ">>> exicyclog script built"
159 # Target for the exinext utility script
160 exinext: config ../src/exinext.src
163 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
166 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
167 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
168 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
169 ../src/exinext.src > exinext-t
170 @mv exinext-t exinext
172 @echo ">>> exinext script built"
174 # Target for the exiwhat utility script
175 exiwhat: config ../src/exiwhat.src
178 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
181 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
182 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
183 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
184 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
185 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
186 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
187 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
188 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
189 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
190 ../src/exiwhat.src > exiwhat-t
191 @mv exiwhat-t exiwhat
193 @echo ">>> exiwhat script built"
195 # Target for the exim_checkaccess utility script
196 exim_checkaccess: config ../src/exim_checkaccess.src
197 @rm -f exim_checkaccess
199 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
202 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
203 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
204 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
205 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
206 ../src/exim_checkaccess.src > exim_checkaccess-t
207 @mv exim_checkaccess-t exim_checkaccess
208 @chmod a+x exim_checkaccess
209 @echo ">>> exim_checkaccess script built"; echo ""
211 # Target for the Exim monitor start-up script
212 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
215 $(SHELL) $(SCRIPTS)/Configure-eximon
217 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
220 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
221 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
222 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
223 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
224 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
225 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
226 ../src/eximon.src >> eximon
227 @echo ">>> eximon script built"; echo ""
229 # Targets for utilities; these are all Perl scripts that have to get the
230 # location of Perl put in them. A few need other things as well.
232 exigrep: Makefile ../src/exigrep.src
235 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
238 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
239 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
240 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
241 ../src/exigrep.src > exigrep-t
242 @mv exigrep-t exigrep
244 @echo ">>> exigrep script built"
246 eximstats: Makefile ../src/eximstats.src
249 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
250 ../src/eximstats.src > eximstats-t
251 @mv eximstats-t eximstats
253 @echo ">>> eximstats script built"
255 exiqgrep: Makefile ../src/exiqgrep.src
258 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
261 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
262 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
263 ../src/exiqgrep.src > exiqgrep-t
264 @mv exiqgrep-t exiqgrep
266 @echo ">>> exiqgrep script built"
268 exiqsumm: Makefile ../src/exiqsumm.src
270 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
271 ../src/exiqsumm.src > exiqsumm-t
272 @mv exiqsumm-t exiqsumm
274 @echo ">>> exiqsumm script built"
276 exipick: Makefile ../src/exipick.src
278 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
279 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
280 ../src/exipick.src > exipick-t
281 @mv exipick-t exipick
283 @echo ">>> exipick script built"
285 transport-filter.pl: Makefile ../src/transport-filter.src
286 @rm -f transport-filter.pl
287 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
288 ../src/transport-filter.src > transport-filter.pl-t
289 @mv transport-filter.pl-t transport-filter.pl
290 @chmod a+x transport-filter.pl
291 @echo ">>> transport-filter.pl script built"
293 convert4r3: Makefile ../src/convert4r3.src
295 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
296 ../src/convert4r3.src > convert4r3-t
297 @mv convert4r3-t convert4r3
298 @chmod a+x convert4r3
299 @echo ">>> convert4r3 script built"
301 convert4r4: Makefile ../src/convert4r4.src
303 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
304 ../src/convert4r4.src > convert4r4-t
305 @mv convert4r4-t convert4r4
306 @chmod a+x convert4r4
307 @echo ">>> convert4r4 script built"
310 # These are objects of optional features. They are always compiled, but
311 # if the corresponding #defines are not set, they wind up empty and
312 # are thrown away by the linker.
314 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
315 OBJ_WITH_OLD_DEMIME = demime.o
316 OBJ_EXPERIMENTAL = bmi_spam.o \
325 # Targets for final binaries; the main one has a build number which is
326 # updated each time. We don't bother with that for the auxiliaries.
328 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
330 OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
331 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
332 filtertest.o globals.o dkim.o \
333 header.o host.o ip.o log.o lss.o match.o moan.o \
334 os.o parse.o queue.o \
335 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
336 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
337 std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
339 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
340 $(OBJ_WITH_OLD_DEMIME) $(OBJ_EXPERIMENTAL)
342 exim: buildlookups buildauths pdkim/pdkim.a \
343 buildrouters buildtransports \
344 $(OBJ_EXIM) version.o
345 @echo "$(LNCC) -o exim"
346 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
347 routers/routers.a transports/transports.a lookups/lookups.a \
348 auths/auths.a pdkim/pdkim.a \
349 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
350 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
351 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
352 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
353 echo $(STRIP_COMMAND) exim; \
354 $(STRIP_COMMAND) exim; \
358 @echo ">>> exim binary built"
361 # The utility for dumping the contents of an exim database
363 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
365 exim_dumpdb: $(OBJ_DUMPDB)
366 @echo "$(LNCC) -o exim_dumpdb"
367 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
368 $(LIBS) $(EXTRALIBS) $(DBMLIB)
369 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
370 echo $(STRIP_COMMAND) exim_dumpdb; \
371 $(STRIP_COMMAND) exim_dumpdb; \
373 @echo ">>> exim_dumpdb utility built"
376 # The utility for interrogating/fixing the contents of an exim database
378 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
380 exim_fixdb: $(OBJ_FIXDB) buildauths
381 @echo "$(LNCC) -o exim_fixdb"
382 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
383 auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
384 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
385 echo $(STRIP_COMMAND) exim_fixdb; \
386 $(STRIP_COMMAND) exim_fixdb; \
388 @echo ">>> exim_fixdb utility built"
391 # The utility for tidying the contents of an exim database
393 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
395 exim_tidydb: $(OBJ_TIDYDB)
396 @echo "$(LNCC) -o exim_tidydb"
397 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
398 $(LIBS) $(EXTRALIBS) $(DBMLIB)
399 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
400 echo $(STRIP_COMMAND) exim_tidydb; \
401 $(STRIP_COMMAND) exim_tidydb; \
403 @echo ">>> exim_tidydb utility built"
406 # The utility for building dbm files
408 exim_dbmbuild: exim_dbmbuild.o
409 @echo "$(LNCC) -o exim_dbmbuild"
410 $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
411 $(LIBS) $(EXTRALIBS) $(DBMLIB)
412 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
413 echo $(STRIP_COMMAND) exim_dbmbuild; \
414 $(STRIP_COMMAND) exim_dbmbuild; \
416 @echo ">>> exim_dbmbuild utility built"
419 # The utility for locking a mailbox while messing around with it
421 exim_lock: exim_lock.c os.h
422 @echo "$(CC) exim_lock.c"
423 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
424 @echo "$(LNCC) -o exim_lock"
425 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
427 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
428 echo $(STRIP_COMMAND) exim_lock; \
429 $(STRIP_COMMAND) exim_lock; \
431 @echo ">>> exim_lock utility built"
434 # The X-based Exim monitor program's binary part. There's a macro for cutting
435 # out the modified TextPop module, because some antique link editors cannot
436 # handle the fact that it is redefining things that are found later in the
439 # Object modules that are the unique Eximon modules
441 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
442 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
445 # The complete modules list also includes some specially compiled versions of
446 # code from the main Exim source tree.
448 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
450 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
451 ../exim_monitor/em_version.c
452 @echo "$(CC) exim_monitor/em_version.c"
453 $(FE)$(CC) -o em_version.o -c \
454 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
455 @echo "$(LNCC) -o eximon.bin"
456 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
457 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
458 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
459 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
460 echo $(STRIP_COMMAND) eximon.bin; \
461 $(STRIP_COMMAND) eximon.bin; \
463 @echo ">>> exim monitor binary built"
467 # Compile step for most of the exim modules. HDRS is a list of headers
468 # which cause everthing to be rebuilt. PHDRS is the same, for the use
469 # of routers, transports, and authenticators. I can't find a way of doing this
470 # in one. This list is overkill, but it doesn't really take much time to
471 # rebuild Exim on a modern computer.
484 PHDRS = ../config.h \
497 .c.o:; @echo "$(CC) $*.c"
498 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
500 # Update Exim's version information and build the version object.
503 @../scripts/reversion
507 version.o: $(HDRS) cnumber.h version.h version.c
509 # This is the dummy module for use by test compiles of individual modules. It
510 # contains functions such as log_write() that may be called from bits of Exim
511 # in the tested code.
515 # Compile instructions for perl.o for when EXIM_PERL is set
517 perl.o: $(HDRS) perl.c
518 @echo "$(PERL_CC) perl.c"
519 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
521 # Compile instructions for the database utility modules
523 exim_dumpdb.o: $(HDRS) exim_dbutil.c
524 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
525 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
528 -o exim_dumpdb.o exim_dbutil.c
530 exim_fixdb.o: $(HDRS) exim_dbutil.c
531 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
532 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
535 -o exim_fixdb.o exim_dbutil.c
537 exim_tidydb.o: $(HDRS) exim_dbutil.c
538 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
539 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
542 -o exim_tidydb.o exim_dbutil.c
544 # Compile instructions for exim_dbmbuild
546 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
547 @echo "$(CC) exim_dbmbuild.c"
548 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
550 # Utilities use special versions of some modules - typically with debugging
553 util-spool_in.o: $(HDRS) spool_in.c
554 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
555 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
557 util-store.o: $(HDRS) store.c
558 @echo "$(CC) -DCOMPILE_UTILITY store.c"
559 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
561 util-string.o: $(HDRS) string.c
562 @echo "$(CC) -DCOMPILE_UTILITY string.c"
563 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
565 util-os.o: $(HDRS) os.c
566 @echo "$(CC) -DCOMPILE_UTILITY os.c"
567 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
570 -DFIND_RUNNING_INTERFACES \
573 # The local scan module depends only on its own special header, and is compiled
574 # from a source whose location is set by configuration.
576 local_scan.o: config local_scan.h ../$(LOCAL_SCAN_SOURCE)
577 @echo "$(CC) local_scan.c"
578 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
580 # Dependencies for the "ordinary" exim modules
583 child.o: $(HDRS) child.c
584 crypt16.o: $(HDRS) crypt16.c
585 daemon.o: $(HDRS) daemon.c
586 dbfn.o: $(HDRS) dbfn.c
587 debug.o: $(HDRS) debug.c
588 deliver.o: $(HDRS) deliver.c
589 directory.o: $(HDRS) directory.c
592 exim.o: $(HDRS) exim.c
593 expand.o: $(HDRS) expand.c
594 filter.o: $(HDRS) filter.c
595 filtertest.o: $(HDRS) filtertest.c
596 globals.o: $(HDRS) globals.c
597 header.o: $(HDRS) header.c
598 host.o: $(HDRS) host.c
602 match.o: $(HDRS) match.c
603 moan.o: $(HDRS) moan.c
605 parse.o: $(HDRS) parse.c
606 queue.o: $(HDRS) queue.c
608 readconf.o: $(HDRS) readconf.c
609 receive.o: $(HDRS) receive.c
610 retry.o: $(HDRS) retry.c
611 rewrite.o: $(HDRS) rewrite.c
612 rfc2047.o: $(HDRS) rfc2047.c
613 route.o: $(HDRS) route.c
614 search.o: $(HDRS) search.c
615 sieve.o: $(HDRS) sieve.c
616 smtp_in.o: $(HDRS) smtp_in.c
617 smtp_out.o: $(HDRS) smtp_out.c
618 spool_in.o: $(HDRS) spool_in.c
619 spool_out.o: $(HDRS) spool_out.c
620 std-crypto.o: $(HDRS) std-crypto.c
621 store.o: $(HDRS) store.c
622 string.o: $(HDRS) string.c
623 tls.o: $(HDRS) tls.c setenv.c \
624 tls-gnu.c tlscert-gnu.c \
625 tls-openssl.c tlscert-openssl.c
627 transport.o: $(HDRS) transport.c
628 tree.o: $(HDRS) tree.c
629 verify.o: $(HDRS) verify.c
630 dkim.o: $(HDRS) pdkim/pdkim.h dkim.c
632 # Dependencies for WITH_CONTENT_SCAN modules
634 malware.o: $(HDRS) malware.c
635 mime.o: $(HDRS) mime.c
636 regex.o: $(HDRS) regex.c
637 spam.o: $(HDRS) spam.c
638 spool_mbox.o: $(HDRS) spool_mbox.c
641 # Dependencies for WITH_OLD_DEMIME modules
643 demime.o: $(HDRS) demime.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)