1 # $Cambridge: exim/src/OS/Makefile-Base,v 1.17 2009/06/10 07:34:04 tom Exp $
3 # This file is the basis of the main makefile for Exim and friends. The
4 # makefile at the top level arranges to build the main makefile by calling
5 # scripts/Configure-Makefile from within the build directory. This
6 # concatentates the configuration settings from Local/Makefile and other,
7 # optional, Local/* files at the front of this file, to create Makefile in the
12 EDITME = ../Local/Makefile
13 EXIMON_EDITME = ../Local/eximon.conf
15 # The compiler used for linking is normally the same as the compiler used for
16 # compiling. However, by giving it a different name, we can override it from
17 # the command line, and this is helpful for certain types of testing.
21 # The compile commands can be very long. To make the output look better,
22 # they are not normally echoed in full. To get full echoing, the caller
23 # must set FULLECHO='' on the command line and call make with -e. We default
24 # FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
29 # The default target double-checks the existence of $(EDITME) and then arranges
30 # to touch it if it exists and any of the optional configuration files, which
31 # depend on the os or the architecture, have been altered. The same sub-target
32 # does the same thing for the eximon configuration file if it exists. Then
33 # there is a check that the Makefile (the one built from this file) is
34 # up-to-date. Then the os-specific source files and the C configuration file
35 # are set up, and finally it goes to the main Exim target.
37 all: $(EDITME) checklocalmake Makefile os.h os.c config.h allexim
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
81 $(SHELL) $(SCRIPTS)/Configure-os.h
86 $(SHELL) $(SCRIPTS)/Configure-os.c
88 # Build the config.h file.
90 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
91 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
94 # This target is recognized specially by GNU make. It records those targets
95 # that do not correspond to files that are being built and which should
96 # therefore always be run, even if the files exist. This shouldn't in fact be a
97 # problem, but it does no harm. Other make programs will just ignore this.
99 .PHONY: all allexim buildauths buildlookups buildpdkim buildrouters \
100 buildtransports checklocalmake clean
103 # This is the real default target for all the various exim binaries and
104 # scripts, once the configuring stuff is done.
106 allexim: config.h $(EXIM_MONITOR) exicyclog exinext exiwhat \
107 exigrep eximstats exipick exiqgrep exiqsumm \
108 transport-filter.pl convert4r3 convert4r4 \
110 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock \
111 buildlookups buildrouters buildtransports \
112 buildauths buildpdkim exim
115 # Targets for special-purpose configuration header builders
116 buildconfig: buildconfig.c
117 @echo "$(CC) buildconfig.c"
118 $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
121 # Target for the exicyclog utility script
122 exicyclog: Makefile config.h ../src/exicyclog.src
125 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
128 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
129 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
130 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
131 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
132 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
133 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
134 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
135 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
136 -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
137 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
138 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
139 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
140 -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
141 ../src/exicyclog.src > exicyclog-t
142 @mv exicyclog-t exicyclog
144 @echo ">>> exicyclog script built"
146 # Target for the exinext utility script
147 exinext: Makefile config.h ../src/exinext.src
150 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
153 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
154 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
155 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
156 ../src/exinext.src > exinext-t
157 @mv exinext-t exinext
159 @echo ">>> exinext script built"
161 # Target for the exiwhat utility script
162 exiwhat: Makefile config.h ../src/exiwhat.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 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
172 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
173 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
174 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
175 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
176 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
177 ../src/exiwhat.src > exiwhat-t
178 @mv exiwhat-t exiwhat
180 @echo ">>> exiwhat script built"
182 # Target for the exim_checkaccess utility script
183 exim_checkaccess: Makefile config.h ../src/exim_checkaccess.src
184 @rm -f exim_checkaccess
186 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
189 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
190 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
191 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
192 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
193 ../src/exim_checkaccess.src > exim_checkaccess-t
194 @mv exim_checkaccess-t exim_checkaccess
195 @chmod a+x exim_checkaccess
196 @echo ">>> exim_checkaccess script built"; echo ""
198 # Target for the Exim monitor start-up script
199 eximon: Makefile config.h ../src/eximon.src ../OS/eximon.conf-Default \
202 $(SHELL) $(SCRIPTS)/Configure-eximon
204 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
207 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
208 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
209 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
210 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
211 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
212 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
213 ../src/eximon.src >> eximon
214 @echo ">>> eximon script built"; echo ""
216 # Targets for utilities; these are all Perl scripts that have to get the
217 # location of Perl put in them. A few need other things as well.
219 exigrep: Makefile ../src/exigrep.src
222 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
225 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
226 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
227 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
228 ../src/exigrep.src > exigrep-t
229 @mv exigrep-t exigrep
231 @echo ">>> exigrep script built"
233 eximstats: Makefile ../src/eximstats.src
236 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
237 ../src/eximstats.src > eximstats-t
238 @mv eximstats-t eximstats
240 @echo ">>> eximstats script built"
242 exiqgrep: Makefile ../src/exiqgrep.src
245 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
248 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
249 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
250 ../src/exiqgrep.src > exiqgrep-t
251 @mv exiqgrep-t exiqgrep
253 @echo ">>> exiqgrep script built"
255 exiqsumm: Makefile ../src/exiqsumm.src
257 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
258 ../src/exiqsumm.src > exiqsumm-t
259 @mv exiqsumm-t exiqsumm
261 @echo ">>> exiqsumm script built"
263 exipick: Makefile ../src/exipick.src
265 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
266 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
267 ../src/exipick.src > exipick-t
268 @mv exipick-t exipick
270 @echo ">>> exipick script built"
272 transport-filter.pl: Makefile ../src/transport-filter.src
273 @rm -f transport-filter.pl
274 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
275 ../src/transport-filter.src > transport-filter.pl-t
276 @mv transport-filter.pl-t transport-filter.pl
277 @chmod a+x transport-filter.pl
278 @echo ">>> transport-filter.pl script built"
280 convert4r3: Makefile ../src/convert4r3.src
282 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
283 ../src/convert4r3.src > convert4r3-t
284 @mv convert4r3-t convert4r3
285 @chmod a+x convert4r3
286 @echo ">>> convert4r3 script built"
288 convert4r4: Makefile ../src/convert4r4.src
290 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
291 ../src/convert4r4.src > convert4r4-t
292 @mv convert4r4-t convert4r4
293 @chmod a+x convert4r4
294 @echo ">>> convert4r4 script built"
297 # These are objects of optional features. They are always compiled, but
298 # if the corresponding #defines are not set, they wind up empty and
299 # are thrown away by the linker.
301 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
302 OBJ_WITH_OLD_DEMIME = demime.o
303 OBJ_EXPERIMENTAL = bmi_spam.o spf.o srs.o dcc.o
305 # Targets for final binaries; the main one has a build number which is
306 # updated each time. We don't bother with that for the auxiliaries.
308 OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
309 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
310 filtertest.o globals.o dkim.o \
311 header.o host.o ip.o log.o lss.o match.o moan.o \
312 os.o parse.o queue.o \
313 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
314 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
315 store.o string.o tls.o tod.o transport.o tree.o verify.o \
316 lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o \
317 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
318 $(OBJ_WITH_OLD_DEMIME) $(OBJ_EXPERIMENTAL)
320 exim: lookups/lookups.a auths/auths.a pdkim/pdkim.a \
321 routers/routers.a transports/transports.a \
322 $(OBJ_EXIM) version.c
324 awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
325 rm -f cnumber.h; mv cnumber.temp cnumber.h
326 @echo "$(CC) version.c"
327 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
329 @echo "$(LNCC) -o exim"
330 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
331 routers/routers.a transports/transports.a lookups/lookups.a \
332 auths/auths.a pdkim/pdkim.a \
333 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
334 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
335 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
336 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
337 echo $(STRIP_COMMAND) exim; \
338 $(STRIP_COMMAND) exim; \
342 @echo ">>> exim binary built"
345 # The utility for dumping the contents of an exim database
347 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
349 exim_dumpdb: $(OBJ_DUMPDB)
350 @echo "$(LNCC) -o exim_dumpdb"
351 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
352 $(LIBS) $(EXTRALIBS) $(DBMLIB)
353 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
354 echo $(STRIP_COMMAND) exim_dumpdb; \
355 $(STRIP_COMMAND) exim_dumpdb; \
357 @echo ">>> exim_dumpdb utility built"
360 # The utility for interrogating/fixing the contents of an exim database
362 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
364 exim_fixdb: $(OBJ_FIXDB)
365 @echo "$(LNCC) -o exim_fixdb"
366 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
367 $(LIBS) $(EXTRALIBS) $(DBMLIB)
368 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
369 echo $(STRIP_COMMAND) exim_fixdb; \
370 $(STRIP_COMMAND) exim_fixdb; \
372 @echo ">>> exim_fixdb utility built"
375 # The utility for tidying the contents of an exim database
377 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
379 exim_tidydb: $(OBJ_TIDYDB)
380 @echo "$(LNCC) -o exim_tidydb"
381 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
382 $(LIBS) $(EXTRALIBS) $(DBMLIB)
383 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
384 echo $(STRIP_COMMAND) exim_tidydb; \
385 $(STRIP_COMMAND) exim_tidydb; \
387 @echo ">>> exim_tidydb utility built"
390 # The utility for building dbm files
392 exim_dbmbuild: exim_dbmbuild.o
393 @echo "$(LNCC) -o exim_dbmbuild"
394 $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
395 $(LIBS) $(EXTRALIBS) $(DBMLIB)
396 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
397 echo $(STRIP_COMMAND) exim_dbmbuild; \
398 $(STRIP_COMMAND) exim_dbmbuild; \
400 @echo ">>> exim_dbmbuild utility built"
403 # The utility for locking a mailbox while messing around with it
405 exim_lock: exim_lock.c
406 @echo "$(CC) exim_lock.c"
407 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
408 @echo "$(LNCC) -o exim_lock"
409 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
411 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
412 echo $(STRIP_COMMAND) exim_lock; \
413 $(STRIP_COMMAND) exim_lock; \
415 @echo ">>> exim_lock utility built"
418 # The X-based Exim monitor program's binary part. There's a macro for cutting
419 # out the modified TextPop module, because some antique link editors cannot
420 # handle the fact that it is redefining things that are found later in the
423 # Object modules that are the unique Eximon modules
425 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
426 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
429 # The complete modules list also includes some specially compiled versions of
430 # code from the main Exim source tree.
432 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
434 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
435 ../exim_monitor/em_version.c
436 @echo "$(CC) exim_monitor/em_version.c"
437 $(FE)$(CC) -o em_version.o -c \
438 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
439 @echo "$(LNCC) -o eximon.bin"
440 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
441 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
442 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
443 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
444 echo $(STRIP_COMMAND) eximon.bin; \
445 $(STRIP_COMMAND) eximon.bin; \
447 @echo ">>> exim monitor binary built"
451 # Compile step for most of the exim modules. HDRS is a list of headers
452 # which cause everthing to be rebuilt. PHDRS is the same, for the use
453 # of routers, transports, and authenticators. I can't find a way of doing this
454 # in one. This list is overkill, but it doesn't really take much time to
455 # rebuild Exim on a modern computer.
457 HDRS = config.h dbfunctions.h dbstuff.h exim.h functions.h globals.h local_scan.h macros.h mytypes.h structs.h
458 PHDRS = ../config.h ../dbfunctions.h ../dbstuff.h ../exim.h ../functions.h ../globals.h ../local_scan.h ../macros.h ../mytypes.h ../structs.h
461 .c.o:; @echo "$(CC) $*.c"
462 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
464 # This is the dummy module for use by test compiles of individual modules. It
465 # contains functions such as log_write() that may be called from bits of Exim
466 # in the tested code.
470 # Compile instructions for perl.o for when EXIM_PERL is set
472 perl.o: $(HDRS) perl.c
473 @echo "$(PERL_CC) perl.c"
474 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
476 # Compile instructions for the database utility modules
478 exim_dumpdb.o: $(HDRS) exim_dbutil.c
479 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
480 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
483 -o exim_dumpdb.o exim_dbutil.c
485 exim_fixdb.o: $(HDRS) exim_dbutil.c
486 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
487 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
490 -o exim_fixdb.o exim_dbutil.c
492 exim_tidydb.o: $(HDRS) exim_dbutil.c
493 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
494 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
497 -o exim_tidydb.o exim_dbutil.c
499 # Compile instructions for exim_dbmbuild
501 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
502 @echo "$(CC) exim_dbmbuild.c"
503 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
505 # Utilities use special versions of some modules - typically with debugging
508 util-spool_in.o: $(HDRS) spool_in.c
509 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
510 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
512 util-store.o: $(HDRS) store.c
513 @echo "$(CC) -DCOMPILE_UTILITY store.c"
514 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
516 util-string.o: $(HDRS) string.c
517 @echo "$(CC) -DCOMPILE_UTILITY string.c"
518 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
520 util-os.o: $(HDRS) os.c
521 @echo "$(CC) -DCOMPILE_UTILITY os.c"
522 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
525 -DFIND_RUNNING_INTERFACES \
528 # The local scan module depends only on its own special header, and is compiled
529 # from a source whose location is set by configuration.
531 local_scan.o: Makefile config.h local_scan.h ../$(LOCAL_SCAN_SOURCE)
532 @echo "$(CC) local_scan.c"
533 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
535 # Dependencies for the "ordinary" exim modules
538 child.o: $(HDRS) child.c
539 crypt16.o: $(HDRS) crypt16.c
540 daemon.o: $(HDRS) daemon.c
541 dbfn.o: $(HDRS) dbfn.c
542 debug.o: $(HDRS) debug.c
543 deliver.o: $(HDRS) deliver.c
544 directory.o: $(HDRS) directory.c
547 exim.o: $(HDRS) exim.c
548 expand.o: $(HDRS) expand.c
549 filter.o: $(HDRS) filter.c
550 filtertest.o: $(HDRS) filtertest.c
551 globals.o: $(HDRS) globals.c
552 header.o: $(HDRS) header.c
553 host.o: $(HDRS) host.c
557 match.o: $(HDRS) match.c
558 moan.o: $(HDRS) moan.c
560 parse.o: $(HDRS) parse.c
561 queue.o: $(HDRS) queue.c
563 readconf.o: $(HDRS) readconf.c
564 receive.o: $(HDRS) receive.c
565 retry.o: $(HDRS) retry.c
566 rewrite.o: $(HDRS) rewrite.c
567 rfc2047.o: $(HDRS) rfc2047.c
568 route.o: $(HDRS) route.c
569 search.o: $(HDRS) search.c
570 sieve.o: $(HDRS) sieve.c
571 smtp_in.o: $(HDRS) smtp_in.c
572 smtp_out.o: $(HDRS) smtp_out.c
573 spool_in.o: $(HDRS) spool_in.c
574 spool_out.o: $(HDRS) spool_out.c
575 store.o: $(HDRS) store.c
576 string.o: $(HDRS) string.c
577 tls.o: $(HDRS) tls.c tls-gnu.c tls-openssl.c
579 transport.o: $(HDRS) transport.c
580 tree.o: $(HDRS) tree.c
581 verify.o: $(HDRS) verify.c
582 dkim.o: $(HDRS) dkim.c
584 # Dependencies for WITH_CONTENT_SCAN modules
586 malware.o: $(HDRS) malware.c
587 mime.o: $(HDRS) mime.c
588 regex.o: $(HDRS) regex.c
589 spam.o: $(HDRS) spam.c
590 spool_mbox.o: $(HDRS) spool_mbox.c
593 # Dependencies for WITH_OLD_DEMIME modules
595 demime.o: $(HDRS) demime.c
598 # Dependencies for EXPERIMENTAL_* modules
600 bmi_spam.o: $(HDRS) bmi_spam.c
601 spf.o: $(HDRS) spf.h spf.c
602 srs.o: $(HDRS) srs.h srs.c
603 dcc.o: $(HDRS) dcc.h dcc.c
605 # The module containing tables of available lookups, routers, auths, and
606 # transports must be rebuilt if any of them are. However, because the makefiles
607 # for the drivers are always run, we don't actually put the dependencies here,
608 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
609 # drtables.o even though the .a files haven't in fact been updated. Instead
610 # it is arranged that the lower-level makefiles remove drtables.o when they
611 # rebuild the .a files.
613 drtables.o: $(HDRS) drtables.c
616 # The exim monitor's private modules - the sources live in a private
617 # subdirectory. The final binary combines the private modules with some
618 # modules from the main exim binary.
620 em_StripChart.o: ../exim_monitor/em_StripChart.c
621 em_TextPop.o: ../exim_monitor/em_TextPop.c
622 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
623 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
624 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
625 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
626 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
627 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
628 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
629 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
630 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
631 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
633 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
634 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
635 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
638 # Targets for the various libraries that Exim uses.
640 # The lookups library.
642 buildlookups lookups/lookups.a: config.h
643 @cd lookups; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
644 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
645 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"; \
648 # The routers library.
650 buildrouters routers/routers.a: config.h
651 @cd routers; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
652 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
653 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
656 # The transports library.
658 buildtransports transports/transports.a: config.h
659 @cd transports; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
660 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
661 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
664 # The library of authorization modules
666 buildauths auths/auths.a: config.h
667 @cd auths; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
668 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
669 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
674 buildpdkim pdkim/pdkim.a: config.h
675 @cd pdkim; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
676 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
677 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
680 # The "clean", "install", and "makefile" targets just pass themselves back to
681 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
682 # for them in the build directory.
684 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
686 # Targets for building stand-alone testing programs for basic testing of
687 # some of the building blocks. These are not integrated with the makefile-
688 # building targets. If you change something that is going to cause the
689 # makefile to be rebuilt, you must run "make makefile" before running one
692 # The testing programs use different versions of some modules - usually
693 # with bits cut out that are not relevant to the test in hand. For those
694 # that are used by several tests, we use a different name.
696 sa-globals.o: $(HDRS) globals.c
697 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
699 sa-os.o: $(HDRS) os.c
700 $(CC) -c $(CFLAGS) $(INCLUDE) \
701 -DFIND_RUNNING_INTERFACES \
704 # These are the test targets themselves
706 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
707 string.o tod.o version.o
708 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
709 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
710 dummies.o sa-globals.o sa-os.o store.o string.o \
711 tod.o version.o $(LIBS) $(DBMLIB)
714 test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
715 store.o string.o tod.o tree.o
716 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
717 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
718 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
719 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
720 $(LNCC) -o test_host $(LFLAGS) \
721 host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
722 tod.o tree.o $(LIBS) $(LIBRESOLV)
723 rm -f child.o dummies.o host.o dns.o
725 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
726 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
727 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
728 sa-globals.o store.o string.o tod.o $(LIBS)
731 test_parse: config.h parse.c dummies.o sa-globals.o \
732 store.o string.o tod.o version.o
733 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
734 $(LNCC) -o test_parse $(LFLAGS) parse.o \
735 dummies.o sa-globals.o store.o string.o tod.o version.o
738 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
739 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
740 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
741 dummies.o sa-globals.o store.o tod.o $(LIBS)