add python and java support
This commit is contained in:
parent
2bf066e37f
commit
76c7365ed2
14
Makefile
14
Makefile
|
|
@ -27,13 +27,19 @@ else
|
|||
endif
|
||||
|
||||
ifeq ($(LANGUAGE),go)
|
||||
SUFFIX:= pb.go
|
||||
SUFFIX:= .pb.go
|
||||
endif
|
||||
ifeq ($(LANGUAGE),cpp)
|
||||
SUFFIX:= pb.cc
|
||||
SUFFIX:= .pb.cc
|
||||
endif
|
||||
ifeq ($(LANGUAGE),py)
|
||||
SUFFIX:= _pb2.py
|
||||
endif
|
||||
ifeq ($(LANGUAGE),java)
|
||||
SUFFIX:= .java
|
||||
endif
|
||||
|
||||
DEPS:= $(shell find . -type f -name '*.proto' | sed "s/proto$$/$(SUFFIX)/")
|
||||
DEPS:= $(shell find . -type f -name '*.proto' | sed "s/\.proto$$/$(SUFFIX)/")
|
||||
|
||||
all: supported_lang $(DEPS)
|
||||
|
||||
|
|
@ -42,7 +48,7 @@ ifndef SUFFIX
|
|||
$(error unsupported language: [$(LANGUAGE)])
|
||||
endif
|
||||
|
||||
%.$(SUFFIX): %.proto
|
||||
%$(SUFFIX): %.proto
|
||||
mkdir -p $(OUTPUT)
|
||||
protoc $(FLAGS) $(dir $<)*.proto
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue