Make modules depend on their makefile.
This should obviate much of the need for cleanspecs, and also make it
unnecessary to continue adding LOCAL_ADDITIONAL_DEPENDENCIES for this
sort of thing all over the tree.
Change-Id: I97aa8fd280ae868a5f6364f8b7bf3c2fe235d6ce
diff --git a/core/binary.mk b/core/binary.mk
index 455c64b..9f17fd5 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -114,6 +114,7 @@
my_c_includes := $(LOCAL_C_INCLUDES)
my_generated_sources := $(LOCAL_GENERATED_SOURCES)
my_native_coverage := $(LOCAL_NATIVE_COVERAGE)
+my_additional_dependencies := $(LOCAL_MODULE_MAKEFILE) $(LOCAL_ADDITIONAL_DEPENDENCIES)
# MinGW spits out warnings about -fPIC even for -fpie?!) being ignored because
# all code is position independent, and then those warnings get promoted to
@@ -601,7 +602,7 @@
ifneq ($(strip $(y_yacc_cpps)),)
$(y_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(TOPDIR)$(LOCAL_PATH)/%.y \
- $(lex_cpps) $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(lex_cpps) $(my_additional_dependencies)
$(call transform-y-to-cpp,$(PRIVATE_CPP_EXTENSION))
$(yacc_headers): $(intermediates)/%.h: $(intermediates)/%$(LOCAL_CPP_EXTENSION)
endif
@@ -609,7 +610,7 @@
ifneq ($(strip $(yy_yacc_cpps)),)
$(yy_yacc_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(TOPDIR)$(LOCAL_PATH)/%.yy \
- $(lex_cpps) $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(lex_cpps) $(my_additional_dependencies)
$(call transform-y-to-cpp,$(PRIVATE_CPP_EXTENSION))
$(yacc_headers): $(intermediates)/%.h: $(intermediates)/%$(LOCAL_CPP_EXTENSION)
endif
@@ -653,7 +654,7 @@
$(lex_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
$(lex_objects): $(intermediates)/%.o: \
$(intermediates)/%$(LOCAL_CPP_EXTENSION) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES) \
+ $(my_additional_dependencies) \
$(yacc_headers)
$(transform-$(PRIVATE_HOST)cpp-to-o)
endif
@@ -681,7 +682,7 @@
$(cpp_objects): $(intermediates)/%.o: \
$(TOPDIR)$(LOCAL_PATH)/%$(LOCAL_CPP_EXTENSION) \
$(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)cpp-to-o)
-include $(cpp_objects:%.o=%.P)
endif
@@ -701,7 +702,7 @@
$(gen_cpp_objects): $(intermediates)/%.o: \
$(intermediates)/%$(LOCAL_CPP_EXTENSION) $(yacc_cpps) \
$(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)cpp-to-o)
-include $(gen_cpp_objects:%.o=%.P)
endif
@@ -715,7 +716,7 @@
ifneq ($(strip $(gen_S_sources)),)
$(gen_S_objects): $(intermediates)/%.o: $(intermediates)/%.S \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)s-to-o)
-include $(gen_S_objects:%.o=%.P)
endif
@@ -725,7 +726,7 @@
ifneq ($(strip $(gen_s_objects)),)
$(gen_s_objects): $(intermediates)/%.o: $(intermediates)/%.s \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)s-to-o-no-deps)
-include $(gen_s_objects:%.o=%.P)
endif
@@ -757,7 +758,7 @@
ifneq ($(strip $(c_objects)),)
$(c_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.c $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)c-to-o)
-include $(c_objects:%.o=%.P)
endif
@@ -775,7 +776,7 @@
$(gen_c_objects): PRIVATE_ARM_MODE := $(normal_objects_mode)
$(gen_c_objects): PRIVATE_ARM_CFLAGS := $(normal_objects_cflags)
$(gen_c_objects): $(intermediates)/%.o: $(intermediates)/%.c $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)c-to-o)
-include $(gen_c_objects:%.o=%.P)
endif
@@ -789,7 +790,7 @@
ifneq ($(strip $(objc_objects)),)
$(objc_objects): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.m $(yacc_cpps) $(proto_generated_headers) \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)m-to-o)
-include $(objc_objects:%.o=%.P)
endif
@@ -803,7 +804,7 @@
ifneq ($(strip $(asm_objects_S)),)
$(asm_objects_S): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.S \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)s-to-o)
-include $(asm_objects_S:%.o=%.P)
endif
@@ -813,7 +814,7 @@
ifneq ($(strip $(asm_objects_s)),)
$(asm_objects_s): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.s \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-$(PRIVATE_HOST)s-to-o-no-deps)
-include $(asm_objects_s:%.o=%.P)
endif
@@ -827,7 +828,7 @@
ifneq ($(strip $(asm_sources_asm)),)
asm_objects_asm := $(addprefix $(intermediates)/,$(asm_sources_asm:.asm=.o))
$(asm_objects_asm): $(intermediates)/%.o: $(TOPDIR)$(LOCAL_PATH)/%.asm \
- $(LOCAL_ADDITIONAL_DEPENDENCIES)
+ $(my_additional_dependencies)
$(transform-asm-to-o)
asm_objects += $(asm_objects_asm)