Makefile 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. all: test testrace
  2. deps:
  3. go get -d -v google.golang.org/grpc/...
  4. updatedeps:
  5. go get -d -v -u -f google.golang.org/grpc/...
  6. testdeps:
  7. go get -d -v -t google.golang.org/grpc/...
  8. updatetestdeps:
  9. go get -d -v -t -u -f google.golang.org/grpc/...
  10. build: deps
  11. go build google.golang.org/grpc/...
  12. proto:
  13. @ if ! which protoc > /dev/null; then \
  14. echo "error: protoc not installed" >&2; \
  15. exit 1; \
  16. fi
  17. go get -u -v github.com/golang/protobuf/protoc-gen-go
  18. # use $$dir as the root for all proto files in the same directory
  19. for dir in $$(git ls-files '*.proto' | xargs -n1 dirname | uniq); do \
  20. protoc -I $$dir --go_out=plugins=grpc:$$dir $$dir/*.proto; \
  21. done
  22. test: testdeps
  23. go test -v -cpu 1,4 google.golang.org/grpc/...
  24. testrace: testdeps
  25. go test -v -race -cpu 1,4 google.golang.org/grpc/...
  26. clean:
  27. go clean -i google.golang.org/grpc/...
  28. coverage: testdeps
  29. ./coverage.sh --coveralls
  30. .PHONY: \
  31. all \
  32. deps \
  33. updatedeps \
  34. testdeps \
  35. updatetestdeps \
  36. build \
  37. proto \
  38. test \
  39. testrace \
  40. clean \
  41. coverage