Skip to content

Commit

Permalink
Makefile: use GO macro if set, to check for version (#85)
Browse files Browse the repository at this point in the history
* Makefile: use GO macro if set, to check for version

* CI: apt update before install
  • Loading branch information
mmetc authored Jan 8, 2024
1 parent 2c4fc20 commit 13af0a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
BUILD_REQUIRE_GO_MAJOR ?= 1
BUILD_REQUIRE_GO_MINOR ?= 20

GOCMD=go
GOBUILD=$(GOCMD) build
GOTEST=$(GOCMD) test
GO = go
GOBUILD = $(GO) build
GOTEST = $(GO) test

BINARY_NAME=crowdsec-blocklist-mirror
TARBALL_NAME=$(BINARY_NAME).tgz
Expand Down Expand Up @@ -90,7 +90,7 @@ RELDIR = $(BINARY_NAME)-$(BUILD_VERSION)

.PHONY: vendor
vendor: vendor-remove
$(GOCMD) mod vendor
$(GO) mod vendor
tar czf vendor.tgz vendor
tar --create --auto-compress --file=$(RELDIR)-vendor.tar.xz vendor

Expand Down
4 changes: 2 additions & 2 deletions mk/goversion.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

BUILD_GOVERSION = $(subst go,,$(shell go env GOVERSION))
BUILD_GOVERSION = $(subst go,,$(shell $(GO) env GOVERSION))

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


.PHONY: goversion
goversion: $(if $(findstring devel,$(shell go env GOVERSION)),goversion_devel,goversion_check)
goversion: $(if $(findstring devel,$(shell $(GO) env GOVERSION)),goversion_devel,goversion_check)


.PHONY: goversion_devel
Expand Down

0 comments on commit 13af0a8

Please sign in to comment.