summaryrefslogtreecommitdiffstats
path: root/tools/aidl
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2013-08-23 16:50:13 -0700
committerYing Wang <wangying@google.com>2013-08-23 17:19:17 -0700
commit0f91c6360266be07bd0e32f7eca151fa1bca26c1 (patch)
treec81d368ca2d96a1336b28e7d3b0a1382366559e3 /tools/aidl
parent570cd0f4c06a6e3de2af348040415ff2fcff57a1 (diff)
downloadframeworks_base-0f91c6360266be07bd0e32f7eca151fa1bca26c1.zip
frameworks_base-0f91c6360266be07bd0e32f7eca151fa1bca26c1.tar.gz
frameworks_base-0f91c6360266be07bd0e32f7eca151fa1bca26c1.tar.bz2
Better aidl generated dependency
Previously if an imported aidl file has been deleted or moved, the generated dependency file still contains the stale file name, and make will fail with "No rule to make target <the deleted/moved file>". This change uses technique described in section "Automatic Dependency Generation", Chapter 8 of "Managing Projects with GNU Make (3d Edition)". The same technique is used by the Android platform build system to generate C/C++ header dependencies. Bug: 10459179 Change-Id: Ib0c01a4234ef1af994487fdc846cdf8d13a675f6
Diffstat (limited to 'tools/aidl')
-rw-r--r--tools/aidl/aidl.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/aidl/aidl.cpp b/tools/aidl/aidl.cpp
index 071a8d7..b8a4803 100644
--- a/tools/aidl/aidl.cpp
+++ b/tools/aidl/aidl.cpp
@@ -673,6 +673,16 @@ generate_dep_file(const Options& options, const document_item_type* items)
fprintf(to, "\n");
+ // Output "<imported_file>: " so make won't fail if the imported file has
+ // been deleted, moved or renamed in incremental build.
+ import = g_imports;
+ while (import) {
+ if (import->filename) {
+ fprintf(to, "%s :\n", import->filename);
+ }
+ import = import->next;
+ }
+
fclose(to);
}