From 45d67236e16365e0c6ea90e9b8baa3008d50996d Mon Sep 17 00:00:00 2001 From: Ben Morrison Date: Sun, 9 Jun 2019 23:14:56 -0400 Subject: setting version via build flags --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Makefile') 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 -- cgit 1.4.1-2-gfad0