Makefile: fix build/% rule
@@ -13,9 +13,6 @@ VERSION = $(shell git describe --dirty --tags --always)
GIT_COMMIT = $(shell git rev-parse HEAD)
K8S_VERSION = v1.18.2
REPO = github.com/operator-framework/operator-sdk
-SDK_BUILD_PATH = $(REPO)/cmd/operator-sdk
-ANSIBLE_BUILD_PATH = $(REPO)/cmd/ansible-operator
-HELM_BUILD_PATH = $(REPO)/cmd/helm-operator
PKGS = $(shell go list ./... | grep -v /vendor/)
TEST_PKGS = $(shell go list ./... | grep -v -E 'github.com/operator-framework/operator-sdk/test/')
SOURCES = $(shell find . -name '*.go' -not -path "*/vendor/*")
@@ -69,14 +66,8 @@ help: ## Show this help screen
all: format test build/operator-sdk ## Test and Build the Operator SDK
-install: ## Install the operator-sdk binary
- $(Q)$(GOARGS) go install $(GO_BUILD_ARGS) $(SDK_BUILD_PATH)
-
-install-ansible: ## Install the ansible-operator binary
- $(Q)$(GOARGS) go install $(GO_BUILD_ARGS) $(ANSIBLE_BUILD_PATH)
-
-install-helm: ## Install the helm-operator binary
- $(Q)$(GOARGS) go install $(GO_BUILD_ARGS) $(HELM_BUILD_PATH)
+install: ## Install the binaries
+ $(Q)$(GOARGS) go install $(GO_BUILD_ARGS) ./cmd/operator-sdk ./cmd/ansible-operator ./cmd/helm-operator
# Code management.
.PHONY: format tidy clean cli-doc lint
@@ -170,14 +161,11 @@ build/helm-operator-%-ppc64le-linux-gnu: GOARGS = GOOS=linux GOARCH=ppc64le
build/helm-operator-%-s390x-linux-gnu: GOARGS = GOOS=linux GOARCH=s390x
build/helm-operator-%-linux-gnu: GOARGS = GOOS=linux
-build/operator-%: $(SOURCES) ## Build the operator-sdk binary
- $(Q)$(GOARGS) go build $(GO_BUILD_ARGS) -o $@ $(SDK_BUILD_PATH)
-
-build/ansible-%: $(SOURCES) ## Build the ansible-operator binary
- $(Q)$(GOARGS) go build $(GO_BUILD_ARGS) -o $@ $(ANSIBLE_BUILD_PATH)
-
-build/helm-%: $(SOURCES) ## Build the helm-operator binary
- $(Q)$(GOARGS) go build $(GO_BUILD_ARGS) -o $@ $(HELM_BUILD_PATH)
+build/%: $(SOURCES) ## Build the operator-sdk binary
+ $(Q){ \
+ cmdpkg=$$(echo $* | sed "s/\(operator-sdk\|ansible-operator\|helm-operator\).*/\1/"); \
+ $(GOARGS) go build $(GO_BUILD_ARGS) -o $@ ./cmd/$$cmdpkg; \
+ }
build/%.asc: ## Create release signatures for operator-sdk release binaries
$(Q){ \
