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.

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