1 # $Cambridge: exim/src/OS/Makefile-Base,v 1.1 2004/10/06 15:07:39 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
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_EXIM = acl.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
291 directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
292 filtertest.o globals.o \
293 header.o host.o ip.o log.o lss.o match.o moan.o \
294 os.o parse.o queue.o \
295 rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
296 route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
297 store.o string.o tls.o tod.o transport.o tree.o verify.o \
298 local_scan.o $(EXIM_PERL)
300 exim: pcre/libpcre.a lookups/lookups.a auths/auths.a \
301 routers/routers.a transports/transports.a \
302 $(OBJ_EXIM) version.c
304 awk '{ print ($$1+1) }' cnumber.h > cnumber.temp
305 rm -f cnumber.h; mv cnumber.temp cnumber.h
306 $(CC) -c $(CFLAGS) $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) version.c
308 $(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
310 routers/routers.a transports/transports.a lookups/lookups.a \
312 $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
313 $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
314 $(PERL_LIBS) $(TLS_LIBS)
315 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
316 echo $(STRIP_COMMAND) exim; \
317 $(STRIP_COMMAND) exim; \
321 @echo ">>> exim binary built"
324 # The utility for dumping the contents of an exim database
326 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
328 exim_dumpdb: $(OBJ_DUMPDB)
329 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
330 $(LIBS) $(EXTRALIBS) $(DBMLIB)
331 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
332 echo $(STRIP_COMMAND) exim_dumpdb; \
333 $(STRIP_COMMAND) exim_dumpdb; \
336 @echo ">>> exim_dumpdb utility built"
339 # The utility for interrogating/fixing the contents of an exim database
341 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
343 exim_fixdb: $(OBJ_FIXDB)
344 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
345 $(LIBS) $(EXTRALIBS) $(DBMLIB)
346 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
347 echo $(STRIP_COMMAND) exim_fixdb; \
348 $(STRIP_COMMAND) exim_fixdb; \
351 @echo ">>> exim_fixdb utility built"
354 # The utility for tidying the contents of an exim database
356 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
358 exim_tidydb: $(OBJ_TIDYDB)
359 $(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
360 $(LIBS) $(EXTRALIBS) $(DBMLIB)
361 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
362 echo $(STRIP_COMMAND) exim_tidydb; \
363 $(STRIP_COMMAND) exim_tidydb; \
366 @echo ">>> exim_tidydb utility built"
369 # The utility for building dbm files
371 exim_dbmbuild: exim_dbmbuild.o
372 $(LNCC) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
373 $(LIBS) $(EXTRALIBS) $(DBMLIB)
374 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
375 echo $(STRIP_COMMAND) exim_dbmbuild; \
376 $(STRIP_COMMAND) exim_dbmbuild; \
379 @echo ">>> exim_dbmbuild utility built"
382 # The utility for locking a mailbox while messing around with it
384 exim_lock: exim_lock.c
385 $(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
386 $(LNCC) -o exim_lock $(LFLAGS) exim_lock.o \
388 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
389 echo $(STRIP_COMMAND) exim_lock; \
390 $(STRIP_COMMAND) exim_lock; \
393 @echo ">>> exim_lock utility built"
396 # The X-based Exim monitor program's binary part. There's a macro for cutting
397 # out the modified TextPop module, because some antique link editors cannot
398 # handle the fact that it is redefining things that are found later in the
401 # Object modules that are the unique Eximon modules
403 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
404 em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
407 # The complete modules list also includes some specially compiled versions of
408 # code from the main Exim source tree.
410 OBJ_MONBIN = util-spool_in.o util-store.o util-string.o tod.o tree.o $(MONBIN)
412 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) pcre/libpcre.a \
413 ../exim_monitor/em_version.c
414 $(CC) -o em_version.o -c \
415 $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
416 $(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
417 $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 pcre/libpcre.a \
418 $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
419 @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
420 echo $(STRIP_COMMAND) eximon.bin; \
421 $(STRIP_COMMAND) eximon.bin; \
424 @echo ">>> exim monitor binary built"
428 # Compile step for most of the exim modules. HDRS is a list of headers
429 # which cause everthing to be rebuilt. PHDRS is the same, for the use
430 # of routers, transports, and authenticators. I can't find a way of doing this
431 # in one. This list is overkill, but it doesn't really take much time to
432 # rebuild Exim on a modern computer.
434 HDRS = config.h dbfunctions.h dbstuff.h exim.h functions.h globals.h local_scan.h macros.h mytypes.h structs.h
435 PHDRS = ../config.h ../dbfunctions.h ../dbstuff.h ../exim.h ../functions.h ../globals.h ../local_scan.h ../macros.h ../mytypes.h ../structs.h
438 .c.o:; $(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
440 # This is the dummy module for use by test compiles of individual modules. It
441 # contains functions such as log_write() that may be called from bits of Exim
442 # in the tested code.
446 # Compile instructions for perl.o for when EXIM_PERL is set
448 perl.o: $(HDRS) perl.c
449 $(PERL_CC) $(PERL_CCOPTS) $(INCLUDE) -c perl.c
451 # Compile instructions for the database utility modules
453 exim_dumpdb.o: $(HDRS) exim_dbutil.c
454 $(CC) -c $(CFLAGS) $(INCLUDE) \
457 -o exim_dumpdb.o exim_dbutil.c
459 exim_fixdb.o: $(HDRS) exim_dbutil.c
460 $(CC) -c $(CFLAGS) $(INCLUDE) \
463 -o exim_fixdb.o exim_dbutil.c
465 exim_tidydb.o: $(HDRS) exim_dbutil.c
466 $(CC) -c $(CFLAGS) $(INCLUDE) \
469 -o exim_tidydb.o exim_dbutil.c
471 # Compile instructions for exim_dbmbuild
473 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
474 $(CC) -c $(CFLAGS) $(INCLUDE) -o exim_dbmbuild.o exim_dbmbuild.c
476 # Utilities use special versions of some modules - typically with debugging
479 util-spool_in.o: $(HDRS) spool_in.c
480 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
482 util-store.o: $(HDRS) store.c
483 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
485 util-string.o: $(HDRS) string.c
486 $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
488 util-os.o: $(HDRS) os.c
489 $(CC) -c $(CFLAGS) $(INCLUDE) \
492 -DFIND_RUNNING_INTERFACES \
495 # The local scan module depends only on its own special header, and is compiled
496 # from a source whose location is set by configuration.
498 local_scan.o: Makefile local_scan.h ../$(LOCAL_SCAN_SOURCE)
499 $(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
501 # Dependencies for the "ordinary" exim modules
504 child.o: $(HDRS) child.c
505 crypt16.o: $(HDRS) crypt16.c
506 daemon.o: $(HDRS) daemon.c
507 dbfn.o: $(HDRS) dbfn.c
508 debug.o: $(HDRS) debug.c
509 deliver.o: $(HDRS) deliver.c
510 directory.o: $(HDRS) directory.c
513 exim.o: $(HDRS) exim.c
514 expand.o: $(HDRS) expand.c
515 filter.o: $(HDRS) filter.c
516 filtertest.o: $(HDRS) filtertest.c
517 globals.o: $(HDRS) globals.c
518 header.o: $(HDRS) header.c
519 host.o: $(HDRS) host.c
523 match.o: $(HDRS) match.c
524 moan.o: $(HDRS) moan.c
526 parse.o: $(HDRS) parse.c
527 queue.o: $(HDRS) queue.c
529 readconf.o: $(HDRS) readconf.c
530 receive.o: $(HDRS) receive.c
531 retry.o: $(HDRS) retry.c
532 rewrite.o: $(HDRS) rewrite.c
533 rfc2047.o: $(HDRS) rfc2047.c
534 route.o: $(HDRS) route.c
535 search.o: $(HDRS) search.c
536 sieve.o: $(HDRS) sieve.c
537 smtp_in.o: $(HDRS) smtp_in.c
538 smtp_out.o: $(HDRS) smtp_out.c
539 spool_in.o: $(HDRS) spool_in.c
540 spool_out.o: $(HDRS) spool_out.c
541 store.o: $(HDRS) store.c
542 string.o: $(HDRS) string.c
543 tls.o: $(HDRS) tls.c tls-gnu.c tls-openssl.c
545 transport.o: $(HDRS) transport.c
546 tree.o: $(HDRS) tree.c
547 verify.o: $(HDRS) verify.c
549 # The module containing tables of available lookups, routers, auths, and
550 # transports must be rebuilt if any of them are. However, because the makefiles
551 # for the drivers are always run, we don't actually put the dependencies here,
552 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
553 # drtables.o even though the .a files haven't in fact been updated. Instead
554 # it is arranged that the lower-level makefiles remove drtables.o when they
555 # rebuild the .a files.
557 drtables.o: $(HDRS) drtables.c
560 # The exim monitor's private modules - the sources live in a private
561 # subdirectory. The final binary combines the private modules with some
562 # modules from the main exim binary.
564 em_StripChart.o: ../exim_monitor/em_StripChart.c
565 em_TextPop.o: ../exim_monitor/em_TextPop.c
566 em_globals.o: ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
567 em_init.o: ../exim_monitor/em_init.c ../exim_monitor/em_hdr.h
568 em_log.o: ../exim_monitor/em_log.c ../exim_monitor/em_hdr.h
569 em_main.o: ../exim_monitor/em_main.c ../exim_monitor/em_hdr.h
570 em_menu.o: ../exim_monitor/em_menu.c ../exim_monitor/em_hdr.h
571 em_queue.o: ../exim_monitor/em_queue.c ../exim_monitor/em_hdr.h
572 em_strip.o: ../exim_monitor/em_strip.c ../exim_monitor/em_hdr.h
573 em_text.o: ../exim_monitor/em_text.c ../exim_monitor/em_hdr.h
574 em_xs.o: ../exim_monitor/em_xs.c ../exim_monitor/em_hdr.h
575 em_version.o: ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
577 $(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
578 ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
581 # Targets for the various libraries that Exim uses. This coding is tedious,
582 # because different versions of "make" behave in different ways with regard
583 # to rebuilding. If these target names are of the form pcre/libpcre.a, for
584 # example, then a forcing mechanism is required to get them obeyed each time.
585 # That's fine on Solaris and other systems; the rebuilding of the exim target
586 # happens only if the libraries are actually rebuilt. However, on IRIX, if
587 # the target is forced, the exim target gets unnecessarily rebuilt even if
588 # the .a file is not. Contrariwise, if we use dummy names, they don't interact
589 # with the building of exim (and eximon.bin), but for libpcre Exim doesn't get
590 # rebuilt when it should. (For the others it does, because they remove
591 # drtables.o when they rebuild.) To get round this, we forcibly remove the
592 # binary when it needs to be rebuilt.
594 # The PCRE regex library. Move the pcretest program to the util directory. Some
595 # "clever" versions of make notice that there are two successive shell
596 # commands, and they run them in the same shell. This means that we have to
597 # take care to encapsulate change of directory in parentheses, so that it
598 # reverts when it should.
601 @(cd pcre; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" \
602 CFLAGS="$(CFLAGS) $(PCRE_CFLAGS)" \
603 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
604 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)")
605 @if $(SHELL) $(SCRIPTS)/newer pcre/libpcre.a exim; then \
606 rm -f exim eximon.bin; fi
608 # The lookups library.
611 @cd lookups; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
612 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
613 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"; \
616 # The routers library.
619 @cd routers; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
620 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
621 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
624 # The transports library.
627 @cd transports; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
628 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
629 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
632 # The library of authorization modules
635 @cd auths; $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
636 RANLIB="$(RANLIB)" HDRS="$(PHDRS)" \
637 INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"; \
640 # The "clean", "install", and "makefile" targets just pass themselves back to
641 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
642 # for them in the build directory.
644 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
646 # Targets for building stand-alone testing programs for basic testing of
647 # some of the building blocks. These are not integrated with the makefile-
648 # building targets. If you change something that is going to cause the
649 # makefile to be rebuilt, you must run "make makefile" before running one
652 # The testing programs use different versions of some modules - usually
653 # with bits cut out that are not relevant to the test in hand. For those
654 # that are used by several tests, we use a different name.
656 sa-globals.o: $(HDRS) globals.c
657 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
659 sa-os.o: $(HDRS) os.c
660 $(CC) -c $(CFLAGS) $(INCLUDE) \
661 -DFIND_RUNNING_INTERFACES \
664 # These are the test targets themselves
666 test_dbfn: config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
667 string.o tod.o version.o
668 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
669 $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
670 dummies.o sa-globals.o sa-os.o store.o string.o \
671 tod.o version.o $(LIBS) $(DBMLIB)
674 test_host: config.h host.c dns.c dummies.o sa-globals.o sa-os.o store.o \
675 string.o tod.o tree.o
676 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
677 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
678 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
679 $(LNCC) -o test_host $(LFLAGS) \
680 host.o dns.o dummies.o sa-globals.o os.o store.o string.o tod.o tree.o \
682 rm -f dummies.o host.o dns.o
684 test_os: os.h os.c dummies.o sa-globals.o store.o string.o tod.o
685 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
686 $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
687 sa-globals.o store.o string.o tod.o $(LIBS)
690 test_parse: config.h parse.c dummies.o sa-globals.o \
691 store.o string.o tod.o version.o
692 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
693 $(LNCC) -o test_parse $(LFLAGS) parse.o \
694 dummies.o sa-globals.o store.o string.o tod.o version.o
697 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o
698 $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
699 $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
700 dummies.o sa-globals.o store.o tod.o $(LIBS)