Skip to content

Commit

Permalink
build: Move tools building to a sub Makefile in tools/
Browse files Browse the repository at this point in the history
This keeps everything related to build tools in the same place, and will
ease sharing with other projects.
  • Loading branch information
cfergeau authored and anjannath committed Jul 25, 2022
1 parent 132c5ae commit d7cd449
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
13 changes: 3 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ CRC_VERSION = 2.6.0
COMMIT_SHA=$(shell git rev-parse --short HEAD)
MACOS_INSTALL_PATH = /Applications/Red Hat OpenShift Local.app/Contents/Resources
CONTAINER_RUNTIME ?= podman
TOOLS_BINDIR = $(realpath tools/bin)

TOOLS_DIR := tools
include tools/tools.mk

ifdef OKD_VERSION
OPENSHIFT_VERSION = $(OKD_VERSION)
Expand Down Expand Up @@ -237,15 +239,6 @@ e2e-story-registry: install
fmt:
@gofmt -l -w $(SOURCE_DIRS)

$(TOOLS_BINDIR)/makefat: tools/go.mod
cd tools && GOBIN=$(TOOLS_BINDIR) go install github.com/randall77/makefat

$(TOOLS_BINDIR)/golangci-lint: tools/go.mod
cd tools && GOBIN=$(TOOLS_BINDIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint

$(TOOLS_BINDIR)/gomod2rpmdeps: tools/go.mod
cd tools && GOBIN=$(TOOLS_BINDIR) go install github.com/cfergeau/gomod2rpmdeps/cmd/gomod2rpmdeps

# Run golangci-lint against code
.PHONY: lint cross-lint
lint: $(TOOLS_BINDIR)/golangci-lint
Expand Down
10 changes: 10 additions & 0 deletions tools/tools.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
TOOLS_BINDIR = $(realpath $(TOOLS_DIR)/bin)

$(TOOLS_BINDIR)/makefat: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/randall77/makefat

$(TOOLS_BINDIR)/golangci-lint: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/golangci/golangci-lint/cmd/golangci-lint

$(TOOLS_BINDIR)/gomod2rpmdeps: $(TOOLS_DIR)/go.mod
cd $(TOOLS_DIR) && GOBIN=$(TOOLS_BINDIR) go install github.com/cfergeau/gomod2rpmdeps/cmd/gomod2rpmdeps

0 comments on commit d7cd449

Please sign in to comment.