forked from drachtio/nuance-asr-grpc-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (26 loc) · 820 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Choose the output directory
OUTPUT ?= ./stubs
# Choose the target language.
LANGUAGE ?= cpp
# Choose grpc plugin
GRPCPLUGIN ?= /usr/local/bin/grpc_$(LANGUAGE)_plugin
# Choose the proto include directory.
PROTOINCLUDE ?= ./protos
# Choose protoc binary
PROTOC ?= protoc
# Compile the entire repository
#
# NOTE: if "protoc" command is not in the PATH, you need to modify this file.
#
FLAGS+= --proto_path=/usr/local/include:$(PROTOINCLUDE)
FLAGS+= --$(LANGUAGE)_out=$(OUTPUT) --grpc_out=$(OUTPUT)
FLAGS+= --plugin=protoc-gen-grpc=$(GRPCPLUGIN)
SUFFIX:= pb.cc
DEPS:= $(shell find $(PROTOINCLUDE) -type f -name '*.proto' | sed "s/proto$$/$(SUFFIX)/")
all: $(DEPS)
%.$(SUFFIX): %.proto
mkdir -p $(OUTPUT)
$(PROTOC) $(FLAGS) $*.proto
clean:
rm $(patsubst %,$(OUTPUT)/%,$(DEPS)) 2> /dev/null
rm -rd $(OUTPUT)