summary refs log tree commit diff stats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 598ff00..2151717 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,9 @@
 PREFIX?=/usr/local
 _INSTDIR=$(PREFIX)
 BINDIR?=$(_INSTDIR)/getwtxt
+VERSION?=$(shell git tag | grep ^v | sort -V | tail -n 1)
 GOFLAGS?=-tags netgo \
-				 -ldflags '-extldflags "-static"' \
+				 -ldflags '-X github.com/getwtxt/getwtxt/svc.Vers=${VERSION} -extldflags "-static"' \
 				 -buildmode pie
 
 getwtxt: getwtxt.go go.mod go.sum