+# Variables for version information.
+BASEVER := $(srcdir)/BASE-VER # 4.x.y
+DEVPHASE := $(srcdir)/DEV-PHASE # experimental, prerelease, ""
+DATESTAMP := $(srcdir)/DATESTAMP # YYYYMMDD or empty
+
+BASEVER_c := $(shell cat $(BASEVER))
+DEVPHASE_c := $(shell cat $(DEVPHASE))
+DATESTAMP_c := $(shell cat $(DATESTAMP))
+
+version := $(BASEVER_c)
+
+# For use in version.c - double quoted strings, with appropriate
+# surrounding punctuation and spaces, and with the datestamp and
+# development phase collapsed to the empty string in release mode
+# (i.e. if DEVPHASE_c is empty). The space immediately after the
+# comma in the $(if ...) constructs is significant - do not remove it.
+BASEVER_s := "\"$(BASEVER_c)\""
+DEVPHASE_s := "\"$(if $(DEVPHASE_c), ($(DEVPHASE_c)))\""
+DATESTAMP_s := "\"$(if $(DEVPHASE_c), $(DATESTAMP_c))\""
+
+# Shorthand variables for dependency lists.