summaryrefslogtreecommitdiffstats
path: root/core/definitions.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/definitions.mk')
-rw-r--r--core/definitions.mk41
1 files changed, 41 insertions, 0 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 6ee99bb..c236c0e 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -236,6 +236,19 @@ $(patsubst ./%,%, \
endef
###########################################################
+## Find all of the .proto files under the named directories.
+## Meant to be used like:
+## SRC_FILES := $(call all-proto-files-under,src)
+###########################################################
+
+define all-proto-files-under
+$(patsubst ./%,%, \
+ $(shell cd $(LOCAL_PATH) ; \
+ find $(1) -name "*.proto" -and -not -name ".*") \
+ )
+endef
+
+###########################################################
## Find all of the RenderScript files under the named directories.
## Meant to be used like:
## SRC_FILES := $(call all-renderscript-files-under,src)
@@ -805,6 +818,34 @@ endef
###########################################################
+## Commands for running protoc to compile .proto into .java
+###########################################################
+
+define transform-proto-to-java
+@mkdir -p $(dir $@)
+@echo "Protoc: $@ <= $(PRIVATE_PROTO_SRC_FILES)"
+@rm -rf $(PRIVATE_PROTO_JAVA_OUTPUT_DIR)
+@mkdir -p $(PRIVATE_PROTO_JAVA_OUTPUT_DIR)
+$(hide) $(PROTOC) \
+ $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
+ $(PRIVATE_PROTO_JAVA_OUTPUT_OPTION)=$(PRIVATE_PROTO_JAVA_OUTPUT_DIR) \
+ $(PRIVATE_PROTO_SRC_FILES)
+$(hide) touch $@
+endef
+
+######################################################################
+## Commands for running protoc to compile .proto into .pb.cc and .pb.h
+######################################################################
+define transform-proto-to-cc
+@mkdir -p $(dir $@)
+@echo "Protoc: $@ <= $<"
+$(hide) $(PROTOC) \
+ $(addprefix --proto_path=, $(PRIVATE_PROTO_INCLUDES)) \
+ --cpp_out=$(PRIVATE_PROTO_CC_OUTPUT_DIR) $<
+endef
+
+
+###########################################################
## Commands for running gcc to compile a C++ file
###########################################################