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.

74 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. TMHOME = $${TMHOME:-$$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 $(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. @echo "--> Running go get"
  37. @go get -v -d $(PACKAGES)
  38. @go list -f '{{join .TestImports "\n"}}' ./... | \
  39. grep -v /vendor/ | sort | uniq | \
  40. xargs go get -v -d
  41. get_vendor_deps: ensure_tools
  42. @rm -rf vendor/
  43. @echo "--> Running glide install"
  44. @glide install
  45. update_deps: tools
  46. @echo "--> Updating dependencies"
  47. @go get -d -u ./...
  48. revision:
  49. -echo `git rev-parse --verify HEAD` > $(TMHOME)/revision
  50. -echo `git rev-parse --verify HEAD` >> $(TMHOME)/revision_history
  51. tools:
  52. go get -u -v $(GOTOOLS)
  53. ensure_tools:
  54. go get $(GOTOOLS)
  55. .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