Use GOBIN env variable directly
@@ -16,7 +16,7 @@ ifeq ($(ARCH),)
ARCH=amd64
endif
CURRENT_OS_ARCH=$(shell echo `go env GOOS`-`go env GOARCH`)
-GO_BIN=$(shell if [ "$$GOBIN" != "" ]; then echo "$$GOBIN"; else echo `go env GOPATH`/bin; fi)
+GOBIN?=$(shell echo `go env GOPATH`/bin)
# NB because this outputs absolute file names, you have to be careful
# if you're testing out the Makefile with `-W` (pretend a file is
@@ -32,7 +32,7 @@ IMAGE_TAG:=$(shell ./docker/image-tag)
VCS_REF:=$(shell git rev-parse HEAD)
BUILD_DATE:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
-all: $(GO_BIN)/fluxctl $(GO_BIN)/fluxd $(GO_BIN)/helm-operator build/.flux.done build/.helm-operator.done
+all: $(GOBIN)/fluxctl $(GOBIN)/fluxd $(GOBIN)/helm-operator build/.flux.done build/.helm-operator.done
release-bins:
for arch in amd64; do \
@@ -112,16 +112,16 @@ cache/%/helm-$(HELM_VERSION): docker/helm.version
tar -m -C ./cache -xzf cache/$*/helm-$(HELM_VERSION).tar.gz $*/helm
mv cache/$*/helm $@
-$(GO_BIN)/fluxctl: $(FLUXCTL_DEPS)
-$(GO_BIN)/fluxctl: ./cmd/fluxctl/*.go
+$(GOBIN)/fluxctl: $(FLUXCTL_DEPS)
+$(GOBIN)/fluxctl: ./cmd/fluxctl/*.go
go install ./cmd/fluxctl
-$(GO_BIN)/fluxd: $(FLUXD_DEPS)
-$(GO_BIN)/fluxd: cmd/fluxd/*.go
+$(GOBIN)/fluxd: $(FLUXD_DEPS)
+$(GOBIN)/fluxd: cmd/fluxd/*.go
go install ./cmd/fluxd
-$(GO_BIN)/helm-operator: $(HELM_OPERATOR_DEPS)
-$(GO_BIN)/help-operator: cmd/helm-operator/*.go
+$(GOBIN)/helm-operator: $(HELM_OPERATOR_DEPS)
+$(GOBIN)/help-operator: cmd/helm-operator/*.go
go install ./cmd/helm-operator
integration-test: all
