Install boot.art image for host as well (used by ART tests).
This will allow us to remove the core.art image compiled in make.
Test: m test-art-host-gtest
Bug: 147817558
Bug: 147819342
Change-Id: Ie17e5818ddeb200843b13d36ade6d1a5428a9a48
diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 55eeec6..20b4051 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -18,9 +18,35 @@
ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT))
# Install boot images. Note that there can be multiple.
+my_boot_image_arch := TARGET_ARCH
+my_boot_image_out := $(PRODUCT_OUT)
+my_boot_image_syms := $(TARGET_OUT_UNSTRIPPED)
+my_boot_image_root := DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
-$(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ifdef TARGET_2ND_ARCH
+ my_boot_image_arch := TARGET_2ND_ARCH
+ my_boot_image_root := 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE
+ 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
+ $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+endif
+# Install boot images for testing on host. We exclude framework image as it is not part of art manifest.
+my_boot_image_arch := HOST_ARCH
+my_boot_image_out := $(HOST_OUT)
+my_boot_image_syms := $(HOST_OUT)/symbols
+my_boot_image_root := HOST_BOOT_IMAGE
+HOST_BOOT_IMAGE :=
+$(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+ifdef HOST_2ND_ARCH
+ my_boot_image_arch := HOST_2ND_ARCH
+ my_boot_image_root := 2ND_HOST_BOOT_IMAGE
+ 2ND_HOST_BOOT_IMAGE :=
+ $(foreach my_boot_image_name,art_host,$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
+endif
+my_boot_image_arch :=
+my_boot_image_out :=
+my_boot_image_syms :=
+my_boot_image_root :=
# Build the boot.zip which contains the boot jars and their compilation output
# We can do this only if preopt is enabled and if the product uses libart config (which sets the