Makefile: make VSNHASH, LDFLAGS overridable
This commit is contained in:
parent
5aa28f74ee
commit
6400df9612
8
Makefile
8
Makefile
@ -1,9 +1,9 @@
|
|||||||
SCRIPTS = $(shell awk '/#!\/usr\/bin\/env (ba)?sh/&&FNR==1{print FILENAME}' $(shell git ls-files))
|
SCRIPTS := $(shell awk '/#!\/usr\/bin\/env (ba)?sh/&&FNR==1{print FILENAME}' $(shell git ls-files))
|
||||||
GODEPS = $(shell git ls-files '*.go' go.mod go.sum)
|
GODEPS := $(shell git ls-files '*.go' go.mod go.sum)
|
||||||
|
|
||||||
VSN ?= $(shell git describe --dirty)
|
VSN ?= $(shell git describe --dirty)
|
||||||
VSNHASH = $(shell git rev-parse --verify HEAD)
|
VSNHASH ?= $(shell git rev-parse --verify HEAD)
|
||||||
LDFLAGS = -ldflags "-X main.Version=$(VSN) -X main.VersionHash=$(VSNHASH)"
|
LDFLAGS ?= -ldflags "-X main.Version=$(VSN) -X main.VersionHash=$(VSNHASH)"
|
||||||
|
|
||||||
undocker: ## builds binary for the current architecture
|
undocker: ## builds binary for the current architecture
|
||||||
go build $(LDFLAGS) -o $@
|
go build $(LDFLAGS) -o $@
|
||||||
|
Loading…
Reference in New Issue
Block a user