github.com/osdi23p228/fabric@v0.0.0-20221218062954-77808885f5db/gotools.mk (about)

     1  # Copyright IBM Corp All Rights Reserved.
     2  # Copyright London Stock Exchange Group All Rights Reserved.
     3  #
     4  # SPDX-License-Identifier: Apache-2.0
     5  
     6  GOTOOLS = counterfeiter ginkgo gocov gocov-xml goimports golint misspell mockery protoc-gen-go
     7  BUILD_DIR ?= build
     8  GOTOOLS_BINDIR ?= $(shell go env GOPATH)/bin
     9  
    10  # go tool->path mapping
    11  go.fqp.counterfeiter := github.com/maxbrunsfeld/counterfeiter/v6
    12  go.fqp.ginkgo        := github.com/onsi/ginkgo/ginkgo
    13  go.fqp.gocov         := github.com/axw/gocov/gocov
    14  go.fqp.gocov-xml     := github.com/AlekSi/gocov-xml
    15  go.fqp.goimports     := golang.org/x/tools/cmd/goimports
    16  go.fqp.golint        := golang.org/x/lint/golint
    17  go.fqp.misspell      := github.com/client9/misspell/cmd/misspell
    18  go.fqp.mockery       := github.com/vektra/mockery/cmd/mockery
    19  go.fqp.protoc-gen-go := github.com/golang/protobuf/protoc-gen-go
    20  
    21  .PHONY: gotools-install
    22  gotools-install: $(patsubst %,$(GOTOOLS_BINDIR)/%, $(GOTOOLS))
    23  
    24  .PHONY: gotools-clean
    25  gotools-clean:
    26  
    27  # Default rule for gotools uses the name->path map for a generic 'go get' style build
    28  gotool.%:
    29  	$(eval TOOL = ${subst gotool.,,${@}})
    30  	@echo "Building ${go.fqp.${TOOL}} -> $(TOOL)"
    31  	@cd tools && GO111MODULE=on GOBIN=$(abspath $(GOTOOLS_BINDIR)) go install ${go.fqp.${TOOL}}
    32  
    33  $(GOTOOLS_BINDIR)/%:
    34  	$(eval TOOL = ${subst $(GOTOOLS_BINDIR)/,,${@}})
    35  	@$(MAKE) -f gotools.mk gotool.$(TOOL)