about summary refs log tree commit homepage
path: root/GIT-VERSION-GEN
diff options
context:
space:
mode:
Diffstat (limited to 'GIT-VERSION-GEN')
-rwxr-xr-xGIT-VERSION-GEN10
1 files changed, 10 insertions, 0 deletions
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index df7feb1..dd8ae37 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -3,6 +3,7 @@
 # License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
 CONSTANT = "DTAS::VERSION"
 RVF = "lib/dtas/version.rb"
+GVF = "GIT-VERSION-FILE"
 DEF_VER = "v0.4.0"
 vn = DEF_VER
 
@@ -28,4 +29,13 @@ if new_ruby_version != cur_ruby_version
   File.open(RVF, "w") { |fp| fp.write(new_ruby_version) }
 end
 File.chmod(0644, RVF)
+
+# generate the makefile snippet
+new_make_version = "VERSION = #{vn}\n"
+cur_make_version = File.read(GVF) rescue nil
+if new_make_version != cur_make_version
+  File.open(GVF, "w") { |fp| fp.write(new_make_version) }
+end
+File.chmod(0644, GVF)
+
 puts vn if $0 == __FILE__