X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=top%2FGNUmakefile;h=0fdd3fa7357d6ba8ea7b7299b2546a2165c9a8e2;hb=5c674409428366fd3bd40a51e1c06d998f8a2100;hp=062900b547077af9ea1506a5ac8f2842287b08a2;hpb=2b2986f1776a2850832d60e699b5231d54aa2d01;p=gnulib.git diff --git a/top/GNUmakefile b/top/GNUmakefile index 062900b54..0fdd3fa73 100644 --- a/top/GNUmakefile +++ b/top/GNUmakefile @@ -53,23 +53,39 @@ _autoreconf ?= autoreconf _have-git-version-gen := \ $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes) ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL)) - _is-dist-target = $(filter-out %clean, \ + _is-dist-target ?= $(filter-out %clean, \ $(filter maintainer-% dist% alpha beta major,$(MAKECMDGOALS))) - ifneq (,$(_is-dist-target)) - _curr-ver := $(shell cd $(srcdir) && ./$(_build-aux)/git-version-gen \ - $(srcdir)/.tarball-version) + _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS))) + ifneq (,$(_is-dist-target)$(_is-install-target)) + _curr-ver := $(shell cd $(srcdir) \ + && $(_build-aux)/git-version-gen .tarball-version) ifneq ($(_curr-ver),$(VERSION)) ifeq ($(_curr-ver),UNKNOWN) $(info WARNING: unable to verify if $(VERSION) is correct version) else - $(info INFO: running autoreconf for new version string: $(_curr-ver)) - _dummy := $(shell cd $(srcdir) && rm -rf autom4te.cache .version \ - && $(_autoreconf)) + 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'. + $(info WARNING: version string $(VERSION) is out of date;) + $(info run '$(MAKE) _version' to fix it) + else + $(info INFO: running autoreconf for new version string: $(_curr-ver)) + _dummy := $(shell $(MAKE) $(AM_MAKEFLAGS) _version) + endif endif endif endif endif +.PHONY: _version +_version: + cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf) + else .DEFAULT_GOAL := abort-due-to-no-makefile