Fix the warning about NOTICE files overriding previous targets.
Use a different name for prebuilt libraries based on their LOCAL_MODULE --
they were all colliding using the same name, javalib.jar. These names
are synthetic, since the libraries don't actually exist on the device
as such.
diff --git a/core/notice_files.mk b/core/notice_files.mk
index 24295c7..fd76d51 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -20,12 +20,19 @@
# We can't use xxx_OUT_STATIC_LIBRARIES because it points into
# device-obj or host-obj.
module_installed_filename := \
- $(patsubst $(PRODUCT_OUT)%,%,$($(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
+ $(patsubst $(PRODUCT_OUT)%,%,$($(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
else
ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
# Stick the static java libraries with the regular java libraries.
+ module_leaf := $(notdir $(LOCAL_BUILT_MODULE))
+ # javalib.jar is the default name for the build module (and isn't meaningful)
+ # If that's what we have, substitute the module name instead. These files
+ # aren't included on the device, so this name is synthetic anyway.
+ ifeq ($(module_leaf),javalib.jar)
+ module_leaf := $(LOCAL_MODULE).jar
+ endif
module_installed_filename := \
- $(patsubst $(PRODUCT_OUT)%,%,$($(my_prefix)OUT_JAVA_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
+ $(patsubst $(PRODUCT_OUT)%,%,$($(my_prefix)OUT_JAVA_LIBRARIES))/$(module_leaf)
else
$(error Cannot determine where to install NOTICE file for $(LOCAL_MODULE))
endif # JAVA_LIBRARIES