aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 88880a8..bb75ed8 100644
--- a/Makefile
+++ b/Makefile
@@ -21,9 +21,12 @@ OBJECTS := $(patsubst src/%.c,$(BUILDDIR)/%.o,$(SOURCES))
TESTS := $(patsubst test/%.c,$(BUILDDIR)/test_%,$(wildcard test/*.c))
TFLAGS ?= -g ${CFLAGS}
-VERSION = "v2.0.0"
+VERSION := $(shell git describe --abbrev=8 --dirty --always --tags 2> /dev/null)
+ifeq ($(VERSION),)
+VERSION := 2.0.0
+endif
-CFLAGS += -DIMV_VERSION=\"$(VERSION)\"
+CFLAGS += -DIMV_VERSION=\""$(VERSION)"\"
imv: $(TARGET)