Merge "Use legacy-test instead of core-junit"
diff --git a/core/base_rules.mk b/core/base_rules.mk
index e9d9c33..0cdaabd 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -161,6 +161,7 @@
 else
 my_module_path := $(strip $(LOCAL_MODULE_PATH))
 endif
+my_module_path := $(patsubst %/,%,$(my_module_path))
 my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
 ifeq ($(my_module_path),)
   ifdef LOCAL_IS_HOST_MODULE
@@ -553,16 +554,26 @@
 endif
 ifdef LOCAL_IS_HOST_MODULE
 h_or_t := host
+ifeq ($(my_host_cross),true)
+h_or_hc_or_t := host-cross
 else
+h_or_hc_or_t := host
+endif
+else
+h_or_hc_or_t := target
 h_or_t := target
 endif
 
+
 ifdef j_or_n
 $(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module)
 ifneq (,$(filter $(my_module_tags),tests))
 $(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module)
 endif
-$(LOCAL_MODULE)-$(h_or_t) : $(my_all_targets)
+$(LOCAL_MODULE)-$(h_or_hc_or_t) : $(my_all_targets)
+ifeq ($(j_or_n),native)
+$(LOCAL_MODULE)-$(h_or_hc_or_t)$(my_32_64_bit_suffix) : $(my_all_targets)
+endif
 endif
 
 ###########################################################
diff --git a/core/notice_files.mk b/core/notice_files.mk
index f0013c2..8a0ae6f 100644
--- a/core/notice_files.mk
+++ b/core/notice_files.mk
@@ -33,7 +33,7 @@
 # compliance.
 # Includes the leading slash
 ifdef LOCAL_INSTALLED_MODULE
-  module_installed_filename := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
+  module_installed_filename := $(patsubst $(PRODUCT_OUT)/%,%,$(LOCAL_INSTALLED_MODULE))
 else
   # This module isn't installable
   ifeq ($(LOCAL_MODULE_CLASS),STATIC_LIBRARIES)
@@ -41,7 +41,7 @@
     # We can't use xxx_OUT_STATIC_LIBRARIES because it points into
     # device-obj or host-obj.
     module_installed_filename := \
-        $(patsubst $(PRODUCT_OUT)%,%,$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT_SHARED_LIBRARIES))/$(notdir $(LOCAL_BUILT_MODULE))
+        $(patsubst $(PRODUCT_OUT)/%,%,$($(LOCAL_2ND_ARCH_VAR_PREFIX)$(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.
@@ -53,7 +53,7 @@
         module_leaf := $(LOCAL_MODULE).jar
       endif
       module_installed_filename := \
-          $(patsubst $(PRODUCT_OUT)%,%,$($(my_prefix)OUT_JAVA_LIBRARIES))/$(module_leaf)
+          $(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
@@ -61,8 +61,8 @@
 endif
 
 # In case it's actually a host file
-module_installed_filename := $(patsubst $(HOST_OUT)%,%,$(module_installed_filename))
-module_installed_filename := $(patsubst $(HOST_CROSS_OUT)%,%,$(module_installed_filename))
+module_installed_filename := $(patsubst $(HOST_OUT)/%,%,$(module_installed_filename))
+module_installed_filename := $(patsubst $(HOST_CROSS_OUT)/%,%,$(module_installed_filename))
 
 installed_notice_file := $($(my_prefix)OUT_NOTICE_FILES)/src/$(module_installed_filename).txt