Makefile: set version from git tag
This commit is contained in:
parent
d3fea6ec4b
commit
9786dc2c53
1 changed files with 3 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -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 ./...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue