auto-version: Separate out version deduction magic.
[cfd] / Makefile.am
index 7ca039d..86b4fb0 100644 (file)
@@ -95,6 +95,17 @@ confsubst: confsubst.in Makefile
        chmod +x $@.new
        mv $@.new $@
 
+## auto-version
+pkgdata_SCRIPTS                += auto-version
+CLEANFILES             += auto-version
+EXTRA_DIST             += auto-version.in
+
+auto-version: auto-version.in Makefile
+       $(confsubst) $(srcdir)/auto-version.in >$@.new \
+               VERSION=$(VERSION)
+       chmod +x $@.new
+       mv $@.new $@
+
 ## Testsuites.
 pkgdata_DATA           += autotest.am
 pkgdata_DATA           += testsuite.at