From 0a1457acdeba69231237279114ccae21ec74302a Mon Sep 17 00:00:00 2001 From: Ansa89 Date: Wed, 15 Oct 2014 09:52:13 +0200 Subject: [PATCH] Version: add revision only if git is available --- cfg/global_vars.mk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cfg/global_vars.mk b/cfg/global_vars.mk index 97a1fa6..cff9872 100644 --- a/cfg/global_vars.mk +++ b/cfg/global_vars.mk @@ -1,7 +1,11 @@ # Version TOXIC_VERSION = 0.5.2 -REV = $(shell git rev-list HEAD --count) -VERSION = $(TOXIC_VERSION)_r$(REV) +REV = $(shell if which git &>/dev/null ; then git rev-list HEAD --count 2>/dev/null || echo -n "error" ; else echo -n "error" ; fi) +ifneq ($(REV), error) + VERSION = $(TOXIC_VERSION)_r$(REV) +else + VERSION = $(TOXIC_VERSION) +endif # Project directories DOC_DIR = $(BASE_DIR)/doc