Makefile 696 B

123456789101112131415161718192021
  1. GOFILES=$(shell find . -name "*.go" -type f)
  2. EXAMPLE_HELLOWORLD_DIR=examples/helloworld
  3. PROTO_FILE=$(EXAMPLE_HELLOWORLD_DIR)/api/helloworld.proto
  4. VENDOR_DIR=$(shell echo $$GOPATH | cut -d':' -f1)/src/go-common/vendor
  5. protoc-gen-bm: $(GOFILES)
  6. go install .
  7. protoc-gen-go: $(PROTO_FILE)
  8. protoc -I. -I$(VENDOR_DIR) --go_out=plugins=grpc:. $<
  9. examples-helloworld: $(PROTO_FILE) protoc-gen-bm protoc-gen-go
  10. protoc -I. -I$(VENDOR_DIR) --bm_out=logtostderr=1,v=10:. $<
  11. examples-helloworld-jsonpb: $(PROTO_FILE) protoc-gen-bm protoc-gen-go
  12. protoc -I. -I$(VENDOR_DIR) --bm_out=logtostderr=1,v=10,jsonpb=true:. $<
  13. test:
  14. go test ./...
  15. .PHONY: protoc-gen-bm protoc-gen-go examples-helloworld test