-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.gotools
47 lines (34 loc) · 1.44 KB
/
Makefile.gotools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#
# Copyright 2020 Brightgate Inc.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
GOTOOLS_DIR=$(GITROOT)/_tools.$(GOHOSTARCH)
GOTOOLS_BIN=$(GOTOOLS_DIR)/bin
GOTOOLS_protobuf_repo=github.com/golang/protobuf
GOTOOLS_pgengo_pkg=$(GOTOOLS_protobuf_repo)/protoc-gen-go
GOTOOLS_BIN_PROTOCGENGO=$(GOTOOLS_BIN)/protoc-gen-go
GOTOOLS_SRC_protobuf=$(shell cd build/tools; go list -m -f '{{.Dir}}' $(GOTOOLS_protobuf_repo))
GOTOOLS_mockery_repo=github.com/vektra/mockery/v2
GOTOOLS_mockery_pkg=$(GOTOOLS_mockery_repo)/...
GOTOOLS_BIN_MOCKERY=$(GOTOOLS_BIN)/mockery
GOTOOLS_golangci_lint_repo=github.com/golangci/golangci-lint
GOTOOLS_golangci_lint_cmd=$(GOTOOLS_golangci_lint_repo)/cmd/golangci-lint
GOTOOLS_BIN_GOLANGCI_LINT=$(GOTOOLS_BIN)/golangci-lint
GOTOOLS = \
$(GOTOOLS_BIN_PROTOCGENGO) \
$(GOTOOLS_BIN_MOCKERY) \
$(GOTOOLS_BIN_GOLANGCI_LINT)
$(GOTOOLS_BIN)/%: export GOBIN=$(GOTOOLS_BIN)
$(GOTOOLS_BIN)/%: export GOARCH=
$(GOTOOLS_BIN_MOCKERY):
cd build/tools && $(GO) install $(GO_BUILD_FLAGS) $(GOTOOLS_mockery_pkg)
$(GOTOOLS_BIN_GOLANGCI_LINT):
cd build/tools && $(GO) install $(GO_BUILD_FLAGS) $(GOTOOLS_golangci_lint_cmd)
$(GOTOOLS_BIN_PROTOCGENGO):
cd build/tools && $(GO) install $(GO_BUILD_FLAGS) $(GOTOOLS_pgengo_pkg)
.PHONY: gotools-clobber
gotools-clobber:
$(RM) -fr $(GOTOOLS_DIR)