---
 scripts/make_version.sh |    8 ++++++++
 scripts/rules.mk        |    5 +----
 2 files changed, 9 insertions(+), 4 deletions(-)
 create mode 100755 scripts/make_version.sh

diff --git a/scripts/make_version.sh b/scripts/make_version.sh
new file mode 100755
index 0000000..ba26840
--- /dev/null
+++ b/scripts/make_version.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+echo -n 'const char tarantool_version_string[] = "'
+git tag | tail -n 1 | tr -d \\n
+echo -n " +"$(git log --oneline $(git tag | tail -n1)..HEAD | wc -l)"commits "
+git log -1 --format='%h' | tr -d \\n
+git diff --quiet || (echo -n ' AND'; git diff --shortstat) | tr -d \\n
+echo '";'
diff --git a/scripts/rules.mk b/scripts/rules.mk
index 459c3d5..26d7d93 100644
--- a/scripts/rules.mk
+++ b/scripts/rules.mk
@@ -99,10 +99,7 @@ endif
 
 ifeq ($(HAVE_GIT),1)
 tarantool_version.h: FORCE
-       @echo -n "const char tarantool_version_string[] = " > $...@_
-       @git show HEAD | sed 's/commit \(.*\)/\"\1/;q' | tr -d \\n >> $...@_
-       @git diff --quiet || (echo -n ' AND'; git diff --shortstat) | tr -d \\n 
>> $...@_
-       @echo '";' >> $...@_
+       @$(SRCDIR)/scripts/make_version.sh > $...@_
        @diff -q $@ $...@_ 2>/dev/null >/dev/null || ($(ECHO) " GEN     " 
$(notdir $@); cp $...@_ $@)
 FORCE:
 endif
-- 
1.7.3.2


_______________________________________________
Mailing list: https://launchpad.net/~tarantool-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~tarantool-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to