add python and java support

This commit is contained in:
Gary Belvin 2015-06-02 18:31:34 -07:00
parent 2bf066e37f
commit 76c7365ed2
1 changed files with 10 additions and 4 deletions

View File

@ -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