]> git.notmuchmail.org Git - notmuch/blob - Makefile
status: add print_status_gzbytes
[notmuch] / Makefile
1 # We want the all target to be the implicit target (if no target is
2 # given explicitly on the command line) so mention it first.
3 all:
4
5 # Sub-directory Makefile.local fragments can append to these variables
6 # to have directory-specific cflags as necessary.
7
8 extra_cflags :=
9 extra_cxxflags :=
10
11 # Get settings from the output of configure by running it to generate
12 # Makefile.config if it doesn't exist yet.
13
14 # If Makefile.config doesn't exist, then srcdir won't be
15 # set. Conditionally set it (assuming a plain srcdir build) so that
16 # the rule to generate Makefile.config can actually work.
17 srcdir ?= .
18
19 include Makefile.config
20
21 # We make all targets depend on the Makefiles themselves.
22 global_deps = Makefile Makefile.config Makefile.local \
23         $(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
24
25 INCLUDE_MORE := yes
26 ifneq ($(filter clean distclean dataclean, $(word 1, $(MAKECMDGOALS))),)
27 CLEAN_GOAL := $(word 1, $(MAKECMDGOALS))
28
29 # If there are more goals following CLEAN_GOAL, run $(MAKE)s in parts.
30 ifneq ($(word 2, $(MAKECMDGOALS)),)
31 INCLUDE_MORE := no
32 FOLLOWING_GOALS := $(wordlist 2, 99, $(MAKECMDGOALS))
33
34 .PHONY: $(FOLLOWING_GOALS) make_in_parts
35 $(FOLLOWING_GOALS):
36         @true
37 $(CLEAN_GOAL): make_in_parts
38 make_in_parts:
39         $(MAKE) $(CLEAN_GOAL)
40         $(MAKE) $(FOLLOWING_GOALS) configure_options="$(configure_options)"
41 endif
42
43 else
44 CLEAN_GOAL :=
45 endif
46
47 # Potentially speedup make clean, distclean and dataclean ; avoid
48 # re-creating Makefile.config if it exists but configure is newer.
49 ifneq ($(CLEAN_GOAL),)
50 Makefile.config: | $(srcdir)/configure
51 else
52 Makefile.config: $(srcdir)/configure
53 endif
54 ifeq ($(configure_options),)
55         @echo ""
56         @echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
57         @echo "      but if you want to specify any arguments (such as an alternate prefix"
58         @echo "      into which to install), call ./configure explicitly and then make again."
59         @echo "      See \"./configure --help\" for more details."
60         @echo ""
61 endif
62         $(srcdir)/configure $(configure_options)
63
64 ifeq ($(INCLUDE_MORE),yes)
65 # runtime variable definitions available in all subdirs
66 include $(srcdir)/Makefile.global
67 # Finally, include all of the Makefile.local fragments where all the
68 # real work is done.
69
70 include $(subdirs:%=%/Makefile.local) Makefile.local
71 endif