aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2011-02-01 12:57:45 -0800
committerYing Wang <wangying@google.com>2011-03-23 12:01:49 -0700
commit3fd580d4e29657b812d3ab3c459487689a5f2da6 (patch)
tree9a5448b1392cc433098784b0ffd96e37efc67a29
parent080ed92e77fc7c24ca3bac1a1dc06057390bfdb8 (diff)
downloadbuild-3fd580d4e29657b812d3ab3c459487689a5f2da6.tar.gz
Fix dependency of prebuilt target non-static Java libraries.
Cherry-picked from Honeycomb to fix a dependency issue when building prebuilt shared library. Change-Id: I0a9cd3835b50dcc130a5f211e89d6bd22478fd42
-rw-r--r--core/prebuilt.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index b4717e0803..f5eebc889b 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -45,10 +45,20 @@ endif
ifeq ($(LOCAL_IS_HOST_MODULE)$(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
# for target java libraries, the LOCAL_BUILT_MODULE is in a product-specific dir,
# while the deps should be in the common dir, so we make a copy in the common dir.
-common_library_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),,COMMON)/$(notdir $(LOCAL_BUILT_MODULE))
-$(common_library_jar) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
+# For nonstatic library, $(common_javalib_jar) is the dependency file,
+# while $(common_classes_jar) is used to link.
+common_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,$(LOCAL_MODULE),,COMMON)/classes.jar
+common_javalib_jar := $(dir $(common_classes_jar))javalib.jar
+
+$(common_classes_jar) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
$(transform-prebuilt-to-target)
-endif
+
+$(common_javalib_jar) : $(common_classes_jar) | $(ACP)
+ $(transform-prebuilt-to-target)
+
+# make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE)
+$(LOCAL_BUILT_MODULE) : $(common_javalib_jar)
+endif # TARGET JAVA_LIBRARIES
ifeq ($(LOCAL_CERTIFICATE),EXTERNAL)
# The magic string "EXTERNAL" means this package will be signed with