summaryrefslogtreecommitdiffstats
path: root/core/binary.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/binary.mk')
-rw-r--r--core/binary.mk29
1 files changed, 13 insertions, 16 deletions
diff --git a/core/binary.mk b/core/binary.mk
index e25fb31..7610dce 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -30,6 +30,15 @@ else
endif
endif
+# Many qcom modules don't correctly set a dependency on the kernel headers. Fix it for them,
+# but warn the user.
+ifneq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include,$(LOCAL_C_INCLUDES)))
+ ifeq (,$(findstring $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr,$(LOCAL_ADDITIONAL_DEPENDENCIES)))
+ $(warning $(LOCAL_MODULE) uses kernel headers, but does not depend on them!)
+ LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
+ endif
+endif
+
# The following LOCAL_ variables will be modified in this file.
# Because the same LOCAL_ variables may be used to define modules for both 1st arch and 2nd arch,
# we can't modify them in place.
@@ -542,9 +551,10 @@ define copy-proto-files
$(if $(PRIVATE_PROTOC_OUTPUT), \
$(if $(call streq,$(PRIVATE_PROTOC_INPUT),$(PRIVATE_PROTOC_OUTPUT)),, \
$(eval proto_generated_path := $(dir $(subst $(PRIVATE_PROTOC_INPUT),$(PRIVATE_PROTOC_OUTPUT),$@)))
+ $(eval proto_target_files := $(patsubst %.pb$(PRIVATE_PROTOC_SUFFIX), %.pb.*, $@))
@mkdir -p $(dir $(proto_generated_path))
- @echo "Protobuf relocation: $@ => $(proto_generated_path)"
- @cp -f $@ $(proto_generated_path) ),)
+ @echo "Protobuf relocation: $(proto_target_files) => $(proto_generated_path)"
+ @cp -f $(proto_target_files) $(proto_generated_path) ),)
endef
@@ -554,28 +564,15 @@ $(proto_generated_sources): PRIVATE_PROTO_INCLUDES := $(TOP)
$(proto_generated_sources): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS) $(my_protoc_flags)
$(proto_generated_sources): PRIVATE_PROTOC_OUTPUT := $(LOCAL_PROTOC_OUTPUT)
$(proto_generated_sources): PRIVATE_PROTOC_INPUT := $(LOCAL_PATH)
+$(proto_generated_sources): PRIVATE_PROTOC_SUFFIX := $(my_proto_source_suffix)
$(proto_generated_sources): $(proto_generated_sources_dir)/%.pb$(my_proto_source_suffix): %.proto $(PROTOC)
$(transform-proto-to-cc)
$(copy-proto-files)
# This is just a dummy rule to make sure gmake doesn't skip updating the dependents.
-$(proto_generated_headers): PRIVATE_PROTOC_OUTPUT := $(LOCAL_PROTOC_OUTPUT)
-$(proto_generated_headers): PRIVATE_PROTOC_INPUT := $(LOCAL_PATH)
$(proto_generated_headers): $(proto_generated_sources_dir)/%.pb.h: $(proto_generated_sources_dir)/%.pb$(my_proto_source_suffix)
@echo "Updated header file $@."
$(hide) touch $@
- $(copy-proto-files)
-
-$(if $(LOCAL_PROTOC_OUTPUT), \
-$(if $(call streq,$(LOCAL_PROTOC_OUTPUT),$(LOCAL_PATH)),, \
- $(eval proto_relocated_headers := $(subst $(LOCAL_PATH),$(LOCAL_PROTOC_OUTPUT),$(proto_generated_headers))) \
- ), )
-
-ifdef proto_relocated_headers
-$(proto_relocated_headers): $(proto_generated_headers)
- echo "Refreshed header file $@."
- $(hide) touch $@
-endif
$(my_prefix)_$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_proto_defined := true
endif # transform-proto-to-cc rule included only once