Merge branch 'maint'
[platform/upstream/automake.git] / GNUmakefile
1 # Maintainer makefile for Automake.  Requires GNU make.
2
3 # Copyright (C) 2012 Free Software Foundation, Inc.
4 #
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18 ifeq ($(wildcard Makefile),)
19   ifeq ($(filter bootstrap,$(MAKECMDGOALS)),bootstrap)
20     # Allow the user (or more likely the developer) to ask for a bootstrap
21     # of the package; of course, this can happen before configure is run,
22     # and in fact even before it is created.
23   else
24     # Else, If the user runs GNU make but has not yet run ./configure,
25     # give them an helpful diagnostic instead of a cryptic error.
26     $(warning There seems to be no Makefile in this directory.)
27     $(warning You must run ./configure before running 'make'.)
28     $(error Fatal Error)
29   endif
30 else
31   include ./Makefile
32   include $(srcdir)/syntax-checks.mk
33 endif
34
35 # To allow bootstrapping also in an unconfigured tree.
36 srcdir ?= .
37 am__cd ?= CDPATH=. && unset CDPATH && cd
38 AM_DEFAULT_VERBOSITY ?= 0
39 V ?= $(AM_DEFAULT_VERBOSITY)
40
41 ifeq ($(V),0)
42   AM_V_BOOTSTRAP = @echo "  BOOTSTRAP";
43   AM_V_CONFIGURE = @echo "  CONFIGURE";
44   AM_V_REMAKE    = @echo "  REMAKE";
45 else
46   AM_V_BOOTSTRAP =
47   AM_V_CONFIGURE =
48   AM_V_REMAKE    =
49 endif
50
51 # Must be phony, not to be confused with the 'bootstrap' script.
52 .PHONY: bootstrap
53 bootstrap:
54         $(AM_V_BOOTSTRAP)$(am__cd) $(srcdir) && ./bootstrap.sh
55         $(AM_V_CONFIGURE)set -e; \
56         am__bootstrap_configure () { \
57           $(srcdir)/configure $${1+"$$@"} $(BOOTSTRAP_CONFIGURE_FLAGS); \
58         }; \
59         if test -f $(srcdir)/config.status; then \
60           : config.status should return a string properly quoted for eval; \
61           old_configure_flags=`$(srcdir)/config.status --config`; \
62         else \
63           old_configure_flags=""; \
64         fi; \
65         eval am__bootstrap_configure "$$old_configure_flags"
66         # The "make check" below is to ensure all the testsuite-required
67         # files are rebuilt.
68         $(AM_V_REMAKE)$(MAKE) clean && $(MAKE) check TESTS=t/get-sysconf