2017-01-22 06:03:20 -08:00
|
|
|
GOTOOLS = \
|
|
|
|
github.com/mitchellh/gox \
|
|
|
|
github.com/Masterminds/glide
|
|
|
|
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
|
|
|
BUILD_TAGS?=tendermint
|
2017-03-27 04:17:10 -07:00
|
|
|
TMHOME = $${TMHOME:-$$HOME/.tendermint}
|
2016-01-12 15:58:48 -08:00
|
|
|
|
2017-02-08 10:28:25 -08:00
|
|
|
all: install test
|
2015-07-13 11:49:09 -07:00
|
|
|
|
2017-02-08 10:28:25 -08:00
|
|
|
install: get_vendor_deps
|
2017-01-22 06:03:20 -08:00
|
|
|
@go install ./cmd/tendermint
|
2014-12-28 16:26:53 -08:00
|
|
|
|
2017-01-03 12:32:39 -08:00
|
|
|
build:
|
2017-01-22 06:03:20 -08:00
|
|
|
go build -o build/tendermint ./cmd/tendermint
|
2015-04-21 19:51:23 -07:00
|
|
|
|
2017-01-03 12:32:39 -08:00
|
|
|
build_race:
|
2017-01-22 06:03:20 -08:00
|
|
|
go build -race -o build/tendermint ./cmd/tendermint
|
2014-12-28 17:10:03 -08:00
|
|
|
|
2017-01-23 01:45:14 -08:00
|
|
|
# dist builds binaries for all platforms and packages them for distribution
|
|
|
|
dist:
|
|
|
|
@BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
|
|
|
|
|
2017-01-30 00:02:24 -08:00
|
|
|
test:
|
2017-01-22 06:03:20 -08:00
|
|
|
@echo "--> Running go test"
|
2017-02-22 11:01:32 -08:00
|
|
|
@go test $(PACKAGES)
|
2017-01-03 12:32:39 -08:00
|
|
|
|
2017-01-30 00:02:24 -08:00
|
|
|
test_race:
|
2017-01-22 06:03:20 -08:00
|
|
|
@echo "--> Running go test --race"
|
2017-02-22 11:01:32 -08:00
|
|
|
@go test -v -race $(PACKAGES)
|
2014-12-28 16:26:53 -08:00
|
|
|
|
2017-01-03 12:32:39 -08:00
|
|
|
test_integrations:
|
2017-01-22 06:03:20 -08:00
|
|
|
@bash ./test/test.sh
|
2016-07-23 09:48:30 -07:00
|
|
|
|
2017-01-30 00:02:24 -08:00
|
|
|
test100:
|
2017-01-22 06:03:20 -08:00
|
|
|
@for i in {1..100}; do make test; done
|
2016-04-29 15:32:50 -07:00
|
|
|
|
2015-05-16 14:41:36 -07:00
|
|
|
draw_deps:
|
|
|
|
# requires brew install graphviz
|
|
|
|
go get github.com/hirokidaichi/goviz
|
2017-01-22 06:03:20 -08:00
|
|
|
goviz -i ./cmd/tendermint | dot -Tpng -o huge.png
|
2015-05-16 14:41:36 -07:00
|
|
|
|
2014-12-28 16:26:53 -08:00
|
|
|
list_deps:
|
2017-01-22 06:03:20 -08:00
|
|
|
@go list -f '{{join .Deps "\n"}}' ./... | \
|
2016-06-11 20:14:44 -07:00
|
|
|
grep -v /vendor/ | sort | uniq | \
|
2017-01-22 06:03:20 -08:00
|
|
|
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)
|
2017-01-22 06:03:20 -08:00
|
|
|
@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
|
|
|
|
2017-02-08 10:28:25 -08:00
|
|
|
get_vendor_deps: ensure_tools
|
2017-01-22 06:03:20 -08:00
|
|
|
@rm -rf vendor/
|
|
|
|
@echo "--> Running glide install"
|
|
|
|
@glide install
|
2016-07-05 12:40:53 -07:00
|
|
|
|
2017-02-08 10:28:25 -08:00
|
|
|
update_deps: tools
|
2017-01-22 06:03:20 -08:00
|
|
|
@echo "--> Updating dependencies"
|
|
|
|
@go get -d -u ./...
|
2016-02-15 17:29:52 -08:00
|
|
|
|
2015-07-10 08:50:58 -07:00
|
|
|
revision:
|
2017-03-27 04:17:10 -07:00
|
|
|
-echo `git rev-parse --verify HEAD` > $(TMHOME)/revision
|
|
|
|
-echo `git rev-parse --verify HEAD` >> $(TMHOME)/revision_history
|
2017-01-22 06:03:20 -08:00
|
|
|
|
|
|
|
tools:
|
|
|
|
go get -u -v $(GOTOOLS)
|
|
|
|
|
2017-02-08 10:28:25 -08:00
|
|
|
ensure_tools:
|
|
|
|
go get $(GOTOOLS)
|
|
|
|
|
|
|
|
|
2017-01-22 06:03:20 -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 revision tools
|