-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
52 lines (41 loc) · 1.69 KB
/
Makefile
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
47
48
49
50
51
52
PACKAGES := $(shell go list ./...)
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
TENDERMINT_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
MODVENDOR=modvendor
GOBIN = $(shell go env GOPATH)/bin
BUILD_TAGS := $(strip netgo,ledger)
LD_FLAGS := -s -w \
-X github.com/cosmos/cosmos-sdk/version.Name=Autonomy \
-X github.com/cosmos/cosmos-sdk/version.AppName=autonomy \
-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TENDERMINT_VERSION)
clean:
rm -rf ./bin ./vendor
install: mod-vendor
go install -mod=readonly -tags="${BUILD_TAGS}" -ldflags="${LD_FLAGS}" ./cmd/autonomy
build:
go build $(BUILD_FLAGS) -o ${GOBIN} ./cmd/autonomy
go-lint:
@golangci-lint run --fix
mod-vendor:
@go mod vendor
test:
@go test -mod=readonly -v -cover ${PACKAGES}
proto-gen:
@scripts/protocgen.sh
proto-lint:
@find proto -name *.proto -exec clang-format-12 -i {} \;
modvendor:
@echo "vendoring non-go files..."
$(MODVENDOR) -copy="**/*.proto" -include=\
github.com/cosmos/cosmos-sdk/proto,\
github.com/cosmos/cosmos-sdk/third_party/proto
tools:
@go install github.com/bufbuild/buf/cmd/buf@v0.37.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
@go install github.com/goware/modvendor@v0.3.0
@go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@v1.16.0
.PHONY: tools test proto-lint proto-gen mod-vendor go-lint install