Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 7 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we would need replace it as:

Suggested change
build/%: $(SOURCES) ## Build the operator-sdk binary
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){ \
Expand Down