Use dependency files generated by llvm-rs-cc

This was a regression since kati has been introduced. This CL
introduces include-depfile function to make it easier to write
Makefiles which work with both make and kati.

As ninja can handle only a single dependency file per a build
rule, now we merge multiple .d files generated by llvm-rs-cc
into a .d file.

Change-Id: Iaf64a8f0523ab98115837e6e06abd50f06620363
diff --git a/core/binary.mk b/core/binary.mk
index af8d747..5f7ba66 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -562,7 +562,7 @@
 	$(transform-renderscripts-to-cpp-and-bc)
 
 # include the dependency files (.d/.P) generated by llvm-rs-cc.
--include $(bc_dep_files:%.d=%.P)
+$(call include-depfile,$(RenderScript_file_stamp).P,$(RenderScript_file_stamp))
 
 LOCAL_INTERMEDIATE_TARGETS += $(RenderScript_file_stamp)
 
@@ -741,12 +741,8 @@
 # Thus we'll actually generate source for each architecture.
 $(foreach s,$(aidl_src),\
     $(eval $(call define-aidl-cpp-rule,$(s),$(aidl_gen_cpp_root),aidl_gen_cpp)))
-ifeq ($(BUILDING_WITH_NINJA),true)
 $(foreach cpp,$(aidl_gen_cpp), \
-    $(eval $(cpp) : .KATI_DEPFILE := $(addsuffix .aidl.P,$(basename $(cpp)))))
-else
-  -include $(addsuffix .aidl.P,$(basename $(aidl_gen_cpp)))
-endif
+    $(call include-depfile,$(addsuffix .aidl.P,$(basename $(cpp))),$(cpp)))
 
 
 $(aidl_gen_cpp) : PRIVATE_MODULE := $(LOCAL_MODULE)