summaryrefslogtreecommitdiff
path: root/GNUmakefile
diff options
context:
space:
mode:
Diffstat (limited to 'GNUmakefile')
-rw-r--r--GNUmakefile14
1 files changed, 14 insertions, 0 deletions
diff --git a/GNUmakefile b/GNUmakefile
index eef4cb073..92f989c2b 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -39,6 +39,20 @@ ifeq ($(have-Makefile),yes)
export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
include Makefile
+
+# Ensure that $(VERSION) is up to date for dist-related targets, but not
+# for others: rerunning autoconf and recompiling everything isn't cheap.
+ifeq (0,$(MAKELEVEL))
+ _is-dist-target = $(filter dist% alpha beta major,$(MAKECMDGOALS))
+ ifneq (,$(_is-dist-target))
+ _curr-ver := $(shell build-aux/git-version-gen 0 .version)
+ ifneq ($(_curr-ver),$(VERSION))
+ $(info INFO: rerunning autoconf for new version string $(_curr-ver))
+ $(shell touch configure.ac)
+ endif
+ endif
+endif
+
include $(srcdir)/Makefile.cfg
include $(srcdir)/Makefile.maint