aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/k8splugin/Makefile')
-rw-r--r--src/k8splugin/Makefile15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/k8splugin/Makefile b/src/k8splugin/Makefile
index 77196afa..a1cda8dd 100644
--- a/src/k8splugin/Makefile
+++ b/src/k8splugin/Makefile
@@ -8,13 +8,14 @@
##############################################################################
export GO111MODULE=on
+GO ?= go
.PHONY: plugins
all: clean plugins
CGO_ENABLED=1 GOOS=linux GOARCH=amd64
- @go build -tags netgo -o ./k8plugin ./cmd/main.go
+ @$(GO) build -tags netgo -o ./k8plugin ./cmd/main.go
# The following is done this way as each patch on CI runs build and each merge runs deploy. So for build we don't need to build binary and hence
# no need to create a static binary with additional flags. However, for generating binary, additional build flags are necessary. This if used with
@@ -25,14 +26,14 @@ deploy: build
.PHONY: test
test: clean
- @go build -race -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go
- @go test -race ./...
+ @$(GO) build -race -buildmode=plugin -o ./mock_files/mock_plugins/mockplugin.so ./mock_files/mock_plugins/mockplugin.go
+ @$(GO) test -race ./...
format:
- @go fmt ./...
+ @$(GO) fmt ./...
plugins:
- @find plugins -maxdepth 1 -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs go build -buildmode=plugin -tags netgo -o $(basename {}).so" \;
+ @find plugins -maxdepth 1 -type d -not -path plugins -exec sh -c "ls {}/plugin.go | xargs $(GO) build -buildmode=plugin -tags netgo -o $(basename {}).so" \;
clean:
@find . -name "*so" -delete
@@ -40,5 +41,5 @@ clean:
.PHONY: cover
cover:
- @go test -race ./... -coverprofile=coverage.out
- @go tool cover -html=coverage.out -o coverage.html
+ @$(GO) test -race ./... -coverprofile=coverage.out
+ @$(GO) tool cover -html=coverage.out -o coverage.html