1
0
Fork 0

Makefile: set version from git tag

This commit is contained in:
Henrik Hautakoski 2025-10-16 22:46:42 +02:00
parent d3fea6ec4b
commit 9786dc2c53

View file

@ -1,5 +1,6 @@
GO=go
GOLDFLAGS=-v -s -w
VERSION=$(shell git describe --always --tags --dirty --match="v*")
GOLDFLAGS=-v -s -w -X main.version="$(VERSION)"
GOBUILDFLAGS=-v -p $(shell nproc) -ldflags="$(GOLDFLAGS)"
.PHONY: build test
@ -8,4 +9,4 @@ build :
$(GO) build $(GOBUILDFLAGS) -o build/dnsupdater cmd/dnsupdater/main.go
test :
$(GO) test -v ./...
$(GO) test -v ./...