From 13af0a8fc1a45a888eea6ab6bbfb8f89a2d292f6 Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Mon, 8 Jan 2024 21:26:50 +0100 Subject: [PATCH] Makefile: use GO macro if set, to check for version (#85) * Makefile: use GO macro if set, to check for version * CI: apt update before install --- Makefile | 8 ++++---- mk/goversion.mk | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 94fe9ff..55730e2 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/mk/goversion.mk b/mk/goversion.mk index 7c9f9d5..c2635f3 100644 --- a/mk/goversion.mk +++ b/mk/goversion.mk @@ -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)) @@ -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