2010-04-01 07:12:01 +02:00
|
|
|
# We want the all target to be the implicit target (if no target is
|
|
|
|
# given explicitly on the command line) so mention it first.
|
|
|
|
all:
|
2009-12-01 17:34:09 +01:00
|
|
|
|
2010-04-12 01:44:52 +02:00
|
|
|
# Sub-directory Makefile.local fragments can append to these variables
|
|
|
|
# to have directory-specific cflags as necessary.
|
|
|
|
|
|
|
|
extra_cflags :=
|
|
|
|
extra_cxxflags :=
|
|
|
|
|
2010-04-14 20:32:26 +02:00
|
|
|
# Get settings from the output of configure by running it to generate
|
2011-03-10 20:29:13 +01:00
|
|
|
# Makefile.config if it doesn't exist yet.
|
|
|
|
|
|
|
|
# If Makefile.config doesn't exist, then srcdir won't be
|
|
|
|
# set. Conditionally set it (assuming a plain srcdir build) so that
|
|
|
|
# the rule to generate Makefile.config can actually work.
|
|
|
|
srcdir ?= .
|
|
|
|
|
2010-04-14 20:32:26 +02:00
|
|
|
include Makefile.config
|
2014-03-25 12:28:09 +01:00
|
|
|
|
|
|
|
# We make all targets depend on the Makefiles themselves.
|
|
|
|
global_deps = Makefile Makefile.config Makefile.local \
|
|
|
|
$(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
|
|
|
|
|
2017-01-16 19:04:48 +01:00
|
|
|
INCLUDE_MORE := yes
|
|
|
|
ifneq ($(filter clean distclean dataclean, $(word 1, $(MAKECMDGOALS))),)
|
|
|
|
CLEAN_GOAL := $(word 1, $(MAKECMDGOALS))
|
|
|
|
|
|
|
|
# If there are more goals following CLEAN_GOAL, run $(MAKE)s in parts.
|
|
|
|
ifneq ($(word 2, $(MAKECMDGOALS)),)
|
|
|
|
INCLUDE_MORE := no
|
|
|
|
FOLLOWING_GOALS := $(wordlist 2, 99, $(MAKECMDGOALS))
|
|
|
|
|
|
|
|
.PHONY: $(FOLLOWING_GOALS) make_in_parts
|
|
|
|
$(FOLLOWING_GOALS):
|
|
|
|
@true
|
|
|
|
$(CLEAN_GOAL): make_in_parts
|
|
|
|
make_in_parts:
|
|
|
|
$(MAKE) $(CLEAN_GOAL)
|
|
|
|
$(MAKE) $(FOLLOWING_GOALS) configure_options="$(configure_options)"
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
CLEAN_GOAL :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Potentially speedup make clean, distclean and dataclean ; avoid
|
|
|
|
# re-creating Makefile.config if it exists but configure is newer.
|
|
|
|
ifneq ($(CLEAN_GOAL),)
|
|
|
|
Makefile.config: | $(srcdir)/configure
|
|
|
|
else
|
2011-03-10 00:02:42 +01:00
|
|
|
Makefile.config: $(srcdir)/configure
|
2017-01-16 19:04:48 +01:00
|
|
|
endif
|
2011-03-10 20:30:06 +01:00
|
|
|
ifeq ($(configure_options),)
|
2010-04-14 20:32:26 +02:00
|
|
|
@echo ""
|
|
|
|
@echo "Note: Calling ./configure with no command-line arguments. This is often fine,"
|
|
|
|
@echo " but if you want to specify any arguments (such as an alternate prefix"
|
|
|
|
@echo " into which to install), call ./configure explicitly and then make again."
|
|
|
|
@echo " See \"./configure --help\" for more details."
|
|
|
|
@echo ""
|
2011-03-10 20:30:06 +01:00
|
|
|
endif
|
|
|
|
$(srcdir)/configure $(configure_options)
|
2010-04-14 20:32:26 +02:00
|
|
|
|
2017-01-16 19:04:48 +01:00
|
|
|
ifeq ($(INCLUDE_MORE),yes)
|
2016-11-19 18:44:28 +01:00
|
|
|
# runtime variable definitions available in all subdirs
|
|
|
|
include $(srcdir)/Makefile.global
|
2010-04-01 07:12:01 +02:00
|
|
|
# Finally, include all of the Makefile.local fragments where all the
|
|
|
|
# real work is done.
|
2010-04-12 01:44:52 +02:00
|
|
|
|
|
|
|
include $(subdirs:%=%/Makefile.local) Makefile.local
|
2017-01-16 19:04:48 +01:00
|
|
|
endif
|