Skip to content

Commit d6d07ac

Browse files
authored
Makefile: use GO macro if set, to check for version (#99)
1 parent a8ef461 commit d6d07ac

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
BUILD_REQUIRE_GO_MAJOR ?= 1
22
BUILD_REQUIRE_GO_MINOR ?= 20
33

4-
GOCMD=go
5-
GOBUILD=$(GOCMD) build
6-
GOTEST=$(GOCMD) test
4+
GO = go
5+
GOBUILD = $(GO) build
6+
GOTEST = $(GO) test
77

88
BINARY_NAME=crowdsec-custom-bouncer
99
TARBALL_NAME=$(BINARY_NAME).tgz
@@ -86,7 +86,7 @@ RELDIR = $(BINARY_NAME)-$(BUILD_VERSION)
8686

8787
.PHONY: vendor
8888
vendor: vendor-remove
89-
$(GOCMD) mod vendor
89+
$(GO) mod vendor
9090
tar czf vendor.tgz vendor
9191
tar --create --auto-compress --file=$(RELDIR)-vendor.tar.xz vendor
9292

mk/goversion.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
BUILD_GOVERSION = $(subst go,,$(shell go env GOVERSION))
2+
BUILD_GOVERSION = $(subst go,,$(shell $(GO) env GOVERSION))
33

44
go_major_minor = $(subst ., ,$(BUILD_GOVERSION))
55
GO_MAJOR_VERSION = $(word 1, $(go_major_minor))
@@ -9,7 +9,7 @@ GO_VERSION_VALIDATION_ERR_MSG = Golang version ($(BUILD_GOVERSION)) is not suppo
99

1010

1111
.PHONY: goversion
12-
goversion: $(if $(findstring devel,$(shell go env GOVERSION)),goversion_devel,goversion_check)
12+
goversion: $(if $(findstring devel,$(shell $(GO) env GOVERSION)),goversion_devel,goversion_check)
1313

1414

1515
.PHONY: goversion_devel

0 commit comments

Comments
 (0)