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.

108 lines
2.7 KiB

9 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
9 years ago
8 years ago
9 years ago
7 years ago
7 years ago
7 years ago
7 years ago
9 years ago
8 years ago
7 years ago
  1. GOTOOLS = \
  2. github.com/mitchellh/gox \
  3. github.com/Masterminds/glide \
  4. github.com/alecthomas/gometalinter \
  5. github.com/gogo/protobuf/protoc-gen-gogo \
  6. github.com/gogo/protobuf/gogoproto
  7. INCLUDE = -I=. -I=${GOPATH}/src -I=${GOPATH}/src/github.com/gogo/protobuf/protobuf
  8. all: protoc install test metalinter
  9. PACKAGES=$(shell go list ./... | grep -v '/vendor/')
  10. install_protoc:
  11. # https://github.com/google/protobuf/releases
  12. curl -L https://github.com/google/protobuf/releases/download/v3.4.1/protobuf-cpp-3.4.1.tar.gz | tar xvz && \
  13. cd protobuf-3.4.1 && \
  14. DIST_LANG=cpp ./configure && \
  15. make && \
  16. make install && \
  17. cd .. && \
  18. rm -rf protobuf-3.4.1
  19. protoc:
  20. ## Note to self:
  21. ## On "error while loading shared libraries: libprotobuf.so.14: cannot open shared object file: No such file or directory"
  22. ## ldconfig (may require sudo)
  23. ## https://stackoverflow.com/a/25518702
  24. protoc $(INCLUDE) --gogo_out=plugins=grpc:. types/*.proto
  25. install:
  26. @ go install ./cmd/...
  27. build:
  28. @ go build -i ./cmd/...
  29. dist:
  30. @ bash scripts/dist.sh
  31. @ bash scripts/publish.sh
  32. test:
  33. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  34. @ echo "==> Running go test"
  35. @ go test $(PACKAGES)
  36. test_race:
  37. @ find . -path ./vendor -prune -o -name "*.sock" -exec rm {} \;
  38. @ echo "==> Running go test --race"
  39. @ go test -v -race $(PACKAGES)
  40. test_integrations:
  41. @ bash test.sh
  42. fmt:
  43. @ go fmt ./...
  44. get_deps:
  45. @ go get -d $(PACKAGES)
  46. ensure_tools:
  47. go get -u -v $(GOTOOLS)
  48. @ gometalinter --install
  49. get_vendor_deps: ensure_tools
  50. @rm -rf vendor/
  51. @echo "--> Running glide install"
  52. @ glide install
  53. metalinter_all:
  54. gometalinter --vendor --deadline=600s --enable-all --disable=lll ./...
  55. metalinter:
  56. @ echo "==> Running linter"
  57. gometalinter --vendor --deadline=600s --disable-all \
  58. --enable=maligned \
  59. --enable=deadcode \
  60. --enable=goconst \
  61. --enable=goimports \
  62. --enable=gosimple \
  63. --enable=ineffassign \
  64. --enable=megacheck \
  65. --enable=misspell \
  66. --enable=staticcheck \
  67. --enable=safesql \
  68. --enable=structcheck \
  69. --enable=unconvert \
  70. --enable=unused \
  71. --enable=varcheck \
  72. --enable=vetshadow \
  73. ./...
  74. #--enable=gas \
  75. #--enable=dupl \
  76. #--enable=errcheck \
  77. #--enable=gocyclo \
  78. #--enable=golint \ <== comments on anything exported
  79. #--enable=gotype \
  80. #--enable=interfacer \
  81. #--enable=unparam \
  82. #--enable=vet \
  83. build-docker:
  84. docker build -t "tendermint/abci-dev" -f Dockerfile.develop .
  85. run-docker:
  86. docker run -it --rm -v "$PWD:/go/src/github.com/tendermint/abci" -w "/go/src/github.com/tendermint/abci" "tendermint/abci-dev" /bin/bash
  87. .PHONY: all build test fmt get_deps ensure_tools protoc install_protoc build-docker run-docker