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-01 07:12:01 +02:00
|
|
|
# List all subdirectories here. Each contains its own Makefile.local
|
2012-10-30 21:32:33 +01:00
|
|
|
subdirs = compat completion emacs lib man parse-time-string util test
|
2010-03-10 19:59:57 +01:00
|
|
|
|
2010-04-01 07:12:01 +02:00
|
|
|
# We make all targets depend on the Makefiles themselves.
|
2010-04-14 20:32:26 +02:00
|
|
|
global_deps = Makefile Makefile.config Makefile.local \
|
2010-03-10 19:59:57 +01:00
|
|
|
$(subdirs:%=%/Makefile) $(subdirs:%=%/Makefile.local)
|
2009-11-17 22:05:16 +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
|
2011-03-10 00:02:42 +01:00
|
|
|
Makefile.config: $(srcdir)/configure
|
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
|
|
|
|
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
|