* doc/autoconf.texi (Making testsuite Scripts): Document
[autoconf.git] / GNUmakefile
blob841a9180f1df6bff14471df17157f90d046bade2
1 # Having a separate GNUmakefile lets me `include' the dynamically
2 # generated rules created via Makefile.maint as well as Makefile.maint itself.
3 # This makefile is used only if you run GNU Make.
4 # It is necessary if you want to build targets usually of interest
5 # only to the maintainer.
7 # Copyright (C) 2001, 2003, 2006-2007 Free Software Foundation, Inc.
9 # This program is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 # Systems where /bin/sh is not the default shell need this. The $(shell)
23 # command below won't work with e.g. stock DOS/Windows shells.
24 ifeq ($(wildcard /bin/s[h]),/bin/sh)
25 SHELL = /bin/sh
26 else
27 # will be used only with the next shell-test line, then overwritten
28 # by a configured-in value
29 SHELL = sh
30 endif
32 have-Makefile := $(shell test -f Makefile && echo yes)
34 # If the user runs GNU make but has not yet run ./configure,
35 # give them a diagnostic.
36 ifeq ($(have-Makefile),yes)
38 # Make tar archive easier to reproduce.
39 export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
41 # Build with our own versions of these tools, when possible.
42 export PATH = $(shell echo "`pwd`/tests:$$PATH")
44 include Makefile
46 # Ensure that $(VERSION) is up to date for dist-related targets, but not
47 # for others: rerunning autoconf and recompiling everything isn't cheap.
48 # The $(MAKE) clean is required, to remove all traces of the previous
49 # version string, which would otherwise cause a few test failures.
50 # Remove the autoreconf-provided INSTALL, so that we regenerate it.
51 ifeq (0,$(MAKELEVEL))
52 _is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
53 ifneq (,$(_is-dist-target))
54 _curr-ver := $(shell $(srcdir)/build-aux/git-version-gen $(srcdir) .version)
55 ifneq ($(_curr-ver),$(VERSION))
56 $(info INFO: running autoreconf for new version string; old: $(_curr-ver))
57 dummy := $(shell \
58 rm -rf autom4te.cache; \
59 (cd $(srcdir) && autoreconf -i -v) \
60 && $(MAKE) clean \
61 && rm -f INSTALL)
62 endif
63 endif
64 endif
66 include $(srcdir)/Makefile.cfg
67 include $(srcdir)/Makefile.maint
69 else
71 all:
72 @echo There seems to be no Makefile in this directory. 1>&2
73 @echo "You must run ./configure before running \`make'." 1>&2
74 @exit 1
76 endif
78 # Tell version 3.79 and up of GNU make to not build goals in this
79 # directory in parallel. This is necessary in case someone tries to
80 # build multiple targets on one command line.
81 .NOTPARALLEL: