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.

76 lines
2.0 KiB

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