diff --git a/Makefile b/Makefile index 225b754154c..3fa93f4e0b1 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,13 @@ clean: ## Cleanup build artifacts and tool binaries. ##@ Build +# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set) +ifeq (,$(shell go env GOBIN)) +GOBIN=$(shell go env GOPATH)/bin +else +GOBIN=$(shell go env GOBIN) +endif + .PHONY: install install: ## Install operator-sdk and helm-operator. @if [ -z "$(GOBIN)" ]; then \