diff --git a/functions/examples/application-cr/Makefile b/functions/examples/application-cr/Makefile index 9b057cec2..670a475ab 100644 --- a/functions/examples/application-cr/Makefile +++ b/functions/examples/application-cr/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/injection-tshirt-sizes/Makefile b/functions/examples/injection-tshirt-sizes/Makefile index 9cf21bc2a..e52c7d18d 100644 --- a/functions/examples/injection-tshirt-sizes/Makefile +++ b/functions/examples/injection-tshirt-sizes/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/template-go-nginx/Makefile b/functions/examples/template-go-nginx/Makefile index ab76261e9..f17ce5ecb 100644 --- a/functions/examples/template-go-nginx/Makefile +++ b/functions/examples/template-go-nginx/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/template-heredoc-cockroachdb/Makefile b/functions/examples/template-heredoc-cockroachdb/Makefile index d218aca00..469ab5cc4 100644 --- a/functions/examples/template-heredoc-cockroachdb/Makefile +++ b/functions/examples/template-heredoc-cockroachdb/Makefile @@ -3,7 +3,10 @@ .PHONY: license image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif license: (which $(GOBIN)/addlicense || go get github.com/google/addlicense) diff --git a/functions/examples/validator-kubeval/Makefile b/functions/examples/validator-kubeval/Makefile index 08a214c41..47aff3eb2 100644 --- a/functions/examples/validator-kubeval/Makefile +++ b/functions/examples/validator-kubeval/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .) diff --git a/functions/examples/validator-resource-requests/Makefile b/functions/examples/validator-resource-requests/Makefile index f3d362626..8bfa4d177 100644 --- a/functions/examples/validator-resource-requests/Makefile +++ b/functions/examples/validator-resource-requests/Makefile @@ -3,7 +3,10 @@ .PHONY: generate license fix vet fmt test build tidy image -GOBIN := $(shell go env GOPATH)/bin +GOBIN = $(shell go env GOBIN) +ifeq ($(GOBIN),) +GOBIN = $(shell go env GOPATH)/bin +endif build: (cd image && go build -v -o $(GOBIN)/config-function .)