2012-01-21 17:50:57 +08:00
|
|
|
# Having a separate GNUmakefile lets me 'include' the dynamically
|
2008-03-20 21:18:23 +08:00
|
|
|
# generated rules created via cfg.mk (package-local configuration)
|
|
|
|
# as well as maint.mk (generic maintainer rules).
|
2001-06-10 02:16:43 +08:00
|
|
|
# This makefile is used only if you run GNU Make.
|
|
|
|
# It is necessary if you want to build targets usually of interest
|
|
|
|
# only to the maintainer.
|
|
|
|
|
2022-07-10 23:40:50 +08:00
|
|
|
# Copyright (C) 2001, 2003, 2006-2022 Free Software Foundation, Inc.
|
2008-03-20 21:18:23 +08:00
|
|
|
|
2007-07-21 07:11:49 +08:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
# it under the terms of the GNU General Public License as published by
|
2007-07-21 07:11:49 +08:00
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
# (at your option) any later version.
|
2008-02-28 19:55:01 +08:00
|
|
|
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2008-02-28 19:55:01 +08:00
|
|
|
|
2007-07-21 07:11:49 +08:00
|
|
|
# You should have received a copy of the GNU General Public License
|
2017-09-17 08:37:03 +08:00
|
|
|
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* AUTHORS, BUGS, ChangeLog, ChangeLog.0, ChangeLog.1,
ChangeLog.2, GNUmakefile, Makefile.maint, NEWS, README,
README-alpha, TODO, configure.ac, lib/autoconf/Makefile.am,
m4/atconfig.m4, m4/init.m4, m4/m4.m4, m4/missing.m4,
m4/sanity.m4, tests/README, tests/aclocal.m4,
tests/atspecific.m4, tests/base.at, tests/compile.at,
tests/foreign.at, tests/m4sh.at, tests/m4sugar.at,
tests/semantics.at, tests/suite.at, tests/tools.at,
tests/torture.at: Add copyright notice.
* tests/mktests.sh: Update year in copyright notice.
2001-08-12 21:05:11 +08:00
|
|
|
|
2001-06-10 02:16:43 +08:00
|
|
|
# If the user runs GNU make but has not yet run ./configure,
|
|
|
|
# give them a diagnostic.
|
2012-02-29 21:39:00 +08:00
|
|
|
_gl-Makefile := $(wildcard [M]akefile)
|
|
|
|
ifneq ($(_gl-Makefile),)
|
2001-06-10 02:16:43 +08:00
|
|
|
|
2003-08-19 16:12:18 +08:00
|
|
|
# Make tar archive easier to reproduce.
|
|
|
|
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
|
|
|
|
|
2009-03-15 06:23:29 +08:00
|
|
|
# Allow the user to add to this in the Makefile.
|
|
|
|
ALL_RECURSIVE_TARGETS =
|
|
|
|
|
2001-06-10 02:16:43 +08:00
|
|
|
include Makefile
|
2007-10-23 01:54:52 +08:00
|
|
|
|
2008-03-12 20:14:44 +08:00
|
|
|
# Some projects override e.g., _autoreconf here.
|
2008-03-20 21:18:23 +08:00
|
|
|
-include $(srcdir)/cfg.mk
|
2008-03-12 20:14:44 +08:00
|
|
|
|
2008-03-22 12:43:01 +08:00
|
|
|
# Allow cfg.mk to override these.
|
|
|
|
_build-aux ?= build-aux
|
2010-07-03 05:58:07 +08:00
|
|
|
_autoreconf ?= autoreconf -v
|
2008-03-12 20:14:44 +08:00
|
|
|
|
maint: resync upstream files
* ChangeLog, GNUmakefile, build-aux/announce-gen:
* build-aux/config.guess, build-aux/config.sub, build-aux/gendocs.sh:
* build-aux/git-version-gen, build-aux/move-if-change:
* build-aux/texinfo.tex, build-aux/update-copyright:
* build-aux/vc-list-files, doc/fdl.texi, doc/gendocs_template:
* doc/standards.texi, lib/Autom4te/XFile.pm, m4/autobuild.m4:
Regenerated by 'make fetch'.
2012-01-04 07:16:52 +08:00
|
|
|
include $(srcdir)/maint.mk
|
|
|
|
|
2007-10-23 01:54:52 +08:00
|
|
|
# Ensure that $(VERSION) is up to date for dist-related targets, but not
|
2008-03-12 20:14:44 +08:00
|
|
|
# for others: rerunning autoreconf and recompiling everything isn't cheap.
|
2008-03-22 12:43:01 +08:00
|
|
|
_have-git-version-gen := \
|
|
|
|
$(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
|
|
|
|
ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
|
2008-09-02 20:53:38 +08:00
|
|
|
_is-dist-target ?= $(filter-out %clean, \
|
2011-01-05 07:11:08 +08:00
|
|
|
$(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
|
2008-09-02 20:53:38 +08:00
|
|
|
_is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
|
2008-07-22 05:38:40 +08:00
|
|
|
ifneq (,$(_is-dist-target)$(_is-install-target))
|
2010-07-03 05:58:07 +08:00
|
|
|
_curr-ver := $(shell cd $(srcdir) \
|
|
|
|
&& $(_build-aux)/git-version-gen \
|
|
|
|
.tarball-version \
|
|
|
|
$(git-version-gen-tag-sed-script))
|
2007-10-23 01:54:52 +08:00
|
|
|
ifneq ($(_curr-ver),$(VERSION))
|
2008-06-19 13:10:59 +08:00
|
|
|
ifeq ($(_curr-ver),UNKNOWN)
|
2009-03-15 06:23:29 +08:00
|
|
|
$(info WARNING: unable to verify if $(VERSION) is the correct version)
|
2008-06-19 13:10:59 +08:00
|
|
|
else
|
2008-08-06 22:22:14 +08:00
|
|
|
ifneq (,$(_is-install-target))
|
|
|
|
# GNU Coding Standards state that 'make install' should not cause
|
|
|
|
# recompilation after 'make all'. But as long as changing the version
|
|
|
|
# string alters config.h, the cost of having 'make all' always have an
|
|
|
|
# up-to-date version is prohibitive. So, as a compromise, we merely
|
|
|
|
# warn when installing a version string that is out of date; the user
|
|
|
|
# should run 'autoreconf' (or something like 'make distcheck') to
|
|
|
|
# fix the version, 'make all' to propagate it, then 'make install'.
|
2008-10-08 23:33:48 +08:00
|
|
|
$(info WARNING: version string $(VERSION) is out of date;)
|
2008-11-04 21:36:20 +08:00
|
|
|
$(info run '$(MAKE) _version' to fix it)
|
2008-08-06 22:22:14 +08:00
|
|
|
else
|
|
|
|
$(info INFO: running autoreconf for new version string: $(_curr-ver))
|
2010-07-03 05:58:07 +08:00
|
|
|
GNUmakefile: _version
|
|
|
|
touch GNUmakefile
|
2008-08-06 22:22:14 +08:00
|
|
|
endif
|
2008-06-19 13:10:59 +08:00
|
|
|
endif
|
2007-10-23 01:54:52 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2008-11-04 21:36:20 +08:00
|
|
|
.PHONY: _version
|
|
|
|
_version:
|
2008-10-08 23:33:48 +08:00
|
|
|
cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
|
2010-07-03 05:58:07 +08:00
|
|
|
$(MAKE) $(AM_MAKEFLAGS) Makefile
|
2008-10-08 23:33:48 +08:00
|
|
|
|
2001-06-10 02:16:43 +08:00
|
|
|
else
|
|
|
|
|
2008-03-20 21:18:23 +08:00
|
|
|
.DEFAULT_GOAL := abort-due-to-no-makefile
|
2008-04-04 06:45:11 +08:00
|
|
|
srcdir = .
|
2008-03-20 21:18:23 +08:00
|
|
|
|
|
|
|
# The package can override .DEFAULT_GOAL to run actions like autoreconf.
|
|
|
|
-include ./cfg.mk
|
maint: resync upstream files
* ChangeLog, GNUmakefile, build-aux/announce-gen:
* build-aux/config.guess, build-aux/config.sub, build-aux/gendocs.sh:
* build-aux/git-version-gen, build-aux/move-if-change:
* build-aux/texinfo.tex, build-aux/update-copyright:
* build-aux/vc-list-files, doc/fdl.texi, doc/gendocs_template:
* doc/standards.texi, lib/Autom4te/XFile.pm, m4/autobuild.m4:
Regenerated by 'make fetch'.
2012-01-04 07:16:52 +08:00
|
|
|
|
|
|
|
# Allow cfg.mk to override these.
|
|
|
|
_build-aux ?= build-aux
|
|
|
|
_autoreconf ?= autoreconf -v
|
|
|
|
|
2008-03-20 21:18:23 +08:00
|
|
|
include ./maint.mk
|
|
|
|
|
2008-04-04 06:45:11 +08:00
|
|
|
ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
|
|
|
|
$(MAKECMDGOALS): abort-due-to-no-makefile
|
|
|
|
endif
|
|
|
|
|
2008-03-20 21:18:23 +08:00
|
|
|
abort-due-to-no-makefile:
|
2006-11-17 08:00:31 +08:00
|
|
|
@echo There seems to be no Makefile in this directory. 1>&2
|
2020-08-04 20:46:59 +08:00
|
|
|
@echo "You must run ./configure before running '$(MAKE)'." 1>&2
|
2001-06-10 02:16:43 +08:00
|
|
|
@exit 1
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Tell version 3.79 and up of GNU make to not build goals in this
|
2009-03-15 06:23:29 +08:00
|
|
|
# directory in parallel, in case someone tries to build multiple
|
|
|
|
# targets, and one of them can cause a recursive target to be invoked.
|
|
|
|
|
|
|
|
# Only set this if Automake doesn't provide it.
|
|
|
|
AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \
|
|
|
|
$(RECURSIVE_CLEAN_TARGETS:-recursive=) \
|
|
|
|
dist distcheck tags ctags
|
|
|
|
|
|
|
|
ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS)
|
|
|
|
|
|
|
|
ifneq ($(word 2, $(MAKECMDGOALS)), )
|
|
|
|
ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), )
|
2001-06-10 02:16:43 +08:00
|
|
|
.NOTPARALLEL:
|
2009-03-15 06:23:29 +08:00
|
|
|
endif
|
|
|
|
endif
|