blob: 55eeec663dce2940eef058183ad084b555ee5de4 [file] [log] [blame]
Ying Wange7874c42010-09-17 16:36:06 -07001####################################
Brian Carlstromced4bff2013-11-14 23:44:56 -08002# dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time
Ying Wange7874c42010-09-17 16:36:06 -07003#
4####################################
5
Colin Cross6db5b0e2018-11-16 21:26:33 -08006include $(BUILD_SYSTEM)/dex_preopt_config.mk
Alex Light4e358ab2016-06-16 14:47:10 -07007
Nicolas Geoffraycdd43432017-03-24 14:45:59 +00008# Method returning whether the install path $(1) should be for system_other.
Andreas Gampe4ed21d12017-06-16 10:24:54 -07009# Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan.
10ifeq ($(SANITIZE_LITE),true)
11install-on-system-other =
12else
Nicolas Geoffray4a0ad4a2017-06-12 15:19:16 +010013install-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)))))
Andreas Gampe4ed21d12017-06-16 10:24:54 -070014endif
Nicolas Geoffraycdd43432017-03-24 14:45:59 +000015
Nicolas Geoffray7e8ca9a2019-04-05 17:49:56 +010016# We want to install the profile even if we are not using preopt since it is required to generate
17# the image on the device.
18ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT))
19
Nicolas Geoffray269bc742019-02-22 15:33:23 +000020# Install boot images. Note that there can be multiple.
21DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
22$(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE :=
23$(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk))
Brian Carlstromced4bff2013-11-14 23:44:56 -080024
Calin Juravle6bfdcda2019-04-16 13:05:42 -070025# Build the boot.zip which contains the boot jars and their compilation output
26# We can do this only if preopt is enabled and if the product uses libart config (which sets the
27# default properties for preopting).
28ifeq ($(WITH_DEXPREOPT), true)
Calin Juravlecdff6b12019-05-01 15:34:47 -070029ifeq ($(PRODUCT_USES_DEFAULT_ART_CONFIG), true)
Calin Juravle6bfdcda2019-04-16 13:05:42 -070030
31boot_zip := $(PRODUCT_OUT)/boot.zip
Colin Crossd8badf52019-02-20 12:39:57 -080032bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES)
33system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar)
Calin Juravle8955a992018-05-10 11:33:27 -070034
Calin Juravle6bfdcda2019-04-16 13:05:42 -070035$(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars)
36$(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars)
Calin Juravleabdea212019-12-04 16:50:17 -080037$(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
Calin Juravle6bfdcda2019-04-16 13:05:42 -070038 @echo "Create boot package: $@"
Calin Juravle8955a992018-05-10 11:33:27 -070039 rm -f $@
Calin Juravle6bfdcda2019-04-16 13:05:42 -070040 $(SOONG_ZIP) -o $@.tmp \
Colin Crossd8badf52019-02-20 12:39:57 -080041 -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \
42 -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS))
Calin Juravleabdea212019-12-04 16:50:17 -080043 $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art)
Calin Juravle6bfdcda2019-04-16 13:05:42 -070044 rm -f $@.tmp
Calin Juravle8955a992018-05-10 11:33:27 -070045
Calin Juravle6bfdcda2019-04-16 13:05:42 -070046$(call dist-for-goals, droidcore, $(boot_zip))
47
Calin Juravlecdff6b12019-05-01 15:34:47 -070048endif #PRODUCT_USES_DEFAULT_ART_CONFIG
Calin Juravle6bfdcda2019-04-16 13:05:42 -070049endif #WITH_DEXPREOPT