about summary refs log tree commit diff homepage
path: root/lib/Support/Makefile
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2015-04-25 18:38:19 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2015-04-25 18:38:19 +0100
commit47b4608a033a6b6c05f8798ab675baa120d15a7f (patch)
tree84a4b5bee0ac3afc7246c0e9a81c3efd2972d7bb /lib/Support/Makefile
parent9fc9cdde42b5a1d38dd5a3ea0815104762c2b367 (diff)
downloadklee-47b4608a033a6b6c05f8798ab675baa120d15a7f.tar.gz
Report the git tag if exists in the output of --version from klee
and kleaver.
Diffstat (limited to 'lib/Support/Makefile')
-rw-r--r--lib/Support/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/Makefile b/lib/Support/Makefile
index ff28b06e..2b1b104c 100644
--- a/lib/Support/Makefile
+++ b/lib/Support/Makefile
@@ -26,6 +26,12 @@ include $(LEVEL)/Makefile.common
 
 GIT_PRESENT:=$(shell [ -d "$(PROJ_SRC_ROOT)/.git" ] && echo 1 || echo 0)
 
+ifeq ($(GIT_PRESENT),1)
+GIT_TAGS:=$(shell cd $(PROJ_SRC_ROOT); git describe --tags 2> /dev/null 1>&2 && echo 1 || echo 0)
+else
+GIT_TAGS:=0
+endif
+
 .PHONY: $(CompileTimeInfoFile)
 $(CompileTimeInfoFile):
 	$(Verb) echo "Regenerating $(CompileTimeInfoFile)"
@@ -34,3 +40,7 @@ ifeq ($(GIT_PRESENT),1)
 	$(Verb) echo '#define KLEE_BUILD_REVISION "'$(shell cd $(PROJ_SRC_ROOT); git rev-parse HEAD)'"' >> \
 	$(CompileTimeInfoFile)
 endif
+ifeq ($(GIT_TAGS),1)
+	$(Verb) echo '#define KLEE_BUILD_TAG "'$(shell cd $(PROJ_SRC_ROOT); git describe --tags)'"' >> \
+	$(CompileTimeInfoFile)
+endif