You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

73 lines
1.7 KiB

9 years ago
9 years ago
  1. GOTOOLS = \
  2. github.com/mitchellh/gox \
  3. github.com/Masterminds/glide
  4. PACKAGES=$(shell go list ./... | grep -v '/vendor/')
  5. BUILD_TAGS?=tendermint
  6. TMROOT = $${TMROOT:-$$HOME/.tendermint}
  7. all: install test
  8. install: get_vendor_deps
  9. @go install ./cmd/tendermint
  10. build:
  11. go build -o build/tendermint ./cmd/tendermint
  12. build_race:
  13. go build -race -o build/tendermint ./cmd/tendermint
  14. # dist builds binaries for all platforms and packages them for distribution
  15. dist:
  16. @BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
  17. test:
  18. @echo "--> Running go test"
  19. @go test -v $(PACKAGES)
  20. test_race:
  21. @echo "--> Running go test --race"
  22. @go test -v -race $(PACKAGES)
  23. test_integrations:
  24. @bash ./test/test.sh
  25. test100:
  26. @for i in {1..100}; do make test; done
  27. draw_deps:
  28. # requires brew install graphviz
  29. go get github.com/hirokidaichi/goviz
  30. goviz -i ./cmd/tendermint | dot -Tpng -o huge.png
  31. list_deps:
  32. @go list -f '{{join .Deps "\n"}}' ./... | \
  33. grep -v /vendor/ | sort | uniq | \
  34. xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
  35. get_deps:
  36. @go get -d $(PACKAGES)
  37. @go list -f '{{join .TestImports "\n"}}' ./... | \
  38. grep -v /vendor/ | sort | uniq | \
  39. xargs go get -d
  40. get_vendor_deps: ensure_tools
  41. @rm -rf vendor/
  42. @echo "--> Running glide install"
  43. @glide install
  44. update_deps: tools
  45. @echo "--> Updating dependencies"
  46. @go get -d -u ./...
  47. revision:
  48. -echo `git rev-parse --verify HEAD` > $(TMROOT)/revision
  49. -echo `git rev-parse --verify HEAD` >> $(TMROOT)/revision_history
  50. tools:
  51. go get -u -v $(GOTOOLS)
  52. ensure_tools:
  53. go get $(GOTOOLS)
  54. .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