tidying
[users/heiko/exim.git] / src / OS / Makefile-Base
1 # This file is the basis of the main makefile for Exim and friends. The
2 # makefile at the top level arranges to build the main makefile by calling
3 # scripts/Configure-Makefile from within the build directory. This
4 # concatenates the configuration settings from Local/Makefile and other,
5 # optional, Local/* files at the front of this file, to create Makefile in the
6 # build directory.
7 #
8 # Copyright (c) The Exim Maintainers 2016
9
10 SHELL      = $(MAKE_SHELL)
11 SCRIPTS    = ../scripts
12 O          = ../OS
13 EDITME     = ../Local/Makefile
14 EXIMON_EDITME = ../Local/eximon.conf
15
16 # The compiler used for linking is normally the same as the compiler used for
17 # compiling. However, by giving it a different name, we can override it from
18 # the command line, and this is helpful for certain types of testing.
19
20 LNCC = $(CC)
21
22 # The compile commands can be very long. To make the output look better,
23 # they are not normally echoed in full. To get full echoing, the caller
24 # must set FULLECHO='' on the command line and call make with -e. We default
25 # FULLECHO to '@' to suppress the full echo. Then define an abbreviation.
26
27 FULLECHO = @
28 FE       = $(FULLECHO)
29
30 # The default target double-checks the existence of $(EDITME) and then arranges
31 # to touch it if it exists and any of the optional configuration files, which
32 # depend on the os or the architecture, have been altered. The same sub-target
33 # does the same thing for the eximon configuration file if it exists. Then
34 # there is a check that the Makefile (the one built from this file) is
35 # up-to-date. Then the os-specific source files and the C configuration file
36 # are set up, and finally it goes to the main Exim target.
37
38 all:       utils exim
39 config:    $(EDITME) checklocalmake Makefile os.c config.h version.h macro.c
40
41 checklocalmake: 
42         @if $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE) $(EDITME) || \
43           $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(ARCHTYPE) $(EDITME) || \
44           $(SHELL) $(SCRIPTS)/newer $(EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EDITME); \
45         then \
46           touch $(EDITME); \
47         fi
48         @if $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE) $(EXIMON_EDITME) || \
49           $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(ARCHTYPE) $(EXIMON_EDITME) || \
50           $(SHELL) $(SCRIPTS)/newer $(EXIMON_EDITME)-$(OSTYPE)-$(ARCHTYPE) $(EXIMON_EDITME); \
51         then \
52           if [ -f $(EXIMON_EDITME) ]; then touch $(EXIMON_EDITME); fi \
53         fi
54
55 $(EDITME):
56         @echo " "
57         @echo "*** Please create Local/Makefile by copying src/EDITME and making"
58         @echo "*** appropriate changes for your site."
59         @echo " "
60         @false
61
62 $(EXIMON_EDITME):
63         @echo " "
64         @echo "*** Please create Local/eximon.conf by copying exim_monitor/EDITME and making"
65         @echo "*** appropriate changes for your site."
66         @echo " "
67         @test ! -d ../Local && mkdir ../Local
68         @false
69
70 # Check that the local Makefile is up-to-date
71
72 Makefile: ../OS/Makefile-Base ../OS/Makefile-Default \
73           $(SCRIPTS)/Configure $(SCRIPTS)/Configure-Makefile $(EDITME)
74         @echo " "
75         @echo "*** Makefile needs rebuilding"
76         @echo "*** Please run \"make makefile\" at top level"
77         @echo " "
78         @false
79
80 # Build (link) the os.h file
81
82 #os.h:  $(SCRIPTS)/Configure-os.h \
83 #       $(O)/os.h-AIX           $(O)/os.h-BSDI  $(O)/os.h-cygwin \
84 #       $(O)/os.h-Darwin        $(O)/os.h-DGUX  $(O)/os.h-DragonFly \
85 #       $(O)/os.h-FreeBSD       $(O)/os.h-GNU   $(O)/os.h-GNUkFreeBSD \
86 #       $(O)/os.h-GNUkNetBSD    $(O)/os.h-HI-OSF \
87 #       $(O)/os.h-HI-UX         $(O)/os.h-HP-UX $(O)/os.h-HP-UX-9 \
88 #       $(O)/os.h-IRIX          $(O)/os.h-IRIX6 $(O)/os.h-IRIX632 \
89 #       $(O)/os.h-IRIX65        $(O)/os.h-Linux $(O)/os.h-mips \
90 #       $(O)/os.h-NetBSD        $(O)/os.h-NetBSD-a.out \
91 #       $(O)/os.h-OpenBSD       $(O)/os.h-OpenUNIX      $(O)/os.h-OSF1 \
92 #       $(O)/os.h-QNX           $(O)/os.h-SCO           $(O)/os.h-SCO_SV \
93 #       $(O)/os.h-SunOS4        $(O)/os.h-SunOS5        $(O)/os.h-SunOS5-hal \
94 #       $(O)/os.h-ULTRIX        $(O)/os.h-UNIX_SV \
95 #       $(O)/os.h-Unixware7     $(O)/os.h-USG
96 #       $(SHELL) $(SCRIPTS)/Configure-os.h
97
98 os.h:   $(SCRIPTS)/Configure-os.h \
99         $(O)/os.h-FreeBSD       \
100         $(O)/os.h-Linux         \
101         $(O)/os.h-OpenBSD       \
102         $(O)/os.h-SunOS5
103         $(SHELL) $(SCRIPTS)/Configure-os.h
104
105 # Build the os.c file
106
107 #os.c:   ../src/os.c \
108 #       $(SCRIPTS)/Configure-os.c \
109 #       $(O)/os.c-cygwin        $(O)/os.c-GNU   $(O)/os.c-HI-OSF \
110 #       $(O)/os.c-IRIX          $(O)/os.c-IRIX6 $(O)/os.c-IRIX632 \
111 #       $(O)/os.c-IRIX65        $(O)/os.c-Linux $(O)/os.c-OSF1
112 #       $(SHELL) $(SCRIPTS)/Configure-os.c
113
114 os.c:   ../src/os.c \
115         $(SCRIPTS)/Configure-os.c \
116         $(O)/os.c-Linux
117         $(SHELL) $(SCRIPTS)/Configure-os.c
118
119 # Build the config.h file.
120
121 config.h: Makefile buildconfig ../src/config.h.defaults $(EDITME)
122         $(SHELL) $(SCRIPTS)/Configure-config.h "$(MAKE)"
123
124 # Build the builtin-macros data struct
125
126 MACRO_HSRC = macro_predef.h os.h globals.h config.h \
127         routers/accept.h routers/dnslookup.h routers/ipliteral.h \
128         routers/iplookup.h routers/manualroute.h routers/queryprogram.h \
129         routers/redirect.h
130
131 OBJ_MACRO = macro_predef.o \
132         macro-globals.o macro-readconf.o macro-route.o macro-transport.o macro-drtables.o \
133         macro-appendfile.o macro-autoreply.o macro-lmtp.o macro-pipe.o macro-queuefile.o \
134         macro-smtp.o macro-accept.o macro-dnslookup.o macro-ipliteral.o macro-iplookup.o \
135         macro-manualroute.o macro-queryprogram.o macro-redirect.o \
136         macro-auth-spa.o macro-cram_md5.o macro-cyrus_sasl.o macro-dovecot.o macro-gsasl_exim.o \
137         macro-heimdal_gssapi.o macro-plaintext.o macro-spa.o macro-tls.o\
138
139 $(OBJ_MACRO):   $(MACRO_HSRC)
140
141 macro_predef.o :        macro_predef.c
142         @echo "$(CC) -DMACRO_PREDEF macro_predef.c"
143         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ macro_predef.c
144 macro-globals.o :       globals.c
145         @echo "$(CC) -DMACRO_PREDEF globals.c"
146         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ globals.c
147 macro-readconf.o :      readconf.c
148         @echo "$(CC) -DMACRO_PREDEF readconf.c"
149         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ readconf.c
150 macro-route.o :         route.c
151         @echo "$(CC) -DMACRO_PREDEF route.c"
152         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ route.c
153 macro-transport.o:      transport.c
154         @echo "$(CC) -DMACRO_PREDEF transport.c"
155         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transport.c
156 macro-drtables.o :      drtables.c
157         @echo "$(CC) -DMACRO_PREDEF drtables.c"
158         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ drtables.c
159 macro-appendfile.o :    transports/appendfile.c
160         @echo "$(CC) -DMACRO_PREDEF transports/appendfile.c"
161         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/appendfile.c
162 macro-autoreply.o :     transports/autoreply.c
163         @echo "$(CC) -DMACRO_PREDEF transports/autoreply.c"
164         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/autoreply.c
165 macro-lmtp.o:           transports/lmtp.c
166         @echo "$(CC) -DMACRO_PREDEF transports/lmtp.c"
167         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/lmtp.c
168 macro-pipe.o :          transports/pipe.c
169         @echo "$(CC) -DMACRO_PREDEF transports/pipe.c"
170         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/pipe.c
171 macro-queuefile.o :     transports/queuefile.c
172         @echo "$(CC) -DMACRO_PREDEF transports/queuefile.c"
173         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/queuefile.c
174 macro-smtp.o :          transports/smtp.c
175         @echo "$(CC) -DMACRO_PREDEF transports/smtp.c"
176         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ transports/smtp.c
177 macro-accept.o :        routers/accept.c
178         @echo "$(CC) -DMACRO_PREDEF routers/accept.c"
179         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/accept.c
180 macro-dnslookup.o :     routers/dnslookup.c
181         @echo "$(CC) -DMACRO_PREDEF routers/dnslookup.c"
182         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/dnslookup.c
183 macro-ipliteral.o :     routers/ipliteral.c
184         @echo "$(CC) -DMACRO_PREDEF routers/ipliteral.c"
185         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/ipliteral.c
186 macro-iplookup.o :      routers/iplookup.c
187         @echo "$(CC) -DMACRO_PREDEF routers/iplookup.c"
188         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/iplookup.c
189 macro-manualroute.o :   routers/manualroute.c
190         @echo "$(CC) -DMACRO_PREDEF routers/manualroute.c"
191         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/manualroute.c
192 macro-queryprogram.o :  routers/queryprogram.c
193         @echo "$(CC) -DMACRO_PREDEF routers/queryprogram.c"
194         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/queryprogram.c
195 macro-redirect.o :      routers/redirect.c
196         @echo "$(CC) -DMACRO_PREDEF routers/redirect.c"
197         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ routers/redirect.c
198 macro-auth-spa.o :      auths/auth-spa.c
199         @echo "$(CC) -DMACRO_PREDEF auths/auth-spa.c"
200         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/auth-spa.c
201 macro-cram_md5.o :      auths/cram_md5.c
202         @echo "$(CC) -DMACRO_PREDEF auths/cram_md5.c"
203         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cram_md5.c
204 macro-cyrus_sasl.o :    auths/cyrus_sasl.c
205         @echo "$(CC) -DMACRO_PREDEF auths/cyrus_sasl.c"
206         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/cyrus_sasl.c
207 macro-dovecot.o:        auths/dovecot.c
208         @echo "$(CC) -DMACRO_PREDEF auths/dovecot.c"
209         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/dovecot.c
210 macro-gsasl_exim.o :    auths/gsasl_exim.c
211         @echo "$(CC) -DMACRO_PREDEF auths/gsasl_exim.c"
212         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/gsasl_exim.c
213 macro-heimdal_gssapi.o: auths/heimdal_gssapi.c
214         @echo "$(CC) -DMACRO_PREDEF auths/heimdal_gssapi.c"
215         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/heimdal_gssapi.c
216 macro-plaintext.o :     auths/plaintext.c
217         @echo "$(CC) -DMACRO_PREDEF auths/plaintext.c"
218         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/plaintext.c
219 macro-spa.o :           auths/spa.c
220         @echo "$(CC) -DMACRO_PREDEF auths/spa.c"
221         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/spa.c
222 macro-tls.o:            auths/tls.c
223         @echo "$(CC) -DMACRO_PREDEF auths/tls.c"
224         $(FE)$(CC) -c $(CFLAGS) -DMACRO_PREDEF $(INCLUDE) -o $@ auths/tls.c
225
226 macro_predef: $(OBJ_MACRO)
227         @echo "$(LNCC) -o $@"
228         $(FE)$(LNCC) -o $@ $(LFLAGS) $(OBJ_MACRO)
229
230 macro.c: macro_predef
231         ./macro_predef > macro.c
232
233 # This target is recognized specially by GNU make. It records those targets
234 # that do not correspond to files that are being built and which should
235 # therefore always be run, even if the files exist. This shouldn't in fact be a
236 # problem, but it does no harm. Other make programs will just ignore this.
237
238 .PHONY: all config utils \
239         buildauths buildlookups buildpdkim buildrouters \
240         buildtransports checklocalmake clean
241
242
243 utils: $(EXIM_MONITOR) exicyclog exinext exiwhat \
244         exigrep eximstats exipick exiqgrep exiqsumm \
245         transport-filter.pl convert4r3 convert4r4 \
246         exim_checkaccess \
247         exim_dbmbuild exim_dumpdb exim_fixdb exim_tidydb exim_lock
248
249
250 # Targets for special-purpose configuration header builders
251 buildconfig: buildconfig.c
252         @echo "$(CC) buildconfig.c"
253         $(FE)$(CC) $(CFLAGS) $(INCLUDE) -o buildconfig buildconfig.c $(LIBS)
254
255
256 # Target for the exicyclog utility script
257 exicyclog: config ../src/exicyclog.src
258         @rm -f exicyclog
259         @sed \
260           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
261           -e "/^# /p" \
262           -e "/^# /d" \
263           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
264           -e "s?CONFIGURE_FILE_USE_EUID?$(CONFIGURE_FILE_USE_EUID)?" \
265           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
266           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
267           -e "s?EXICYCLOG_MAX?$(EXICYCLOG_MAX)?" \
268           -e "s?COMPRESS_COMMAND?$(COMPRESS_COMMAND)?" \
269           -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
270           -e "s?CHGRP_COMMAND?$(CHGRP_COMMAND)?" \
271           -e "s?CHMOD_COMMAND?$(CHMOD_COMMAND)?" \
272           -e "s?CHOWN_COMMAND?$(CHOWN_COMMAND)?" \
273           -e "s?MV_COMMAND?$(MV_COMMAND)?" \
274           -e "s?RM_COMMAND?$(RM_COMMAND)?" \
275           -e "s?TOUCH_COMMAND?$(TOUCH_COMMAND)?" \
276           ../src/exicyclog.src > exicyclog-t
277         @mv exicyclog-t exicyclog
278         @chmod a+x exicyclog
279         @echo ">>> exicyclog script built"
280
281 # Target for the exinext utility script
282 exinext: config ../src/exinext.src
283         @rm -f exinext
284         @sed \
285           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
286           -e "/^# /p" \
287           -e "/^# /d" \
288           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
289           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
290           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
291           ../src/exinext.src > exinext-t
292         @mv exinext-t exinext
293         @chmod a+x exinext
294         @echo ">>> exinext script built"
295
296 # Target for the exiwhat utility script
297 exiwhat: config ../src/exiwhat.src
298         @rm -f exiwhat
299         @sed \
300           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
301           -e "/^# /p" \
302           -e "/^# /d" \
303           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
304           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
305           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
306           -e "s?EXIWHAT_PS_CMD?$(EXIWHAT_PS_CMD)?" \
307           -e "s?EXIWHAT_PS_ARG?$(EXIWHAT_PS_ARG)?" \
308           -e "s?EXIWHAT_KILL_SIGNAL?$(EXIWHAT_KILL_SIGNAL)?" \
309           -e "s?EXIWHAT_EGREP_ARG?$(EXIWHAT_EGREP_ARG)?" \
310           -e "s?EXIWHAT_MULTIKILL_CMD?$(EXIWHAT_MULTIKILL_CMD)?" \
311           -e "s?EXIWHAT_MULTIKILL_ARG?$(EXIWHAT_MULTIKILL_ARG)?" \
312           ../src/exiwhat.src > exiwhat-t
313         @mv exiwhat-t exiwhat
314         @chmod a+x exiwhat
315         @echo ">>> exiwhat script built"
316
317 # Target for the exim_checkaccess utility script
318 exim_checkaccess: config ../src/exim_checkaccess.src
319         @rm -f exim_checkaccess
320         @sed \
321           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
322           -e "/^# /p" \
323           -e "/^# /d" \
324           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
325           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
326           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
327           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
328           ../src/exim_checkaccess.src > exim_checkaccess-t
329         @mv exim_checkaccess-t exim_checkaccess
330         @chmod a+x exim_checkaccess
331         @echo ">>> exim_checkaccess script built"; echo ""
332
333 # Target for the Exim monitor start-up script
334 eximon: config ../src/eximon.src ../OS/eximon.conf-Default \
335           ../Local/eximon.conf
336         @rm -f eximon
337         $(SHELL) $(SCRIPTS)/Configure-eximon
338         @sed \
339           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
340           -e "/^# /p" \
341           -e "/^# /d" \
342           -e "s?CONFIGURE_FILE_USE_NODE?$(CONFIGURE_FILE_USE_NODE)?" \
343           -e "s?CONFIGURE_FILE?$(CONFIGURE_FILE)?" \
344           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
345           -e "s?BASENAME_COMMAND?$(BASENAME_COMMAND)?" \
346           -e "s?HOSTNAME_COMMAND?$(HOSTNAME_COMMAND)?" \
347           -e "s?X11_LD_LIBRARY?$(X11_LD_LIB)?" \
348           ../src/eximon.src >> eximon
349         @echo ">>> eximon script built"; echo ""
350
351 # Targets for utilities; these are all Perl scripts that have to get the
352 # location of Perl put in them. A few need other things as well.
353
354 exigrep: Makefile ../src/exigrep.src
355         @rm -f exigrep
356         @sed \
357           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
358           -e "/^# /p" \
359           -e "/^# /d" \
360           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
361           -e "s?ZCAT_COMMAND?$(ZCAT_COMMAND)?" \
362           -e "s?COMPRESS_SUFFIX?$(COMPRESS_SUFFIX)?" \
363           ../src/exigrep.src > exigrep-t
364         @mv exigrep-t exigrep
365         @chmod a+x exigrep
366         @echo ">>> exigrep script built"
367
368 eximstats: Makefile ../src/eximstats.src
369         @rm -f eximstats
370         @sed \
371           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
372           ../src/eximstats.src > eximstats-t
373         @mv eximstats-t eximstats
374         @chmod a+x eximstats
375         @echo ">>> eximstats script built"
376
377 exiqgrep: Makefile ../src/exiqgrep.src
378         @rm -f exiqgrep
379         @sed \
380           -e "s?PROCESSED_FLAG?This file has been so processed.?"\
381           -e "/^# /p" \
382           -e "/^# /d" \
383           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
384           -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
385           ../src/exiqgrep.src > exiqgrep-t
386         @mv exiqgrep-t exiqgrep
387         @chmod a+x exiqgrep
388         @echo ">>> exiqgrep script built"
389
390 exiqsumm: Makefile ../src/exiqsumm.src
391         @rm -f exiqsumm
392         @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
393           ../src/exiqsumm.src > exiqsumm-t
394         @mv exiqsumm-t exiqsumm
395         @chmod a+x exiqsumm
396         @echo ">>> exiqsumm script built"
397
398 exipick: Makefile ../src/exipick.src
399         @rm -f exipick
400         @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
401           -e "s?SPOOL_DIRECTORY?$(SPOOL_DIRECTORY)?" \
402           -e "s?BIN_DIRECTORY?$(BIN_DIRECTORY)?" \
403           ../src/exipick.src > exipick-t
404         @mv exipick-t exipick
405         @chmod a+x exipick
406         @echo ">>> exipick script built"
407
408 transport-filter.pl: Makefile ../src/transport-filter.src
409         @rm -f transport-filter.pl
410         @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
411           ../src/transport-filter.src > transport-filter.pl-t
412         @mv transport-filter.pl-t transport-filter.pl
413         @chmod a+x transport-filter.pl
414         @echo ">>> transport-filter.pl script built"
415
416 convert4r3: Makefile ../src/convert4r3.src
417         @rm -f convert4r3
418         @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
419           ../src/convert4r3.src > convert4r3-t
420         @mv convert4r3-t convert4r3
421         @chmod a+x convert4r3
422         @echo ">>> convert4r3 script built"
423
424 convert4r4: Makefile ../src/convert4r4.src
425         @rm -f convert4r4
426         @sed -e "s?PERL_COMMAND?$(PERL_COMMAND)?" \
427           ../src/convert4r4.src > convert4r4-t
428         @mv convert4r4-t convert4r4
429         @chmod a+x convert4r4
430         @echo ">>> convert4r4 script built"
431
432
433 # These are objects of optional features. They are always compiled, but
434 # if the corresponding #defines are not set, they wind up empty and
435 # are thrown away by the linker.
436
437 OBJ_WITH_CONTENT_SCAN = malware.o mime.o regex.o spam.o spool_mbox.o
438 OBJ_EXPERIMENTAL = bmi_spam.o \
439                                 dane.o \
440                                 dcc.o \
441                                 dmarc.o \
442                                 imap_utf7.o \
443                                 spf.o \
444                                 srs.o \
445                                 utf8.o
446
447 # Targets for final binaries; the main one has a build number which is
448 # updated each time. We don't bother with that for the auxiliaries.
449
450 OBJ_LOOKUPS = lookups/lf_quote.o lookups/lf_check_file.o lookups/lf_sqlperform.o
451
452 OBJ_EXIM = acl.o base64.o child.o crypt16.o daemon.o dbfn.o debug.o deliver.o \
453         directory.o dns.o drtables.o enq.o exim.o expand.o filter.o \
454         filtertest.o globals.o dkim.o dkim_transport.o hash.o \
455         header.o host.o ip.o log.o lss.o match.o moan.o \
456         os.o parse.o queue.o \
457         rda.o readconf.o receive.o retry.o rewrite.o rfc2047.o \
458         route.o search.o sieve.o smtp_in.o smtp_out.o spool_in.o spool_out.o \
459         std-crypto.o store.o string.o tls.o tod.o transport.o tree.o verify.o \
460         environment.o macro.o \
461         $(OBJ_LOOKUPS) \
462         local_scan.o $(EXIM_PERL) $(OBJ_WITH_CONTENT_SCAN) \
463         $(OBJ_EXPERIMENTAL)
464
465 exim:   buildlookups buildauths pdkim/pdkim.a \
466         buildrouters buildtransports \
467         $(OBJ_EXIM) version.o
468         @echo "$(LNCC) -o exim"
469         $(FE)$(PURIFY) $(LNCC) -o exim $(LFLAGS) $(OBJ_EXIM) version.o \
470           routers/routers.a transports/transports.a lookups/lookups.a \
471           auths/auths.a pdkim/pdkim.a \
472           $(LIBRESOLV) $(LIBS) $(LIBS_EXIM) $(IPV6_LIBS) $(EXTRALIBS) \
473           $(EXTRALIBS_EXIM) $(DBMLIB) $(LOOKUP_LIBS) $(AUTH_LIBS) \
474           $(PERL_LIBS) $(TLS_LIBS) $(PCRE_LIBS) $(LDFLAGS)
475         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
476           echo $(STRIP_COMMAND) exim; \
477           $(STRIP_COMMAND) exim; \
478         fi
479         $(EXIM_CHMOD)
480         @echo " "
481         @echo ">>> exim binary built"
482         @echo " "
483
484 # The utility for dumping the contents of an exim database
485
486 OBJ_DUMPDB = exim_dumpdb.o util-os.o util-store.o
487
488 exim_dumpdb: $(OBJ_DUMPDB)
489         @echo "$(LNCC) -o exim_dumpdb"
490         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dumpdb $(LFLAGS) $(OBJ_DUMPDB) \
491           $(LIBS) $(EXTRALIBS) $(DBMLIB)
492         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
493           echo $(STRIP_COMMAND) exim_dumpdb; \
494           $(STRIP_COMMAND) exim_dumpdb; \
495         fi
496         @echo ">>> exim_dumpdb utility built"
497         @echo " "
498
499 # The utility for interrogating/fixing the contents of an exim database
500
501 OBJ_FIXDB = exim_fixdb.o util-os.o util-store.o
502
503 exim_fixdb:  $(OBJ_FIXDB) buildauths
504         @echo "$(LNCC) -o exim_fixdb"
505         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_fixdb $(LFLAGS) $(OBJ_FIXDB) \
506           auths/auths.a $(LIBS) $(EXTRALIBS) $(DBMLIB)
507         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
508           echo $(STRIP_COMMAND) exim_fixdb; \
509           $(STRIP_COMMAND) exim_fixdb; \
510         fi
511         @echo ">>> exim_fixdb utility built"
512         @echo " "
513
514 # The utility for tidying the contents of an exim database
515
516 OBJ_TIDYDB = exim_tidydb.o util-os.o util-store.o
517
518 exim_tidydb: $(OBJ_TIDYDB)
519         @echo "$(LNCC) -o exim_tidydb"
520         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_tidydb $(LFLAGS) $(OBJ_TIDYDB) \
521           $(LIBS) $(EXTRALIBS) $(DBMLIB)
522         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
523           echo $(STRIP_COMMAND) exim_tidydb; \
524           $(STRIP_COMMAND) exim_tidydb; \
525         fi
526         @echo ">>> exim_tidydb utility built"
527         @echo " "
528
529 # The utility for building dbm files
530
531 exim_dbmbuild: exim_dbmbuild.o
532         @echo "$(LNCC) -o exim_dbmbuild"
533         $(FE)$(LNCC) $(CFLAGS) $(INCLUDE) -o exim_dbmbuild $(LFLAGS) exim_dbmbuild.o \
534           $(LIBS) $(EXTRALIBS) $(DBMLIB)
535         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
536           echo $(STRIP_COMMAND) exim_dbmbuild; \
537           $(STRIP_COMMAND) exim_dbmbuild; \
538         fi
539         @echo ">>> exim_dbmbuild utility built"
540         @echo " "
541
542 # The utility for locking a mailbox while messing around with it
543
544 exim_lock: exim_lock.c os.h
545         @echo "$(CC) exim_lock.c"
546         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) exim_lock.c
547         @echo "$(LNCC) -o exim_lock"
548         $(FE)$(LNCC) -o exim_lock $(LFLAGS) exim_lock.o  \
549           $(LIBS) $(EXTRALIBS)
550         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
551           echo $(STRIP_COMMAND) exim_lock; \
552           $(STRIP_COMMAND) exim_lock; \
553         fi
554         @echo ">>> exim_lock utility built"
555         @echo " "
556
557 # The X-based Exim monitor program's binary part. There's a macro for cutting
558 # out the modified TextPop module, because some antique link editors cannot
559 # handle the fact that it is redefining things that are found later in the
560 # Xaw library.
561
562 # Object modules that are the unique Eximon modules
563
564 MONBIN = em_StripChart.o $(EXIMON_TEXTPOP) em_globals.o em_init.o \
565         em_log.o em_main.o em_menu.o em_queue.o em_strip.o \
566         em_text.o em_xs.o
567
568 # The complete modules list also includes some specially compiled versions of
569 # code from the main Exim source tree.
570
571 OBJ_MONBIN = util-spool_in.o \
572              util-store.o \
573              util-string.o \
574              util-queue.o \
575              util-tod.o \
576              tree.o \
577              $(MONBIN)
578
579 eximon.bin: $(EXIMON_EDITME) eximon $(OBJ_MONBIN) \
580             ../exim_monitor/em_version.c
581         @echo "$(CC) exim_monitor/em_version.c"
582         $(FE)$(CC) -o em_version.o -c \
583           $(CFLAGS) $(XINCLUDE) -I. ../exim_monitor/em_version.c
584         @echo "$(LNCC) -o eximon.bin"
585         $(FE)$(PURIFY) $(LNCC) -o eximon.bin em_version.o $(LFLAGS) $(XLFLAGS) \
586           $(OBJ_MONBIN) -lXaw -lXmu -lXt -lXext -lX11 $(PCRE_LIBS) \
587           $(LIBS) $(LIBS_EXIMON) $(EXTRALIBS) $(EXTRALIBS_EXIMON) -lc
588         @if [ x"$(STRIP_COMMAND)" != x"" ]; then \
589           echo $(STRIP_COMMAND) eximon.bin; \
590           $(STRIP_COMMAND) eximon.bin; \
591         fi
592         @echo ">>> exim monitor binary built"
593         @echo " "
594
595
596 # Compile step for most of the exim modules. HDRS is a list of headers
597 # which cause everything to be rebuilt. PHDRS is the same, for the use
598 # of routers, transports, and authenticators. I can't find a way of doing this
599 # in one. This list is overkill, but it doesn't really take much time to
600 # rebuild Exim on a modern computer.
601
602 HDRS  = blob.h \
603         config.h \
604         dbfunctions.h \
605         dbstuff.h \
606         exim.h \
607         functions.h \
608         globals.h \
609         hash.h \
610         local_scan.h \
611         macros.h \
612         mytypes.h \
613         sha_ver.h \
614         structs.h \
615         os.h
616 PHDRS = ../config.h \
617         ../dbfunctions.h \
618         ../dbstuff.h \
619         ../exim.h \
620         ../functions.h \
621         ../globals.h \
622         ../local_scan.h \
623         ../macros.h \
624         ../mytypes.h \
625         ../structs.h \
626         ../os.h
627
628 .SUFFIXES: .o .c
629 .c.o:;  @echo "$(CC) $*.c"
630         $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $*.c
631
632 # Update Exim's version information and build the version object.
633
634 version.h::
635         @../scripts/reversion
636
637 cnumber.h: version.h
638
639 version.o: $(HDRS) cnumber.h version.h version.c
640
641 # This is the dummy module for use by test compiles of individual modules. It
642 # contains functions such as log_write() that may be called from bits of Exim
643 # in the tested code.
644
645 dummies.o:       dummies.c
646
647 # Compile instructions for perl.o for when EXIM_PERL is set
648
649 perl.o:          $(HDRS) perl.c
650         @echo "$(PERL_CC) perl.c"
651         $(FE)$(PERL_CC) $(PERL_CCOPTS) $(CFLAGS) $(INCLUDE) -c perl.c
652
653 # Compile instructions for the database utility modules
654
655 exim_dumpdb.o:   $(HDRS) exim_dbutil.c
656         @echo "$(CC) -DEXIM_DUMPDB exim_dbutil.c"
657         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
658                                       -DCOMPILE_UTILITY \
659                                       -DEXIM_DUMPDB \
660                                       -o exim_dumpdb.o exim_dbutil.c
661
662 exim_fixdb.o:    $(HDRS) exim_dbutil.c
663         @echo "$(CC) -DEXIM_FIXDB exim_dbutil.c"
664         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
665                                       -DCOMPILE_UTILITY \
666                                       -DEXIM_FIXDB \
667                                       -o exim_fixdb.o exim_dbutil.c
668
669 exim_tidydb.o:   $(HDRS) exim_dbutil.c
670         @echo "$(CC) -DEXIM_TIDYDB exim_dbutil.c"
671         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
672                                       -DCOMPILE_UTILITY \
673                                       -DEXIM_TIDYDB \
674                                       -o exim_tidydb.o exim_dbutil.c
675
676 # Compile instructions for exim_dbmbuild
677
678 exim_dbmbuild.o: $(HDRS) exim_dbmbuild.c
679         @echo "$(CC) exim_dbmbuild.c"
680         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY \
681                 -o exim_dbmbuild.o exim_dbmbuild.c
682
683 # Utilities use special versions of some modules - typically with debugging
684 # calls cut out.
685
686 util-spool_in.o: $(HDRS) spool_in.c
687         @echo "$(CC) -DCOMPILE_UTILITY spool_in.c"
688         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-spool_in.o spool_in.c
689
690 util-store.o:    $(HDRS) store.c
691         @echo "$(CC) -DCOMPILE_UTILITY store.c"
692         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-store.o store.c
693
694 util-string.o:   $(HDRS) string.c
695         @echo "$(CC) -DCOMPILE_UTILITY string.c"
696         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-string.o string.c
697
698 util-queue.o:   $(HDRS) queue.c
699         @echo "$(CC) -DCOMPILE_UTILITY queue.c"
700         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-queue.o queue.c
701
702 util-tod.o:   $(HDRS) tod.c
703         @echo "$(CC) -DCOMPILE_UTILITY tod.c"
704         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY -o util-tod.o tod.c
705
706 util-os.o:       $(HDRS) os.c
707         @echo "$(CC) -DCOMPILE_UTILITY os.c"
708         $(FE)$(CC) -c $(CFLAGS) $(INCLUDE) \
709                                       -DCOMPILE_UTILITY \
710                                       -DOS_LOAD_AVERAGE \
711                                       -DFIND_RUNNING_INTERFACES \
712                                       -o util-os.o os.c
713
714 # The local scan module depends only on its own special header, and is compiled
715 # from a source whose location is set by configuration.
716
717 local_scan.o:    config local_scan.h ../$(LOCAL_SCAN_SOURCE)
718         @echo "$(CC) local_scan.c"
719         $(FE)$(CC) -c $(CFLAGS) -I. $(INCLUDE) -o local_scan.o ../$(LOCAL_SCAN_SOURCE)
720
721 # Dependencies for the "ordinary" exim modules
722
723 acl.o:           $(HDRS) acl.c
724 base64.o:        $(HDRS) mime.h base64.c
725 child.o:         $(HDRS) child.c
726 crypt16.o:       $(HDRS) crypt16.c
727 daemon.o:        $(HDRS) daemon.c
728 dbfn.o:          $(HDRS) dbfn.c
729 debug.o:         $(HDRS) debug.c
730 deliver.o:       $(HDRS) transports/smtp.h deliver.c
731 directory.o:     $(HDRS) directory.c
732 dns.o:           $(HDRS) dns.c
733 enq.o:           $(HDRS) enq.c
734 exim.o:          $(HDRS) exim.c
735 expand.o:        $(HDRS) expand.c
736 environment.o:   $(HDRS) environment.c
737 filter.o:        $(HDRS) filter.c
738 filtertest.o:    $(HDRS) filtertest.c
739 globals.o:       $(HDRS) globals.c
740 hash.o:          $(HDRS) hash.c
741 header.o:        $(HDRS) header.c
742 host.o:          $(HDRS) host.c
743 ip.o:            $(HDRS) ip.c
744 log.o:           $(HDRS) log.c
745 lss.o:           $(HDRS) lss.c
746 match.o:         $(HDRS) match.c
747 moan.o:          $(HDRS) moan.c
748 os.o:            $(HDRS) $(OS_C_INCLUDES) os.c
749 parse.o:         $(HDRS) parse.c
750 queue.o:         $(HDRS) queue.c
751 rda.o:           $(HDRS) rda.c
752 readconf.o:      $(HDRS) readconf.c
753 receive.o:       $(HDRS) receive.c
754 retry.o:         $(HDRS) retry.c
755 rewrite.o:       $(HDRS) rewrite.c
756 rfc2047.o:       $(HDRS) rfc2047.c
757 route.o:         $(HDRS) route.c
758 search.o:        $(HDRS) search.c
759 sieve.o:         $(HDRS) sieve.c
760 smtp_in.o:       $(HDRS) smtp_in.c
761 smtp_out.o:      $(HDRS) smtp_out.c
762 spool_in.o:      $(HDRS) spool_in.c
763 spool_out.o:     $(HDRS) spool_out.c
764 std-crypto.o:    $(HDRS) std-crypto.c
765 store.o:         $(HDRS) store.c
766 string.o:        $(HDRS) string.c
767 tls.o:           $(HDRS) tls.c \
768                  tls-gnu.c tlscert-gnu.c \
769                  tls-openssl.c tlscert-openssl.c
770 tod.o:           $(HDRS) tod.c
771 transport.o:     $(HDRS) transport.c
772 tree.o:          $(HDRS) tree.c
773 verify.o:        $(HDRS) transports/smtp.h verify.c
774 dkim.o:          $(HDRS) pdkim/pdkim.h dkim.c
775 dkim_transport.o: $(HDRS) dkim_transport.c
776
777 # Dependencies for WITH_CONTENT_SCAN modules
778
779 malware.o:       $(HDRS) malware.c
780 mime.o:          $(HDRS) mime.h mime.c
781 regex.o:         $(HDRS) regex.c
782 spam.o:          $(HDRS) spam.c
783 spool_mbox.o:    $(HDRS) spool_mbox.c
784
785
786 # Dependencies for EXPERIMENTAL_* modules
787
788 bmi_spam.o:     $(HDRS) bmi_spam.c
789 dane.o:         $(HDRS) dane.c dane-gnu.c dane-openssl.c
790 dcc.o:          $(HDRS) dcc.h dcc.c
791 dmarc.o:        $(HDRS) pdkim/pdkim.h dmarc.h dmarc.c
792 imap_utf7.o:    $(HDRS) imap_utf7.c
793 spf.o:          $(HDRS) spf.h spf.c
794 srs.o:          $(HDRS) srs.h srs.c
795 utf8.o:         $(HDRS) utf8.c
796
797 # The module containing tables of available lookups, routers, auths, and
798 # transports must be rebuilt if any of them are. However, because the makefiles
799 # for the drivers are always run, we don't actually put the dependencies here,
800 # because if we do, some version of "make" (e.g. IRIX) insist on rebuilding
801 # drtables.o even though the .a files haven't in fact been updated. Instead
802 # it is arranged that the lower-level makefiles remove drtables.o when they
803 # rebuild the .a files.
804
805 drtables.o:      $(HDRS) drtables.c
806
807 # We depend upon object files built as part of building the lookups library
808 # When using parallel make, we don't have the dependency to force building
809 # in the sub-directory unless we force that dependency:
810
811 $(OBJ_LOOKUPS):  buildlookups
812
813 # The exim monitor's private modules - the sources live in a private
814 # subdirectory. The final binary combines the private modules with some
815 # modules from the main exim binary.
816
817 em_StripChart.o: ../exim_monitor/em_StripChart.c
818 em_TextPop.o:    ../exim_monitor/em_TextPop.c
819 em_globals.o:    ../exim_monitor/em_globals.c ../exim_monitor/em_hdr.h
820 em_init.o:       ../exim_monitor/em_init.c    ../exim_monitor/em_hdr.h
821 em_log.o:        ../exim_monitor/em_log.c     ../exim_monitor/em_hdr.h
822 em_main.o:       ../exim_monitor/em_main.c    ../exim_monitor/em_hdr.h
823 em_menu.o:       ../exim_monitor/em_menu.c    ../exim_monitor/em_hdr.h
824 em_queue.o:      ../exim_monitor/em_queue.c   ../exim_monitor/em_hdr.h
825 em_strip.o:      ../exim_monitor/em_strip.c   ../exim_monitor/em_hdr.h
826 em_text.o:       ../exim_monitor/em_text.c    ../exim_monitor/em_hdr.h
827 em_xs.o:         ../exim_monitor/em_xs.c      ../exim_monitor/em_hdr.h
828 em_version.o:    ../exim_monitor/em_version.c ../exim_monitor/em_hdr.h
829 $(MONBIN): $(HDRS)
830                  @echo "$(CC) exim_monitor/`echo $@ | sed 's/o$$/c/'`"
831                  $(FE)$(CC) -o $@ -c $(CFLAGS) -I. -I../exim_monitor $(INCLUDE) $(XINCLUDE) \
832                    ../exim_monitor/`echo $@ | sed 's/o$$/c/'`
833
834
835 # Targets for the various libraries that Exim uses.
836
837 # The lookups library.
838
839 buildlookups: config
840          @cd lookups && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
841            CFLAGS_DYNAMIC="$(CFLAGS_DYNAMIC)" HDRS="../version.h $(PHDRS)" \
842            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" \
843            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE) $(LOOKUP_INCLUDE)"
844          @echo " "
845
846 # The routers library.
847
848 buildrouters: config
849          @cd routers && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
850            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
851            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
852          @echo " "
853
854 # The transports library.
855
856 buildtransports: config
857          @cd transports && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
858            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
859            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
860          @echo " "
861
862 # The library of authorization modules
863
864 buildauths: config
865          @cd auths && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
866            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
867            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
868          @echo " "
869
870 # The PDKIM library
871
872 buildpdkim: pdkim/pdkim.a
873 pdkim/pdkim.a: config
874          @cd pdkim && $(MAKE) SHELL=$(SHELL) AR="$(AR)" $(MFLAGS) CC="$(CC)" CFLAGS="$(CFLAGS)" \
875            FE="$(FE)" RANLIB="$(RANLIB)" RM_COMMAND="$(RM_COMMAND)" HDRS="$(PHDRS)" \
876            INCLUDE="$(INCLUDE) $(IPV6_INCLUDE) $(TLS_INCLUDE)"
877          @echo " "
878
879 # The "clean", "install", and "makefile" targets just pass themselves back to
880 # the main Exim makefile. These targets will be obeyed only if "make" is obeyed
881 # for them in the build directory.
882
883 clean install makefile:; cd ..; $(MAKE) $(MFLAGS) build=$(build) $@
884
885 # Targets for building stand-alone testing programs for basic testing of
886 # some of the building blocks. These are not integrated with the makefile-
887 # building targets. If you change something that is going to cause the
888 # makefile to be rebuilt, you must run "make makefile" before running one
889 # of these.
890
891 # The testing programs use different versions of some modules - usually
892 # with bits cut out that are not relevant to the test in hand. For those
893 # that are used by several tests, we use a different name.
894
895 sa-globals.o:    $(HDRS) globals.c
896         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -o sa-globals.o globals.c
897
898 sa-os.o:         $(HDRS) os.c
899         $(CC) -c $(CFLAGS) $(INCLUDE) \
900                                       -DFIND_RUNNING_INTERFACES \
901                                       -o sa-os.o os.c
902
903 # These are the test targets themselves
904
905 test_dbfn:   config.h dbfn.c dummies.o sa-globals.o sa-os.o store.o \
906                string.o tod.o version.o utf8.o
907         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE dbfn.c
908         $(CC) -c $(CFLAGS) $(INCLUDE) -DCOMPILE_UTILITY store.c
909         $(LNCC) -o test_dbfn $(LFLAGS) dbfn.o \
910           dummies.o sa-globals.o sa-os.o store.o string.o \
911           tod.o version.o utf8.o $(LIBS) $(DBMLIB) $(LDFLAGS)
912         rm -f dbfn.o store.o
913
914 test_host:   config.h child.c host.c dns.c dummies.c sa-globals.o os.o \
915                store.o string.o tod.o tree.o
916         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST child.c
917         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST host.c
918         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dns.c
919         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE -DTEST_HOST dummies.c
920         $(LNCC) -o test_host $(LFLAGS) \
921           host.o child.o dns.o dummies.o sa-globals.o os.o store.o string.o \
922           tod.o tree.o $(LIBS) $(LIBRESOLV)
923         rm -f child.o dummies.o host.o dns.o
924
925 test_os:     os.h os.c dummies.o sa-globals.o store.o string.o tod.o utf8.o
926         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE os.c
927         $(LNCC) -o test_os $(LFLAGS) os.o dummies.o \
928           sa-globals.o store.o string.o tod.o utf8.o $(LIBS) $(LDFLAGS)
929         rm -f os.o
930
931 test_parse:  config.h parse.c dummies.o sa-globals.o \
932              store.o string.o tod.o version.o utf8.o
933         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE parse.c
934         $(LNCC) -o test_parse $(LFLAGS) parse.o \
935           dummies.o sa-globals.o store.o string.o tod.o version.o \
936           utf8.o $(LDFLAGS)
937         rm -f parse.o
938
939 test_string: config.h string.c dummies.o sa-globals.o store.o tod.o utf8.o
940         $(CC) -c $(CFLAGS) $(INCLUDE) -DSTAND_ALONE string.c
941         $(LNCC) -o test_string $(LFLAGS) -DSTAND_ALONE string.o \
942           dummies.o sa-globals.o store.o tod.o utf8.o $(LIBS) $(LDFLAGS)
943         rm -f string.o
944
945 # End