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/[email protected] @go install github.com/golangci/golangci-lint/cmd/[email protected] @go install github.com/goware/[email protected] @go install github.com/grpc-ecosystem/grpc-gateway/[email protected] .PHONY: tools test proto-lint proto-gen mod-vendor go-lint install