Use LDFLAGS to set build version

This commit is contained in:
2021-03-02 00:41:55 -06:00
parent c8d0d306e4
commit 4d3074fa14
2 changed files with 6 additions and 3 deletions

View File

@ -1,3 +1,6 @@
LUME_VERSION ?= $(shell git describe --tags --always)
LDFLAGS := ${LDFLAGS} -X git.kill0.net/chill9/lume/cmd.Version=${LUME_VERSION}
ifeq ($(OS), Windows_NT)
EXE=lume.exe
RM=del /f /q
@ -8,8 +11,8 @@ endif
.PHONY: build
build:
go build -o ${EXE} ./cmd/lume
go build -o ${EXE} -ldflags="${LDFLAGS}" ./cmd/lume
.PHONY: clean
clean:
${RM} ${EXE}
${RM} ${EXE}