2010-09-18 01:36:06 +02:00
|
|
|
####################################
|
2013-11-15 08:44:56 +01:00
|
|
|
# dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time
|
2010-09-18 01:36:06 +02:00
|
|
|
#
|
|
|
|
####################################
|
|
|
|
|
2018-11-17 06:26:33 +01:00
|
|
|
include $(BUILD_SYSTEM)/dex_preopt_config.mk
|
2016-06-16 23:47:10 +02:00
|
|
|
|
2017-03-24 15:45:59 +01:00
|
|
|
# Method returning whether the install path $(1) should be for system_other.
|
2017-06-16 19:24:54 +02:00
|
|
|
# Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan.
|
|
|
|
ifeq ($(SANITIZE_LITE),true)
|
|
|
|
install-on-system-other =
|
|
|
|
else
|
2017-06-12 16:19:16 +02:00
|
|
|
install-on-system-other = $(filter-out $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(basename $(notdir $(filter $(foreach f,$(SYSTEM_OTHER_ODEX_FILTER),$(TARGET_OUT)/$(f)),$(1)))))
|
2017-06-16 19:24:54 +02:00
|
|
|
endif
|
2017-03-24 15:45:59 +01:00
|
|
|
|
2019-04-05 18:49:56 +02:00
|
|
|
# We want to install the profile even if we are not using preopt since it is required to generate
|
|
|
|
# the image on the device.
|
|
|
|
ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT))
|
|
|
|
|
2019-02-22 16:33:23 +01:00
|
|
|
# Install boot images. Note that there can be multiple.
|
|
|
|
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))
|
2010-09-18 01:36:06 +02:00
|
|
|
|
2019-04-16 22:05:42 +02:00
|
|
|
# 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
|
|
|
|
# default properties for preopting).
|
|
|
|
ifeq ($(WITH_DEXPREOPT), true)
|
2019-05-02 00:34:47 +02:00
|
|
|
ifeq ($(PRODUCT_USES_DEFAULT_ART_CONFIG), true)
|
2019-04-16 22:05:42 +02:00
|
|
|
|
|
|
|
boot_zip := $(PRODUCT_OUT)/boot.zip
|
2019-02-20 21:39:57 +01:00
|
|
|
bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
|
|
|
|
system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar)
|
2018-05-10 20:33:27 +02:00
|
|
|
|
2019-04-16 22:05:42 +02:00
|
|
|
$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
|
|
|
|
$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
|
2019-12-05 01:50:17 +01:00
|
|
|
$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
|
2019-04-16 22:05:42 +02:00
|
|
|
@echo "Create boot package: $@"
|
2018-05-10 20:33:27 +02:00
|
|
|
rm -f $@
|
2019-04-16 22:05:42 +02:00
|
|
|
$(SOONG_ZIP) -o $@.tmp \
|
2019-02-20 21:39:57 +01:00
|
|
|
-C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
|
|
|
|
-C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS))
|
2019-12-05 01:50:17 +01:00
|
|
|
$(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
|
2019-04-16 22:05:42 +02:00
|
|
|
rm -f $@.tmp
|
2018-05-10 20:33:27 +02:00
|
|
|
|
2019-04-16 22:05:42 +02:00
|
|
|
$(call dist-for-goals, droidcore, $(boot_zip))
|
|
|
|
|
2019-05-02 00:34:47 +02:00
|
|
|
endif #PRODUCT_USES_DEFAULT_ART_CONFIG
|
2019-04-16 22:05:42 +02:00
|
|
|
endif #WITH_DEXPREOPT
|