1 # $Cambridge: exim/src/OS/Makefile-Base,v 1.1.2.2 2004/11/30 15:18:58 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.
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
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 # Targets for final binaries; the main one has a build number which is
288 # updated each time. We don't bother with that for the auxiliaries.
290 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
292 OBJ_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
293 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
294 filtertest.o globals.o \
295 header.o host.o ip.o log.o lss.o match.o moan.o \
296 os.o parse.o queue.o \
297 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
298 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
299 store.o string.o tls.o tod.o transport.o tree.o verify.o \
300 local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN)
302 exim: pcre/libpcre.a lookups/lookups.a auths/auths.a \
303 routers/routers.a transports/transports.a \
304 $(OBJ_EXIM) version.c
306 awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
307 rm -f cnumber.h; mv cnumber.temp cnumber.h
308 $(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
310 $(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
312 routers/routers.a transports/transports.a lookups/lookups.a \
314 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
315 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
316 $(PERL_LIBS) $(TLS_LIBS)
317 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
318 echo $(STRIP_COMMAND) exim; \
319 $(STRIP_COMMAND) exim; \
323 @echo ">>> exim binary built"
326 # The utility for dumping the contents of an exim database
328 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
330 exim_dumpdb: $(OBJ_DUMPDB)
331 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
332 $(LIBS) $(EXTRALIBS) $(DBMLIB)
333 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
334 echo $(STRIP_COMMAND) exim_dumpdb; \
335 $(STRIP_COMMAND) exim_dumpdb; \
338 @echo ">>> exim_dumpdb utility built"
341 # The utility for interrogating/fixing the contents of an exim database
343 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
345 exim_fixdb: $(OBJ_FIXDB)
346 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
347 $(LIBS) $(EXTRALIBS) $(DBMLIB)
348 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
349 echo $(STRIP_COMMAND) exim_fixdb; \
350 $(STRIP_COMMAND) exim_fixdb; \
353 @echo ">>> exim_fixdb utility built"
356 # The utility for tidying the contents of an exim database
358 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
360 exim_tidydb: $(OBJ_TIDYDB)
361 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
362 $(LIBS) $(EXTRALIBS) $(DBMLIB)
363 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
364 echo $(STRIP_COMMAND) exim_tidydb; \
365 $(STRIP_COMMAND) exim_tidydb; \
368 @echo ">>> exim_tidydb utility built"
371 # The utility for building dbm files
373 exim_dbmbuild: exim_dbmbuild.o
374 $(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
375 $(LIBS) $(EXTRALIBS) $(DBMLIB)
376 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
377 echo $(STRIP_COMMAND) exim_dbmbuild; \
378 $(STRIP_COMMAND) exim_dbmbuild; \
381 @echo ">>> exim_dbmbuild utility built"
384 # The utility for locking a mailbox while messing around with it
386 exim_lock: exim_lock.c
387 $(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
388 $(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
390 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
391 echo $(STRIP_COMMAND) exim_lock; \
392 $(STRIP_COMMAND) exim_lock; \
395 @echo ">>> exim_lock utility built"
398 # The X-based Exim monitor program's binary part. There's a macro for cutting
399 # out the modified TextPop module, because some antique link editors cannot
400 # handle the fact that it is redefining things that are found later in the
403 # Object modules that are the unique Eximon modules
405 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
406 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
409 # The complete modules list also includes some specially compiled versions of
410 # code from the main Exim source tree.
412 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
414 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) pcre/libpcre.a \
415 ../exim_monitor/em_version.c
416 $(CC) -o em_version.o -c \
417 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
418 $(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
419 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 pcre/libpcre.a \
420 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
421 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
422 echo $(STRIP_COMMAND) eximon.bin; \
423 $(STRIP_COMMAND) eximon.bin; \
426 @echo ">>> exim monitor binary built"
430 # Compile step for most of the exim modules. HDRS is a list of headers
431 # which cause everthing to be rebuilt. PHDRS is the same, for the use
432 # of routers, transports, and authenticators. I can't find a way of doing this
433 # in one. This list is overkill, but it doesn't really take much time to
434 # rebuild Exim on a modern computer.
436 HDRS = config.h dbfunctions.h dbstuff.h exim.h functions.h globals.h local_scan.h macros.h mytypes.h structs.h
437 PHDRS = ../config.h ../dbfunctions.h ../dbstuff.h ../exim.h ../functions.h ../globals.h ../local_scan.h ../macros.h ../mytypes.h ../structs.h
440 .c.o:; $(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
442 # This is the dummy module for use by test compiles of individual modules. It
443 # contains functions such as log_write() that may be called from bits of Exim
444 # in the tested code.
448 # Compile instructions for perl.o for when EXIM_PERL is set
450 perl.o: $(HDRS) perl.c
451 $(PERL_CC) $(PERL_CCOPTS) $(INCLUDE) -c perl.c
453 # Compile instructions for the database utility modules
455 exim_dumpdb.o: $(HDRS) exim_dbutil.c
456 $(CC) -c $(CFLAGS) $(INCLUDE) \
459 -o exim_dumpdb.o exim_dbutil.c
461 exim_fixdb.o: $(HDRS) exim_dbutil.c
462 $(CC) -c $(CFLAGS) $(INCLUDE) \
465 -o exim_fixdb.o exim_dbutil.c
467 exim_tidydb.o: $(HDRS) exim_dbutil.c
468 $(CC) -c $(CFLAGS) $(INCLUDE) \
471 -o exim_tidydb.o exim_dbutil.c
473 # Compile instructions for exim_dbmbuild
475 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
476 $(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
478 # Utilities use special versions of some modules - typically with debugging
481 util-spool_in.o: $(HDRS) spool_in.c
482 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
484 util-store.o: $(HDRS) store.c
485 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
487 util-string.o: $(HDRS) string.c
488 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
490 util-os.o: $(HDRS) os.c
491 $(CC) -c $(CFLAGS) $(INCLUDE) \
494 -DFIND_RUNNING_INTERFACES \
497 # The local scan module depends only on its own special header, and is compiled
498 # from a source whose location is set by configuration.
500 local_scan.o: Makefile local_scan.h ../$(LOCAL_SCAN_SOURCE)
501 $(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
503 # Dependencies for the "ordinary" exim modules
506 child.o: $(HDRS) child.c
507 crypt16.o: $(HDRS) crypt16.c
508 daemon.o: $(HDRS) daemon.c
509 dbfn.o: $(HDRS) dbfn.c
510 debug.o: $(HDRS) debug.c
511 deliver.o: $(HDRS) deliver.c
512 directory.o: $(HDRS) directory.c
515 exim.o: $(HDRS) exim.c
516 expand.o: $(HDRS) expand.c
517 filter.o: $(HDRS) filter.c
518 filtertest.o: $(HDRS) filtertest.c
519 globals.o: $(HDRS) globals.c
520 header.o: $(HDRS) header.c
521 host.o: $(HDRS) host.c
525 match.o: $(HDRS) match.c
526 moan.o: $(HDRS) moan.c
528 parse.o: $(HDRS) parse.c
529 queue.o: $(HDRS) queue.c
531 readconf.o: $(HDRS) readconf.c
532 receive.o: $(HDRS) receive.c
533 retry.o: $(HDRS) retry.c
534 rewrite.o: $(HDRS) rewrite.c
535 rfc2047.o: $(HDRS) rfc2047.c
536 route.o: $(HDRS) route.c
537 search.o: $(HDRS) search.c
538 sieve.o: $(HDRS) sieve.c
539 smtp_in.o: $(HDRS) smtp_in.c
540 smtp_out.o: $(HDRS) smtp_out.c
541 spool_in.o: $(HDRS) spool_in.c
542 spool_out.o: $(HDRS) spool_out.c
543 store.o: $(HDRS) store.c
544 string.o: $(HDRS) string.c
545 tls.o: $(HDRS) tls.c tls-gnu.c tls-openssl.c
547 transport.o: $(HDRS) transport.c
548 tree.o: $(HDRS) tree.c
549 verify.o: $(HDRS) verify.c
552 # Dependencies for WITH_CONTENT_SCAN modules
554 malware.o: $(HDRS) malware.c
555 mime.o: $(HDRS) mime.c
556 regex.o: $(HDRS) regex.c
557 spam.o: $(HDRS) spam.c
558 spool_mbox.o: $(HDRS) spool_mbox.c
561 # The module containing tables of available lookups, routers, auths, and
562 # transports must be rebuilt if any of them are. However, because the makefiles
563 # for the drivers are always run, we don't actually put the dependencies here,
564 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
565 # drtables.o even though the .a files haven't in fact been updated. Instead
566 # it is arranged that the lower-level makefiles remove drtables.o when they
567 # rebuild the .a files.
569 drtables.o: $(HDRS) drtables.c
572 # The exim monitor's private modules - the sources live in a private
573 # subdirectory. The final binary combines the private modules with some
574 # modules from the main exim binary.
576 em_StripChart.o: ../exim_monitor/em_StripChart.c
577 em_TextPop.o: ../exim_monitor/em_TextPop.c
578 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
579 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
580 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
581 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
582 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
583 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
584 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
585 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
586 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
587 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
589 $(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
590 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
593 # Targets for the various libraries that Exim uses. This coding is tedious,
594 # because different versions of "make" behave in different ways with regard
595 # to rebuilding. If these target names are of the form pcre/libpcre.a, for
596 # example, then a forcing mechanism is required to get them obeyed each time.
597 # That's fine on Solaris and other systems; the rebuilding of the exim target
598 # happens only if the libraries are actually rebuilt. However, on IRIX, if
599 # the target is forced, the exim target gets unnecessarily rebuilt even if
600 # the .a file is not. Contrariwise, if we use dummy names, they don't interact
601 # with the building of exim (and eximon.bin), but for libpcre Exim doesn't get
602 # rebuilt when it should. (For the others it does, because they remove
603 # drtables.o when they rebuild.) To get round this, we forcibly remove the
604 # binary when it needs to be rebuilt.
606 # The PCRE regex library. Move the pcretest program to the util directory. Some
607 # "clever" versions of make notice that there are two successive shell
608 # commands, and they run them in the same shell. This means that we have to
609 # take care to encapsulate change of directory in parentheses, so that it
610 # reverts when it should.
613 @(cd pcre; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" \
614 CFLAGS="$(CFLAGS) $(PCRE_CFLAGS)" \
615 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
616 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)")
617 @if $(SHELL) $(SCRIPTS)/newer pcre/libpcre.a exim; then \
618 rm -f exim eximon.bin; fi
620 # The lookups library.
623 @cd lookups; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
624 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
625 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"; \
628 # The routers library.
631 @cd routers; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
632 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
633 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
636 # The transports library.
639 @cd transports; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
640 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
641 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
644 # The library of authorization modules
647 @cd auths; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
648 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
649 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
652 # The "clean", "install", and "makefile" targets just pass themselves back to
653 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
654 # for them in the build directory.
656 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
658 # Targets for building stand-alone testing programs for basic testing of
659 # some of the building blocks. These are not integrated with the makefile-
660 # building targets. If you change something that is going to cause the
661 # makefile to be rebuilt, you must run "make makefile" before running one
664 # The testing programs use different versions of some modules - usually
665 # with bits cut out that are not relevant to the test in hand. For those
666 # that are used by several tests, we use a different name.
668 sa-globals.o: $(HDRS) globals.c
669 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
671 sa-os.o: $(HDRS) os.c
672 $(CC) -c $(CFLAGS) $(INCLUDE) \
673 -DFIND_RUNNING_INTERFACES \
676 # These are the test targets themselves
678 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
679 string.o tod.o version.o
680 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
681 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
682 dummies.o sa-globals.o sa-os.o store.o string.o \
683 tod.o version.o $(LIBS) $(DBMLIB)
686 test_host: config.h host.c dns.c dummies.o sa-globals.o sa-os.o store.o \
687 string.o tod.o tree.o
688 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
689 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
690 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
691 $(LNCC) -o test_host $(LFLAGS) \
692 host.o dns.o dummies.o sa-globals.o os.o store.o string.o tod.o tree.o \
694 rm -f dummies.o host.o dns.o
696 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
697 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
698 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
699 sa-globals.o store.o string.o tod.o $(LIBS)
702 test_parse: config.h parse.c dummies.o sa-globals.o \
703 store.o string.o tod.o version.o
704 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
705 $(LNCC) -o test_parse $(LFLAGS) parse.o \
706 dummies.o sa-globals.o store.o string.o tod.o version.o
709 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
710 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
711 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
712 dummies.o sa-globals.o store.o tod.o $(LIBS)