1 # $Cambridge: exim/src/OS/Makefile-Base,v 1.14 2008/01/17 13:03:35 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 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 \
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?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
136 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
137 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
138 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
139 ../src/exicyclog.src > exicyclog-t
140 @mv exicyclog-t exicyclog
142 @echo ">>> exicyclog script built"
144 # Target for the exinext utility script
145 exinext: Makefile config.h ../src/exinext.src
148 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
151 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
152 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
153 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
154 ../src/exinext.src > exinext-t
155 @mv exinext-t exinext
157 @echo ">>> exinext script built"
159 # Target for the exiwhat utility script
160 exiwhat: Makefile config.h ../src/exiwhat.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 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
170 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
171 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
172 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
173 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
174 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
175 ../src/exiwhat.src > exiwhat-t
176 @mv exiwhat-t exiwhat
178 @echo ">>> exiwhat script built"
180 # Target for the exim_checkaccess utility script
181 exim_checkaccess: Makefile config.h ../src/exim_checkaccess.src
182 @rm -f exim_checkaccess
184 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
187 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
188 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
189 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
190 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
191 ../src/exim_checkaccess.src > exim_checkaccess-t
192 @mv exim_checkaccess-t exim_checkaccess
193 @chmod a+x exim_checkaccess
194 @echo ">>> exim_checkaccess script built"; echo ""
196 # Target for the Exim monitor start-up script
197 eximon: Makefile config.h ../src/eximon.src ../OS/eximon.conf-Default \
200 $(SHELL) $(SCRIPTS)/Configure-eximon
202 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
205 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
206 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
207 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
208 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
209 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
210 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
211 ../src/eximon.src >> eximon
212 @echo ">>> eximon script built"; echo ""
214 # Targets for utilities; these are all Perl scripts that have to get the
215 # location of Perl put in them. A few need other things as well.
217 exigrep: Makefile ../src/exigrep.src
220 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
223 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
224 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
225 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
226 ../src/exigrep.src > exigrep-t
227 @mv exigrep-t exigrep
229 @echo ">>> exigrep script built"
231 eximstats: Makefile ../src/eximstats.src
234 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
235 ../src/eximstats.src > eximstats-t
236 @mv eximstats-t eximstats
238 @echo ">>> eximstats script built"
240 exiqgrep: Makefile ../src/exiqgrep.src
243 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
246 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
247 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
248 ../src/exiqgrep.src > exiqgrep-t
249 @mv exiqgrep-t exiqgrep
251 @echo ">>> exiqgrep script built"
253 exiqsumm: Makefile ../src/exiqsumm.src
255 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
256 ../src/exiqsumm.src > exiqsumm-t
257 @mv exiqsumm-t exiqsumm
259 @echo ">>> exiqsumm script built"
261 exipick: Makefile ../src/exipick.src
263 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
264 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
265 ../src/exipick.src > exipick-t
266 @mv exipick-t exipick
268 @echo ">>> exipick script built"
270 transport-filter.pl: Makefile ../src/transport-filter.src
271 @rm -f transport-filter.pl
272 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
273 ../src/transport-filter.src > transport-filter.pl-t
274 @mv transport-filter.pl-t transport-filter.pl
275 @chmod a+x transport-filter.pl
276 @echo ">>> transport-filter.pl script built"
278 convert4r3: Makefile ../src/convert4r3.src
280 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
281 ../src/convert4r3.src > convert4r3-t
282 @mv convert4r3-t convert4r3
283 @chmod a+x convert4r3
284 @echo ">>> convert4r3 script built"
286 convert4r4: Makefile ../src/convert4r4.src
288 @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
289 ../src/convert4r4.src > convert4r4-t
290 @mv convert4r4-t convert4r4
291 @chmod a+x convert4r4
292 @echo ">>> convert4r4 script built"
295 # These are objects of optional features. They are always compiled, but
296 # if the corresponding #defines are not set, they wind up empty and
297 # are thrown away by the linker.
299 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
300 OBJ_WITH_OLD_DEMIME = demime.o
301 OBJ_EXPERIMENTAL = bmi_spam.o spf.o srs.o dk.o dkim-exim.o dcc.o
303 # Targets for final binaries; the main one has a build number which is
304 # updated each time. We don't bother with that for the auxiliaries.
306 OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
307 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
308 filtertest.o globals.o \
309 header.o host.o ip.o log.o lss.o match.o moan.o \
310 os.o parse.o queue.o \
311 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
312 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
313 store.o string.o tls.o tod.o transport.o tree.o verify.o \
314 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
315 $(OBJ_WITH_OLD_DEMIME) $(OBJ_EXPERIMENTAL)
317 exim: lookups/lookups.a auths/auths.a \
318 routers/routers.a transports/transports.a \
319 $(OBJ_EXIM) version.c
321 awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
322 rm -f cnumber.h; mv cnumber.temp cnumber.h
323 @echo "$(CC) version.c"
324 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
326 @echo "$(LNCC) -o exim"
327 $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
328 routers/routers.a transports/transports.a lookups/lookups.a \
330 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
331 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
332 $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
333 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
334 echo $(STRIP_COMMAND) exim; \
335 $(STRIP_COMMAND) exim; \
339 @echo ">>> exim binary built"
342 # The utility for dumping the contents of an exim database
344 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
346 exim_dumpdb: $(OBJ_DUMPDB)
347 @echo "$(LNCC) -o exim_dumpdb"
348 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
349 $(LIBS) $(EXTRALIBS) $(DBMLIB)
350 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
351 echo $(STRIP_COMMAND) exim_dumpdb; \
352 $(STRIP_COMMAND) exim_dumpdb; \
354 @echo ">>> exim_dumpdb utility built"
357 # The utility for interrogating/fixing the contents of an exim database
359 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
361 exim_fixdb: $(OBJ_FIXDB)
362 @echo "$(LNCC) -o exim_fixdb"
363 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
364 $(LIBS) $(EXTRALIBS) $(DBMLIB)
365 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
366 echo $(STRIP_COMMAND) exim_fixdb; \
367 $(STRIP_COMMAND) exim_fixdb; \
369 @echo ">>> exim_fixdb utility built"
372 # The utility for tidying the contents of an exim database
374 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
376 exim_tidydb: $(OBJ_TIDYDB)
377 @echo "$(LNCC) -o exim_tidydb"
378 $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
379 $(LIBS) $(EXTRALIBS) $(DBMLIB)
380 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
381 echo $(STRIP_COMMAND) exim_tidydb; \
382 $(STRIP_COMMAND) exim_tidydb; \
384 @echo ">>> exim_tidydb utility built"
387 # The utility for building dbm files
389 exim_dbmbuild: exim_dbmbuild.o
390 @echo "$(LNCC) -o exim_dbmbuild"
391 $(FE)$(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
392 $(LIBS) $(EXTRALIBS) $(DBMLIB)
393 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
394 echo $(STRIP_COMMAND) exim_dbmbuild; \
395 $(STRIP_COMMAND) exim_dbmbuild; \
397 @echo ">>> exim_dbmbuild utility built"
400 # The utility for locking a mailbox while messing around with it
402 exim_lock: exim_lock.c
403 @echo "$(CC) exim_lock.c"
404 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
405 @echo "$(LNCC) -o exim_lock"
406 $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
408 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
409 echo $(STRIP_COMMAND) exim_lock; \
410 $(STRIP_COMMAND) exim_lock; \
412 @echo ">>> exim_lock utility built"
415 # The X-based Exim monitor program's binary part. There's a macro for cutting
416 # out the modified TextPop module, because some antique link editors cannot
417 # handle the fact that it is redefining things that are found later in the
420 # Object modules that are the unique Eximon modules
422 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
423 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
426 # The complete modules list also includes some specially compiled versions of
427 # code from the main Exim source tree.
429 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
431 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
432 ../exim_monitor/em_version.c
433 @echo "$(CC) exim_monitor/em_version.c"
434 $(FE)$(CC) -o em_version.o -c \
435 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
436 @echo "$(LNCC) -o eximon.bin"
437 $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
438 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
439 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
440 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
441 echo $(STRIP_COMMAND) eximon.bin; \
442 $(STRIP_COMMAND) eximon.bin; \
444 @echo ">>> exim monitor binary built"
448 # Compile step for most of the exim modules. HDRS is a list of headers
449 # which cause everthing to be rebuilt. PHDRS is the same, for the use
450 # of routers, transports, and authenticators. I can't find a way of doing this
451 # in one. This list is overkill, but it doesn't really take much time to
452 # rebuild Exim on a modern computer.
454 HDRS = config.h dbfunctions.h dbstuff.h exim.h functions.h globals.h local_scan.h macros.h mytypes.h structs.h
455 PHDRS = ../config.h ../dbfunctions.h ../dbstuff.h ../exim.h ../functions.h ../globals.h ../local_scan.h ../macros.h ../mytypes.h ../structs.h
458 .c.o:; @echo "$(CC) $*.c"
459 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
461 # This is the dummy module for use by test compiles of individual modules. It
462 # contains functions such as log_write() that may be called from bits of Exim
463 # in the tested code.
467 # Compile instructions for perl.o for when EXIM_PERL is set
469 perl.o: $(HDRS) perl.c
470 @echo "$(PERL_CC) perl.c"
471 $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
473 # Compile instructions for the database utility modules
475 exim_dumpdb.o: $(HDRS) exim_dbutil.c
476 @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
477 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
480 -o exim_dumpdb.o exim_dbutil.c
482 exim_fixdb.o: $(HDRS) exim_dbutil.c
483 @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
484 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
487 -o exim_fixdb.o exim_dbutil.c
489 exim_tidydb.o: $(HDRS) exim_dbutil.c
490 @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
491 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
494 -o exim_tidydb.o exim_dbutil.c
496 # Compile instructions for exim_dbmbuild
498 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
499 @echo "$(CC) exim_dbmbuild.c"
500 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
502 # Utilities use special versions of some modules - typically with debugging
505 util-spool_in.o: $(HDRS) spool_in.c
506 @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
507 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
509 util-store.o: $(HDRS) store.c
510 @echo "$(CC) -DCOMPILE_UTILITY store.c"
511 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
513 util-string.o: $(HDRS) string.c
514 @echo "$(CC) -DCOMPILE_UTILITY string.c"
515 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
517 util-os.o: $(HDRS) os.c
518 @echo "$(CC) -DCOMPILE_UTILITY os.c"
519 $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
522 -DFIND_RUNNING_INTERFACES \
525 # The local scan module depends only on its own special header, and is compiled
526 # from a source whose location is set by configuration.
528 local_scan.o: Makefile local_scan.h ../$(LOCAL_SCAN_SOURCE)
529 @echo "$(CC) local_scan.c"
530 $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
532 # Dependencies for the "ordinary" exim modules
535 child.o: $(HDRS) child.c
536 crypt16.o: $(HDRS) crypt16.c
537 daemon.o: $(HDRS) daemon.c
538 dbfn.o: $(HDRS) dbfn.c
539 debug.o: $(HDRS) debug.c
540 deliver.o: $(HDRS) deliver.c
541 directory.o: $(HDRS) directory.c
544 exim.o: $(HDRS) exim.c
545 expand.o: $(HDRS) expand.c
546 filter.o: $(HDRS) filter.c
547 filtertest.o: $(HDRS) filtertest.c
548 globals.o: $(HDRS) globals.c
549 header.o: $(HDRS) header.c
550 host.o: $(HDRS) host.c
554 match.o: $(HDRS) match.c
555 moan.o: $(HDRS) moan.c
557 parse.o: $(HDRS) parse.c
558 queue.o: $(HDRS) queue.c
560 readconf.o: $(HDRS) readconf.c
561 receive.o: $(HDRS) receive.c
562 retry.o: $(HDRS) retry.c
563 rewrite.o: $(HDRS) rewrite.c
564 rfc2047.o: $(HDRS) rfc2047.c
565 route.o: $(HDRS) route.c
566 search.o: $(HDRS) search.c
567 sieve.o: $(HDRS) sieve.c
568 smtp_in.o: $(HDRS) smtp_in.c
569 smtp_out.o: $(HDRS) smtp_out.c
570 spool_in.o: $(HDRS) spool_in.c
571 spool_out.o: $(HDRS) spool_out.c
572 store.o: $(HDRS) store.c
573 string.o: $(HDRS) string.c
574 tls.o: $(HDRS) tls.c tls-gnu.c tls-openssl.c
576 transport.o: $(HDRS) transport.c
577 tree.o: $(HDRS) tree.c
578 verify.o: $(HDRS) verify.c
581 # Dependencies for WITH_CONTENT_SCAN modules
583 malware.o: $(HDRS) malware.c
584 mime.o: $(HDRS) mime.c
585 regex.o: $(HDRS) regex.c
586 spam.o: $(HDRS) spam.c
587 spool_mbox.o: $(HDRS) spool_mbox.c
590 # Dependencies for WITH_OLD_DEMIME modules
592 demime.o: $(HDRS) demime.c
595 # Dependencies for EXPERIMENTAL_* modules
597 bmi_spam.o: $(HDRS) bmi_spam.c
598 spf.o: $(HDRS) spf.h spf.c
599 srs.o: $(HDRS) srs.h srs.c
600 dk.o: $(HDRS) dk.h dk.c
601 dkim-exim.o: $(HDRS) dkim-exim.h dkim-exim.c
602 dcc.o: $(HDRS) dcc.h dcc.c
604 # The module containing tables of available lookups, routers, auths, and
605 # transports must be rebuilt if any of them are. However, because the makefiles
606 # for the drivers are always run, we don't actually put the dependencies here,
607 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
608 # drtables.o even though the .a files haven't in fact been updated. Instead
609 # it is arranged that the lower-level makefiles remove drtables.o when they
610 # rebuild the .a files.
612 drtables.o: $(HDRS) drtables.c
615 # The exim monitor's private modules - the sources live in a private
616 # subdirectory. The final binary combines the private modules with some
617 # modules from the main exim binary.
619 em_StripChart.o: ../exim_monitor/em_StripChart.c
620 em_TextPop.o: ../exim_monitor/em_TextPop.c
621 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
622 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
623 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
624 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
625 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
626 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
627 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
628 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
629 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
630 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
632 @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
633 $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
634 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
637 # Targets for the various libraries that Exim uses. This coding is tedious,
638 # because different versions of "make" behave in different ways with regard
639 # to rebuilding. If these target names are of the form pcre/libpcre.a, for
640 # example, then a forcing mechanism is required to get them obeyed each time.
641 # That's fine on Solaris and other systems; the rebuilding of the exim target
642 # happens only if the libraries are actually rebuilt. However, on IRIX, if
643 # the target is forced, the exim target gets unnecessarily rebuilt even if
644 # the .a file is not. Contrariwise, if we use dummy names, they don't interact
645 # with the building of exim (and eximon.bin), but for libpcre Exim doesn't get
646 # rebuilt when it should. (For the others it does, because they remove
647 # drtables.o when they rebuild.) To get round this, we forcibly remove the
648 # binary when it needs to be rebuilt.
650 # The lookups library.
653 @cd lookups; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
654 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
655 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"; \
658 # The routers library.
661 @cd routers; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
662 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
663 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
666 # The transports library.
669 @cd transports; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
670 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
671 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
674 # The library of authorization modules
677 @cd auths; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
678 FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
679 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
682 # The "clean", "install", and "makefile" targets just pass themselves back to
683 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
684 # for them in the build directory.
686 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
688 # Targets for building stand-alone testing programs for basic testing of
689 # some of the building blocks. These are not integrated with the makefile-
690 # building targets. If you change something that is going to cause the
691 # makefile to be rebuilt, you must run "make makefile" before running one
694 # The testing programs use different versions of some modules - usually
695 # with bits cut out that are not relevant to the test in hand. For those
696 # that are used by several tests, we use a different name.
698 sa-globals.o: $(HDRS) globals.c
699 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
701 sa-os.o: $(HDRS) os.c
702 $(CC) -c $(CFLAGS) $(INCLUDE) \
703 -DFIND_RUNNING_INTERFACES \
706 # These are the test targets themselves
708 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
709 string.o tod.o version.o
710 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
711 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
712 dummies.o sa-globals.o sa-os.o store.o string.o \
713 tod.o version.o $(LIBS) $(DBMLIB)
716 test_host: config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
717 store.o string.o tod.o tree.o
718 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
719 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
720 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
721 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
722 $(LNCC) -o test_host $(LFLAGS) \
723 host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
724 tod.o tree.o $(LIBS) $(LIBRESOLV)
725 rm -f child.o dummies.o host.o dns.o
727 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
728 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
729 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
730 sa-globals.o store.o string.o tod.o $(LIBS)
733 test_parse: config.h parse.c dummies.o sa-globals.o \
734 store.o string.o tod.o version.o
735 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
736 $(LNCC) -o test_parse $(LFLAGS) parse.o \
737 dummies.o sa-globals.o store.o string.o tod.o version.o
740 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
741 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
742 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
743 dummies.o sa-globals.o store.o tod.o $(LIBS)