tendermint/Makefile

117 lines
2.9 KiB
Makefile
Raw Normal View History

GOTOOLS = \
github.com/mitchellh/gox \
2017-09-26 03:46:36 -07:00
github.com/tcnksm/ghr \
github.com/alecthomas/gometalinter
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
BUILD_TAGS?=tendermint
2017-03-27 04:17:10 -07:00
TMHOME = $${TMHOME:-$$HOME/.tendermint}
BUILD_FLAGS = -ldflags "-X github.com/tendermint/tendermint/version.GitCommit=`git rev-parse --short HEAD`"
all: get_vendor_deps install test
2015-07-13 11:49:09 -07:00
install:
CGO_ENABLED=0 go install $(BUILD_FLAGS) ./cmd/tendermint
2014-12-28 16:26:53 -08:00
build:
CGO_ENABLED=0 go build $(BUILD_FLAGS) -o build/tendermint ./cmd/tendermint/
build_race:
CGO_ENABLED=0 go build -race $(BUILD_FLAGS) -o build/tendermint ./cmd/tendermint
2014-12-28 17:10:03 -08:00
# dist builds binaries for all platforms and packages them for distribution
dist:
@BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
test:
@echo "--> Running linter"
@make metalinter_test
@echo "--> Running go test"
@go test $(PACKAGES)
test_race:
@echo "--> Running go test --race"
@go test -v -race $(PACKAGES)
2014-12-28 16:26:53 -08:00
test_integrations:
@bash ./test/test.sh
2016-07-23 09:48:30 -07:00
2017-12-04 15:37:32 -08:00
test_release:
@go test -tags release $(PACKAGES)
test100:
@for i in {1..100}; do make test; done
2016-04-29 15:32:50 -07:00
draw_deps:
# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
2014-12-28 16:26:53 -08:00
list_deps:
@go list -f '{{join .Deps "\n"}}' ./... | \
2016-06-11 20:14:44 -07:00
grep -v /vendor/ | sort | uniq | \
xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
2014-12-28 16:26:53 -08:00
get_deps:
2017-02-24 01:30:46 -08:00
@echo "--> Running go get"
@go get -v -d $(PACKAGES)
@go list -f '{{join .TestImports "\n"}}' ./... | \
2016-06-11 20:14:44 -07:00
grep -v /vendor/ | sort | uniq | \
2017-02-24 01:30:46 -08:00
xargs go get -v -d
2015-03-16 03:51:24 -07:00
update_deps:
@echo "--> Updating dependencies"
@go get -d -u ./...
get_vendor_deps:
@hash glide 2>/dev/null || go get github.com/Masterminds/glide
@rm -rf vendor/
@echo "--> Running glide install"
@glide install
2016-07-05 12:40:53 -07:00
update_tools:
@echo "--> Updating tools"
@go get -u $(GOTOOLS)
tools:
@echo "--> Installing tools"
@go get $(GOTOOLS)
@gometalinter --install
### Formatting, linting, and vetting
2017-11-29 11:18:34 -08:00
metalinter:
2017-10-03 17:30:28 -07:00
@gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
2017-11-29 11:18:34 -08:00
metalinter_test:
2017-10-03 17:30:28 -07:00
@gometalinter --vendor --deadline=600s --disable-all \
--enable=deadcode \
--enable=misspell \
--enable=safesql \
./...
2017-11-29 11:18:34 -08:00
# --enable=gas \
2017-10-26 16:24:18 -07:00
#--enable=maligned \
#--enable=dupl \
2017-10-14 11:38:47 -07:00
#--enable=errcheck \
#--enable=goconst \
#--enable=gocyclo \
2017-10-03 15:49:20 -07:00
#--enable=goimports \
#--enable=golint \ <== comments on anything exported
2017-11-09 10:59:35 -08:00
#--enable=gosimple \
2017-10-03 16:11:55 -07:00
#--enable=gotype \
2017-10-28 08:07:59 -07:00
#--enable=ineffassign \
#--enable=interfacer \
#--enable=megacheck \
#--enable=staticcheck \
2017-11-09 10:59:35 -08:00
#--enable=structcheck \
#--enable=unconvert \
#--enable=unparam \
#--enable=unused \
2017-11-09 10:59:35 -08:00
#--enable=varcheck \
#--enable=vet \
#--enable=vetshadow \
2017-12-04 15:37:32 -08:00
.PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps update_tools tools test_release