1 # $Cambridge: exim/src/OS/Makefile-Base,v 1.5 2005/05/04 10:17:29 ph10 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.
22 # The default target double-checks the existence of $(EDITME) and then arranges
23 # to touch it if it exists and any of the optional configuration files, which
24 # depend on the os or the architecture, have been altered. The same sub-target
25 # does the same thing for the eximon configuration file if it exists. Then
26 # there is a check that the Makefile (the one built from this file) is
27 # up-to-date. Then the os-specific source files and the C configuration file
28 # are set up, and finally it goes to the main Exim target.
30 all: $(EDITME) checklocalmake Makefile os.h os.c config.h allexim
33 @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
34 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
35 $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
39 @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
40 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
41 $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
43 if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
48 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
49 @echo "*** appropriate changes for your site."
55 @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
56 @echo "*** appropriate changes for your site."
58 @test ! -d ../Local && mkdir ../Local
61 # Check that the local Makefile is up-to-date
63 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
64 $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
66 @echo "*** Makefile needs rebuilding"
67 @echo "*** Please run \"make makefile\" at top level"
71 # Build (link) the os.h file
74 $(SHELL) $(SCRIPTS)/Configure-os.h
79 $(SHELL) $(SCRIPTS)/Configure-os.c
81 # Build the config.h file.
83 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
84 $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
87 # This target is recognized specially by GNU make. It records those targets
88 # that do not correspond to files that are being built and which should
89 # therefore always be run, even if the files exist. This shouldn't in fact be a
90 # problem, but it does no harm. Other make programs will just ignore this.
92 .PHONY: all allexim buildauths buildlookups buildpcre buildrouters \
93 buildtransports checklocalmake clean
96 # This is the real default target for all the various exim binaries and
97 # scripts, once the configuring stuff is done.
99 allexim: config.h buildpcre $(EXIM_MONITOR) exicyclog exinext exiwhat \
100 exigrep eximstats exipick exiqgrep exiqsumm \
101 transport-filter.pl convert4r3 convert4r4 \
103 exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock \
104 buildlookups buildrouters buildtransports \
108 # Targets for special-purpose configuration header builders
109 buildconfig: buildconfig.c
110 $(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
113 # Target for the exicyclog utility script
114 exicyclog: Makefile config.h ../src/exicyclog.src
117 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
120 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
121 -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
122 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
123 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
124 -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
125 -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
126 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
127 -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
128 -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
129 -e "s?MV_COMMAND?$(MV_COMMAND)?" \
130 -e "s?RM_COMMAND?$(RM_COMMAND)?" \
131 ../src/exicyclog.src > exicyclog-t
132 @mv exicyclog-t exicyclog
134 @echo ">>> exicyclog script built"; echo ""
136 # Target for the exinext utility script
137 exinext: Makefile config.h ../src/exinext.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?$(CONFIGURE_FILE)?" \
145 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
146 ../src/exinext.src > exinext-t
147 @mv exinext-t exinext
149 @echo ">>> exinext script built"; echo ""
151 # Target for the exiwhat utility script
152 exiwhat: Makefile config.h ../src/exiwhat.src
155 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
158 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
159 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
160 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
161 -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
162 -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
163 -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
164 -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
165 -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
166 -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
167 ../src/exiwhat.src > exiwhat-t
168 @mv exiwhat-t exiwhat
170 @echo ">>> exiwhat script built"; echo ""
172 # Target for the exim_checkaccess utility script
173 exim_checkaccess: Makefile config.h ../src/exim_checkaccess.src
174 @rm -f exim_checkaccess
176 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
179 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
180 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
181 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
182 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
183 ../src/exim_checkaccess.src > exim_checkaccess-t
184 @mv exim_checkaccess-t exim_checkaccess
185 @chmod a+x exim_checkaccess
186 @echo ">>> exim_checkaccess script built"; echo ""
188 # Target for the Exim monitor start-up script
189 eximon: Makefile config.h ../src/eximon.src ../OS/eximon.conf-Default \
192 $(SHELL) $(SCRIPTS)/Configure-eximon
194 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
197 -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
198 -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
199 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
200 -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
201 -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
202 -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
203 ../src/eximon.src >> eximon
204 @echo ">>> eximon script built"; echo ""
206 # Targets for utilities; these are all Perl scripts that have to get the
207 # location of Perl put in them. A few need other things as well.
209 exigrep: Makefile ../src/exigrep.src
212 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
215 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
216 -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
217 -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
218 ../src/exigrep.src > exigrep-t
219 @mv exigrep-t exigrep
221 @echo ">>> exigrep script built"; echo ""
223 eximstats: Makefile ../src/eximstats.src
226 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
227 ../src/eximstats.src > eximstats-t
228 @mv eximstats-t eximstats
230 @echo ">>> eximstats script built"; echo ""
232 exiqgrep: Makefile ../src/exiqgrep.src
235 -e "s?PROCESSED_FLAG?This file has been so processed.?"\
238 -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
239 -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
240 ../src/exiqgrep.src > exiqgrep-t
241 @mv exiqgrep-t exiqgrep
243 @echo ">>> exiqgrep script built"; echo ""
245 exiqsumm: Makefile ../src/exiqsumm.src
247 sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
248 ../src/exiqsumm.src > exiqsumm-t
249 @mv exiqsumm-t exiqsumm
251 @echo ">>> exiqsumm script built"; echo ""
253 exipick: Makefile ../src/exipick.src
255 sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
256 -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
257 ../src/exipick.src > exipick-t
258 @mv exipick-t exipick
260 @echo ">>> exipick script built"; echo ""
262 transport-filter.pl: Makefile ../src/transport-filter.src
263 @rm -f transport-filter.pl
264 sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
265 ../src/transport-filter.src > transport-filter.pl-t
266 @mv transport-filter.pl-t transport-filter.pl
267 @chmod a+x transport-filter.pl
268 @echo ">>> transport-filter.pl script built"; echo ""
270 convert4r3: Makefile ../src/convert4r3.src
272 sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
273 ../src/convert4r3.src > convert4r3-t
274 @mv convert4r3-t convert4r3
275 @chmod a+x convert4r3
276 @echo ">>> convert4r3 script built"; echo ""
278 convert4r4: Makefile ../src/convert4r4.src
280 sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
281 ../src/convert4r4.src > convert4r4-t
282 @mv convert4r4-t convert4r4
283 @chmod a+x convert4r4
284 @echo ">>> convert4r4 script built"; echo ""
287 # These are objects of optional features. They are always compiled, but
288 # if the corresponding #defines are not set, they wind up empty and
289 # are thrown away by the linker.
291 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
292 OBJ_WITH_OLD_DEMIME = demime.o
293 OBJ_EXPERIMENTAL = bmi_spam.o spf.o srs.o dk.o
295 # Targets for final binaries; the main one has a build number which is
296 # updated each time. We don't bother with that for the auxiliaries.
298 OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
299 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
300 filtertest.o globals.o \
301 header.o host.o ip.o log.o lss.o match.o moan.o \
302 os.o parse.o queue.o \
303 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
304 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
305 store.o string.o tls.o tod.o transport.o tree.o verify.o \
306 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
307 $(OBJ_WITH_OLD_DEMIME) $(OBJ_EXPERIMENTAL)
309 exim: pcre/libpcre.a lookups/lookups.a auths/auths.a \
310 routers/routers.a transports/transports.a \
311 $(OBJ_EXIM) version.c
313 awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
314 rm -f cnumber.h; mv cnumber.temp cnumber.h
315 $(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
317 $(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
319 routers/routers.a transports/transports.a lookups/lookups.a \
321 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
322 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
323 $(PERL_LIBS) $(TLS_LIBS) $(LDFLAGS)
324 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
325 echo $(STRIP_COMMAND) exim; \
326 $(STRIP_COMMAND) exim; \
330 @echo ">>> exim binary built"
333 # The utility for dumping the contents of an exim database
335 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
337 exim_dumpdb: $(OBJ_DUMPDB)
338 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
339 $(LIBS) $(EXTRALIBS) $(DBMLIB)
340 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
341 echo $(STRIP_COMMAND) exim_dumpdb; \
342 $(STRIP_COMMAND) exim_dumpdb; \
345 @echo ">>> exim_dumpdb utility built"
348 # The utility for interrogating/fixing the contents of an exim database
350 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
352 exim_fixdb: $(OBJ_FIXDB)
353 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
354 $(LIBS) $(EXTRALIBS) $(DBMLIB)
355 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
356 echo $(STRIP_COMMAND) exim_fixdb; \
357 $(STRIP_COMMAND) exim_fixdb; \
360 @echo ">>> exim_fixdb utility built"
363 # The utility for tidying the contents of an exim database
365 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
367 exim_tidydb: $(OBJ_TIDYDB)
368 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
369 $(LIBS) $(EXTRALIBS) $(DBMLIB)
370 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
371 echo $(STRIP_COMMAND) exim_tidydb; \
372 $(STRIP_COMMAND) exim_tidydb; \
375 @echo ">>> exim_tidydb utility built"
378 # The utility for building dbm files
380 exim_dbmbuild: exim_dbmbuild.o
381 $(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
382 $(LIBS) $(EXTRALIBS) $(DBMLIB)
383 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
384 echo $(STRIP_COMMAND) exim_dbmbuild; \
385 $(STRIP_COMMAND) exim_dbmbuild; \
388 @echo ">>> exim_dbmbuild utility built"
391 # The utility for locking a mailbox while messing around with it
393 exim_lock: exim_lock.c
394 $(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
395 $(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
397 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
398 echo $(STRIP_COMMAND) exim_lock; \
399 $(STRIP_COMMAND) exim_lock; \
402 @echo ">>> exim_lock utility built"
405 # The X-based Exim monitor program's binary part. There's a macro for cutting
406 # out the modified TextPop module, because some antique link editors cannot
407 # handle the fact that it is redefining things that are found later in the
410 # Object modules that are the unique Eximon modules
412 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
413 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
416 # The complete modules list also includes some specially compiled versions of
417 # code from the main Exim source tree.
419 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
421 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) pcre/libpcre.a \
422 ../exim_monitor/em_version.c
423 $(CC) -o em_version.o -c \
424 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
425 $(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
426 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 pcre/libpcre.a \
427 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
428 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
429 echo $(STRIP_COMMAND) eximon.bin; \
430 $(STRIP_COMMAND) eximon.bin; \
433 @echo ">>> exim monitor binary built"
437 # Compile step for most of the exim modules. HDRS is a list of headers
438 # which cause everthing to be rebuilt. PHDRS is the same, for the use
439 # of routers, transports, and authenticators. I can't find a way of doing this
440 # in one. This list is overkill, but it doesn't really take much time to
441 # rebuild Exim on a modern computer.
443 HDRS = config.h dbfunctions.h dbstuff.h exim.h functions.h globals.h local_scan.h macros.h mytypes.h structs.h
444 PHDRS = ../config.h ../dbfunctions.h ../dbstuff.h ../exim.h ../functions.h ../globals.h ../local_scan.h ../macros.h ../mytypes.h ../structs.h
447 .c.o:; $(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
449 # This is the dummy module for use by test compiles of individual modules. It
450 # contains functions such as log_write() that may be called from bits of Exim
451 # in the tested code.
455 # Compile instructions for perl.o for when EXIM_PERL is set
457 perl.o: $(HDRS) perl.c
458 $(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
460 # Compile instructions for the database utility modules
462 exim_dumpdb.o: $(HDRS) exim_dbutil.c
463 $(CC) -c $(CFLAGS) $(INCLUDE) \
466 -o exim_dumpdb.o exim_dbutil.c
468 exim_fixdb.o: $(HDRS) exim_dbutil.c
469 $(CC) -c $(CFLAGS) $(INCLUDE) \
472 -o exim_fixdb.o exim_dbutil.c
474 exim_tidydb.o: $(HDRS) exim_dbutil.c
475 $(CC) -c $(CFLAGS) $(INCLUDE) \
478 -o exim_tidydb.o exim_dbutil.c
480 # Compile instructions for exim_dbmbuild
482 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
483 $(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
485 # Utilities use special versions of some modules - typically with debugging
488 util-spool_in.o: $(HDRS) spool_in.c
489 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
491 util-store.o: $(HDRS) store.c
492 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
494 util-string.o: $(HDRS) string.c
495 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
497 util-os.o: $(HDRS) os.c
498 $(CC) -c $(CFLAGS) $(INCLUDE) \
501 -DFIND_RUNNING_INTERFACES \
504 # The local scan module depends only on its own special header, and is compiled
505 # from a source whose location is set by configuration.
507 local_scan.o: Makefile local_scan.h ../$(LOCAL_SCAN_SOURCE)
508 $(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
510 # Dependencies for the "ordinary" exim modules
513 child.o: $(HDRS) child.c
514 crypt16.o: $(HDRS) crypt16.c
515 daemon.o: $(HDRS) daemon.c
516 dbfn.o: $(HDRS) dbfn.c
517 debug.o: $(HDRS) debug.c
518 deliver.o: $(HDRS) deliver.c
519 directory.o: $(HDRS) directory.c
522 exim.o: $(HDRS) exim.c
523 expand.o: $(HDRS) expand.c
524 filter.o: $(HDRS) filter.c
525 filtertest.o: $(HDRS) filtertest.c
526 globals.o: $(HDRS) globals.c
527 header.o: $(HDRS) header.c
528 host.o: $(HDRS) host.c
532 match.o: $(HDRS) match.c
533 moan.o: $(HDRS) moan.c
535 parse.o: $(HDRS) parse.c
536 queue.o: $(HDRS) queue.c
538 readconf.o: $(HDRS) readconf.c
539 receive.o: $(HDRS) receive.c
540 retry.o: $(HDRS) retry.c
541 rewrite.o: $(HDRS) rewrite.c
542 rfc2047.o: $(HDRS) rfc2047.c
543 route.o: $(HDRS) route.c
544 search.o: $(HDRS) search.c
545 sieve.o: $(HDRS) sieve.c
546 smtp_in.o: $(HDRS) smtp_in.c
547 smtp_out.o: $(HDRS) smtp_out.c
548 spool_in.o: $(HDRS) spool_in.c
549 spool_out.o: $(HDRS) spool_out.c
550 store.o: $(HDRS) store.c
551 string.o: $(HDRS) string.c
552 tls.o: $(HDRS) tls.c tls-gnu.c tls-openssl.c
554 transport.o: $(HDRS) transport.c
555 tree.o: $(HDRS) tree.c
556 verify.o: $(HDRS) verify.c
559 # Dependencies for WITH_CONTENT_SCAN modules
561 malware.o: $(HDRS) malware.c
562 mime.o: $(HDRS) mime.c
563 regex.o: $(HDRS) regex.c
564 spam.o: $(HDRS) spam.c
565 spool_mbox.o: $(HDRS) spool_mbox.c
568 # Dependencies for WITH_OLD_DEMIME modules
570 demime.o: $(HDRS) demime.c
573 # Dependencies for EXPERIMENTAL_* modules
575 bmi_spam.o: $(HDRS) bmi_spam.c
580 # The module containing tables of available lookups, routers, auths, and
581 # transports must be rebuilt if any of them are. However, because the makefiles
582 # for the drivers are always run, we don't actually put the dependencies here,
583 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
584 # drtables.o even though the .a files haven't in fact been updated. Instead
585 # it is arranged that the lower-level makefiles remove drtables.o when they
586 # rebuild the .a files.
588 drtables.o: $(HDRS) drtables.c
591 # The exim monitor's private modules - the sources live in a private
592 # subdirectory. The final binary combines the private modules with some
593 # modules from the main exim binary.
595 em_StripChart.o: ../exim_monitor/em_StripChart.c
596 em_TextPop.o: ../exim_monitor/em_TextPop.c
597 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
598 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
599 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
600 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
601 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
602 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
603 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
604 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
605 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
606 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
608 $(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
609 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
612 # Targets for the various libraries that Exim uses. This coding is tedious,
613 # because different versions of "make" behave in different ways with regard
614 # to rebuilding. If these target names are of the form pcre/libpcre.a, for
615 # example, then a forcing mechanism is required to get them obeyed each time.
616 # That's fine on Solaris and other systems; the rebuilding of the exim target
617 # happens only if the libraries are actually rebuilt. However, on IRIX, if
618 # the target is forced, the exim target gets unnecessarily rebuilt even if
619 # the .a file is not. Contrariwise, if we use dummy names, they don't interact
620 # with the building of exim (and eximon.bin), but for libpcre Exim doesn't get
621 # rebuilt when it should. (For the others it does, because they remove
622 # drtables.o when they rebuild.) To get round this, we forcibly remove the
623 # binary when it needs to be rebuilt.
625 # The PCRE regex library. Move the pcretest program to the util directory. Some
626 # "clever" versions of make notice that there are two successive shell
627 # commands, and they run them in the same shell. This means that we have to
628 # take care to encapsulate change of directory in parentheses, so that it
629 # reverts when it should.
632 @(cd pcre; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" \
633 CFLAGS="$(CFLAGS) $(PCRE_CFLAGS)" \
634 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
635 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)")
636 @if $(SHELL) $(SCRIPTS)/newer pcre/libpcre.a exim; then \
637 rm -f exim eximon.bin; fi
639 # The lookups library.
642 @cd lookups; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
643 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
644 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"; \
647 # The routers library.
650 @cd routers; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
651 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
652 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
655 # The transports library.
658 @cd transports; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
659 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
660 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
663 # The library of authorization modules
666 @cd auths; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
667 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
668 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
671 # The "clean", "install", and "makefile" targets just pass themselves back to
672 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
673 # for them in the build directory.
675 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
677 # Targets for building stand-alone testing programs for basic testing of
678 # some of the building blocks. These are not integrated with the makefile-
679 # building targets. If you change something that is going to cause the
680 # makefile to be rebuilt, you must run "make makefile" before running one
683 # The testing programs use different versions of some modules - usually
684 # with bits cut out that are not relevant to the test in hand. For those
685 # that are used by several tests, we use a different name.
687 sa-globals.o: $(HDRS) globals.c
688 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
690 sa-os.o: $(HDRS) os.c
691 $(CC) -c $(CFLAGS) $(INCLUDE) \
692 -DFIND_RUNNING_INTERFACES \
695 # These are the test targets themselves
697 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
698 string.o tod.o version.o
699 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
700 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
701 dummies.o sa-globals.o sa-os.o store.o string.o \
702 tod.o version.o $(LIBS) $(DBMLIB)
705 test_host: config.h host.c dns.c dummies.o sa-globals.o sa-os.o store.o \
706 string.o tod.o tree.o
707 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
708 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
709 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
710 $(LNCC) -o test_host $(LFLAGS) \
711 host.o dns.o dummies.o sa-globals.o os.o store.o string.o tod.o tree.o \
713 rm -f dummies.o host.o dns.o
715 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
716 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
717 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
718 sa-globals.o store.o string.o tod.o $(LIBS)
721 test_parse: config.h parse.c dummies.o sa-globals.o \
722 store.o string.o tod.o version.o
723 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
724 $(LNCC) -o test_parse $(LFLAGS) parse.o \
725 dummies.o sa-globals.o store.o string.o tod.o version.o
728 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
729 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
730 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
731 dummies.o sa-globals.o store.o tod.o $(LIBS)