-SYNCTHING_VERSION = 0.14.28
-# FIXME: use master while waiting a release that include #164
-#SYNCTHING_INOTIFY_VERSION = 0.8.5
-SYNCTHING_INOTIFY_VERSION=master
-
-
-# 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)))
- else
- SUB_VERSION := $(shell git describe --tags --always | sed 's/^v//')
- ifeq ($(SUB_VERSION), )
- SUB_VERSION := unknown-dev
- endif
- endif
+SYNCTHING_VERSION = 0.14.38
+SYNCTHING_INOTIFY_VERSION = 0.8.7
+
+
+# Retrieve git tag/commit to set version & sub-version strings
+GIT_DESC := $(shell git describe --always --tags --match "[0-9]*")
+VERSION := $(firstword $(subst -, ,$(GIT_DESC)))
+ifeq (-,$(findstring -,$(GIT_DESC)))
+ SUB_VERSION := $(subst $(VERSION)-,,$(GIT_DESC))
+endif
+ifeq ($(VERSION), )
+ VERSION := unknown-dev
+endif
+ifeq ($(SUB_VERSION), )
+ SUB_VERSION := $(shell date +'%Y-%m-%d_%H%M%S')