tendermint/Makefile

75 lines
1.7 KiB
Makefile
Raw Normal View History

GOTOOLS = \
github.com/mitchellh/gox \
github.com/Masterminds/glide
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
BUILD_TAGS?=tendermint
2015-07-13 11:49:09 -07:00
TMROOT = $${TMROOT:-$$HOME/.tendermint}
all: install test
2015-07-13 11:49:09 -07:00
install: get_vendor_deps
@go install ./cmd/tendermint
2014-12-28 16:26:53 -08:00
build:
go build -o build/tendermint ./cmd/tendermint
build_race:
go build -race -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 go test"
2017-02-22 07:49:45 -08:00
@go test -p 1 $(PACKAGES)
test_race:
@echo "--> Running go test --race"
2017-02-22 07:49:45 -08:00
@go test -p 1 -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
test100:
@for i in {1..100}; do make test; done
2016-04-29 15:32:50 -07:00
draw_deps:
# requires brew install graphviz
go get github.com/hirokidaichi/goviz
goviz -i ./cmd/tendermint | dot -Tpng -o huge.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
get_vendor_deps: ensure_tools
@rm -rf vendor/
@echo "--> Running glide install"
@glide install
2016-07-05 12:40:53 -07:00
update_deps: tools
@echo "--> Updating dependencies"
@go get -d -u ./...
2016-02-15 17:29:52 -08:00
2015-07-10 08:50:58 -07:00
revision:
2015-09-24 12:48:44 -07:00
-echo `git rev-parse --verify HEAD` > $(TMROOT)/revision
-echo `git rev-parse --verify HEAD` >> $(TMROOT)/revision_history
tools:
go get -u -v $(GOTOOLS)
ensure_tools:
go get $(GOTOOLS)
.PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps revision tools