Debian Codegraph @

Makefile

raw symbols SCIP
1 # Top-level makefile for Exim; handles creating a build directory with
2 # appropriate links, and then creating and running the main makefile in that
3 # directory.
4
5 # Copyright (c) The Exim Maintainers 2022 - 2026
6 # Copyright (c) University of Cambridge, 1995 - 2018
7 # SPDX-License-Identifier: GPL-2.0-or-later
8 # See the file NOTICE for conditions of use and distribution.
9
10 # IRIX make uses the shell that is in the SHELL variable, which often defaults
11 # to csh, so put this in to make it use the Bourne shell. In systems where
12 # /bin/sh is not a Bourne-compatible shell, this line will have to be edited,
13 # or "make" must be called with a different SHELL= setting.
14
15 SHELL=/bin/sh
16 RM_COMMAND=/bin/rm
17
18 # The buildname defaults to "<os-type>-<arch-type>". It can be
19 # overridden by the "build" parameter when invoking make (e.g. make
20 # build=xxx) This does not provide an override for the OS type and
21 # architecture type used during the build process; they still have to be
22 # used for the OS-specific files. To override them, you can set the
23 # shell variables OSTYPE and ARCHTYPE when running make.
24 #
25 # EXIM_BUILD_SUFFIX gets appended to the buildname. (This enables
26 # parallel builds on a file system shared among different Linux distros
27 # (same os-type, same arch-type). The ../test/runtest script honours the
28 # EXIM_BUILD_SUFFIX when searching the Exim binary.)
29
30 buildname=$${build:-`$(SHELL) scripts/os-type`-`$(SHELL) scripts/arch-type`}$${EXIM_BUILD_SUFFIX:+.$$EXIM_BUILD_SUFFIX}
31
32 # Quieten gnumake wrt. sub-make directories
33 GNUMAKEFLAGS=--no-print-directory
34
35 # The default target checks for the existence of Local/Makefile, that the main
36 # makefile is built and up-to-date, and then it runs it.
37 # If Local/Makefile-<buildname> exists, it is read too.
38
39 all: Local/Makefile configure
40 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS)
41
42 # This pair for the convenience of of the Debian maintainers
43 exim utils: Local/Makefile configure
44 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) $@
45
46 # For testsuite builds
47 exim_openssl exim_gnutls: Local/Makefile configure
48 @cd build-$(buildname); $(MAKE) SHELL=$(SHELL) $(MFLAGS) $@
49
50 Local/Makefile:
51 @echo ""
52 @echo "*** Please create Local/Makefile by copying src/EDITME and making"
53 @echo "*** appropriate changes for your site."
54 @echo ""
55 @test ! -d Local && mkdir Local
56 @false
57
58 # This is separated off so that "make build-directory" can be obeyed on
59 # its own if necessary.
60 # XXX would be nice to get this rebuilt if scripts/MakeLinks changes
61
62 build-directory:
63 @builddir=build-$(buildname); \
64 case "$$builddir" in *UnKnown*) exit 1;; esac; \
65 $(SHELL) -c "test -d $$builddir -a -r $$builddir/version.c || \
66 (mkdir $$builddir; cd $$builddir; $(SHELL) ../scripts/MakeLinks)";
67
68 checks:
69 @$(SHELL) scripts/source_checks
70
71 # The "configure" target ensures that the build directory exists, then arranges
72 # to build the main makefile from inside the build directory, by calling the
73 # Configure-Makefile script. This does its own dependency checking because of
74 # the optional files.
75 # We always run the script (as there is no actual"configure" file)
76 # but it quietly dooes nothing if nothing is needed.
77
78 configure: checks build-directory \
79 scripts/lookups-Makefile scripts/drivers-Makefile
80 @cd build-$(buildname); \
81 build=$(build) $(SHELL) ../scripts/Configure-Makefile
82
83 # The "makefile" target forces a rebuild of the makefile (as opposed to
84 # "configure", which doesn't force it).
85
86 makefile: build-directory
87 @cd build-$(buildname); $(RM_COMMAND) -f Makefile; \
88 build=$(build) $(SHELL) ../scripts/Configure-Makefile
89
90 # The installation commands are kept in a separate script, which expects
91 # to be run from inside the build directory.
92
93 install: all
94 @cd build-$(buildname); \
95 build=$(build) $(SHELL) ../scripts/exim_install $(INSTALL_ARG)
96
97 # For testing only; the version number is a dummy.
98 # The build for release is done by the release-process script "mk_exim_release"
99
100 doc: FRC
101 cd ../doc/doc-docbook; $(MAKE) EXIM_VER=0 everything
102
103 # Tidy-up targets
104
105 clean_exim:; cd build-$(buildname); \
106 $(RM_COMMAND) -f *.o; \
107 for d in lookups auths routers transports miscmods; do \
108 $(RM_COMMAND) -f $$d/*.{o,a,so}; \
109 done; \
110 $(RM_COMMAND) -fr dynmodules
111
112 clean_doc: FRC
113 cd ../doc/doc-docbook; \
114 $(RM_COMMAND) -f {filter,spec}*.{pdf,ps,txt,html,xml}
115
116 clean: clean_exim clean_doc
117 @echo ""; echo '*** "make clean" just removes all .o and .a files'
118 @echo '*** Use "make makefile" to force a rebuild of the makefile'
119 @echo ""
120
121 distclean: clean_doc
122 $(RM_COMMAND) -rf build-* cscope*
123
124 cscope.files: FRC
125 echo "-q" > $@
126 echo "-p3" >> $@
127 -bd=build-$(buildname); [ -d $$bd ] && echo -e "$$bd/config.h\n$$bd/version.h\n$$bd/Makefile" >> $@
128 find src Local OS exim_monitor -name "*.[cshyl]" -print \
129 -o -name "*.src" -print \
130 -o -name "os.[ch]*" -print \
131 -o -name "*akefile*" -print \
132 -o -name config.h.defaults -print \
133 -o -name EDITME -print >> $@
134 echo scripts/* >> $@
135
136 cscope: cscope.files
137 cscope -b -p 3
138
139 FRC:
140
141 # End of top-level makefile