From 6400df9612f1583db392341c5a83cf95b2cebb48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sun, 12 May 2024 07:33:29 +0300 Subject: [PATCH] Makefile: make VSNHASH, LDFLAGS overridable --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 33cbde0..1a863a3 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ -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) +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) VSN ?= $(shell git describe --dirty) -VSNHASH = $(shell git rev-parse --verify HEAD) -LDFLAGS = -ldflags "-X main.Version=$(VSN) -X main.VersionHash=$(VSNHASH)" +VSNHASH ?= $(shell git rev-parse --verify HEAD) +LDFLAGS ?= -ldflags "-X main.Version=$(VSN) -X main.VersionHash=$(VSNHASH)" undocker: ## builds binary for the current architecture go build $(LDFLAGS) -o $@