From 3075254e73b113c1e4ce52936629fb73610a3e10 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sat, 1 Sep 2018 15:21:58 +0000 Subject: add Makefile for generating protobuf code Use proto-gen-go, any.proto and empty.proto from vendor/github.com/golang/protobuf. Signed-off-by: Mikael Magnusson --- Makefile | 25 +++++++++++++++++++++++++ api/google/protobuf/any.proto | 1 + api/google/protobuf/empty.proto | 1 + 3 files changed, 27 insertions(+) create mode 100755 Makefile create mode 120000 api/google/protobuf/any.proto create mode 120000 api/google/protobuf/empty.proto diff --git a/Makefile b/Makefile new file mode 100755 index 00000000..eb4a3f9e --- /dev/null +++ b/Makefile @@ -0,0 +1,25 @@ +# +# Use protoc-gen-go from pinned github.com/golang/protobuf. +# +PROTOC_GEN_GO_DIR:=vendor/github.com/golang/protobuf/protoc-gen-go +PROTOC_GEN_GO:=$(PROTOC_GEN_GO_DIR)/protoc-gen-go +PROTOCPLUGIN:=--plugin=$(PROTOC_GEN_GO) +PROTOCFLAGS:=$(PROTOCPLUGIN) --go_out=plugins=grpc:api -I api + +PROTOC_SRC:= \ + api/attribute.proto \ + api/capability.proto \ + api/gobgp.proto + +PROTOC_GEN:=$(PROTOC_SRC:.proto=.pb.go) + +all: $(PROTOC_GEN) + +maintainer-clean: + $(RM) $(PROTOC_GEN) + +$(PROTOC_GEN): $(PROTOC_GEN_GO) $(PROTOC_SRC) + protoc $(PROTOCFLAGS) $(PROTOC_SRC) + +$(PROTOC_GEN_GO): + cd $(PROTOC_GEN_GO_DIR) && go build diff --git a/api/google/protobuf/any.proto b/api/google/protobuf/any.proto new file mode 120000 index 00000000..5e37f873 --- /dev/null +++ b/api/google/protobuf/any.proto @@ -0,0 +1 @@ +../../../vendor/github.com/golang/protobuf/ptypes/any/any.proto \ No newline at end of file diff --git a/api/google/protobuf/empty.proto b/api/google/protobuf/empty.proto new file mode 120000 index 00000000..d4302c1b --- /dev/null +++ b/api/google/protobuf/empty.proto @@ -0,0 +1 @@ +../../../vendor/github.com/golang/protobuf/ptypes/empty/empty.proto \ No newline at end of file -- cgit v1.2.3