aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2018-08-14 13:13:47 -0700
committerColin Cross <ccross@android.com>2018-08-16 22:44:27 +0000
commita113745d1f15a358f427e9997490099e34807377 (patch)
tree394ef6422a2ca5d157367eb3ee0fcca16ae482f7
parentd8186f43a723c8600e13d6ab9d58014de4f484af (diff)
downloadbuild-a113745d1f15a358f427e9997490099e34807377.tar.gz
Track more static dependencies for notice files
Track transitive static dependencies of native binaries, and and direct and transitive static dependencies of java and app modules. Bug: 112331930 Test: m checkbuild Change-Id: I0e19971033d6254bfbb6555f0e68fd5e529569c6 Merged-In: I0e19971033d6254bfbb6555f0e68fd5e529569c6 (cherry picked from commit 579668b122d88b9c810238412ab003192bf15d2b)
-rw-r--r--core/binary.mk8
-rw-r--r--core/java_common.mk15
2 files changed, 18 insertions, 5 deletions
diff --git a/core/binary.mk b/core/binary.mk
index 954df1f445..61cd5cf73f 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -1587,6 +1587,9 @@ installed_static_library_notice_file_targets := \
$(foreach lib,$(my_static_libraries) $(my_whole_static_libraries), \
NOTICE-$(if $(LOCAL_IS_HOST_MODULE),HOST,TARGET)-STATIC_LIBRARIES-$(lib))
+$(notice_target): | $(installed_static_library_notice_file_targets)
+$(LOCAL_INSTALLED_MODULE): | $(notice_target)
+
# Default is -fno-rtti.
ifeq ($(strip $(LOCAL_RTTI_FLAG)),)
LOCAL_RTTI_FLAG := -fno-rtti
@@ -1783,11 +1786,6 @@ all_libraries := \
$(built_static_libraries) \
$(built_whole_libraries)
-# Also depend on the notice files for any static libraries that
-# are linked into this module. This will force them to be installed
-# when this module is.
-$(LOCAL_INSTALLED_MODULE): | $(installed_static_library_notice_file_targets)
-
###########################################################
# Export includes
###########################################################
diff --git a/core/java_common.mk b/core/java_common.mk
index 2b85dc145b..8f4611eed5 100644
--- a/core/java_common.mk
+++ b/core/java_common.mk
@@ -422,6 +422,21 @@ $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SHARED_JAVA_HEADER_LIBRARIES := $(full_sh
ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR := \
$(ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR) $(LOCAL_INTERMEDIATE_SOURCE_DIR)
+
+##########################################################
+# Copy NOTICE files of transitive static dependencies
+# Don't do this in mm, since many of the targets won't exist.
+ifeq ($(ONE_SHOT_MAKEFILE),)
+installed_static_library_notice_file_targets := \
+ $(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
+ NOTICE-$(if $(LOCAL_IS_HOST_MODULE),HOST,TARGET)-JAVA_LIBRARIES-$(lib))
+else
+installed_static_library_notice_file_targets :=
+endif
+
+$(notice_target): | $(installed_static_library_notice_file_targets)
+$(LOCAL_INSTALLED_MODULE): | $(notice_target)
+
###########################################################
# Verify that all libraries are safe to use
###########################################################