aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 14:58:09 +0100
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-11-06 16:00:04 +0100
commitb6770332eadedf14cd9ab2e74478b5223c840767 (patch)
treecbd49f24cacbd184e3dc1a7686a8b9faec0488f8 /Makefile
parent1a780af75f5e8a012efc3546e656d3c889e4d2a1 (diff)
Extract version from git tag.
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile24
1 files changed, 7 insertions, 17 deletions
diff --git a/Makefile b/Makefile
index d546961..8b190c8 100644
--- a/Makefile
+++ b/Makefile
@@ -1,26 +1,16 @@
-# Makefile used to build XDS daemon Web Server
-
-# Application Version
-VERSION := 0.3.2
+# Makefile used to build XDS Server
# Syncthing version to install
SYNCTHING_VERSION = 0.14.38
SYNCTHING_INOTIFY_VERSION = 0.8.7
-# Retrieve git tag/commit to set sub-version string
-ifeq ($(origin SUB_VERSION), undefined)
- SUB_VERSION := $(shell git describe --exact-match --tags 2>/dev/null | sed 's/^v//')
- ifneq ($(SUB_VERSION), )
- VERSION := $(firstword $(subst -, ,$(SUB_VERSION)))
- SUB_VERSION := $(word 2,$(subst -, ,$(SUB_VERSION)))
- endif
- ifeq ($(SUB_VERSION), )
- SUB_VERSION := $(shell git rev-parse --short HEAD)
- ifeq ($(SUB_VERSION), )
- SUB_VERSION := unknown-dev
- endif
- endif
+# Retrieve git tag/commit to set version & sub-version strings
+GIT_DESC := $(shell git describe --always --tags)
+VERSION := $(firstword $(subst -, ,$(GIT_DESC)))
+SUB_VERSION := $(subst $(VERSION)-,,$(GIT_DESC))
+ifeq ($(VERSION), )
+ VERSION := unknown-dev
endif
# for backward compatibility