Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 1 | #################################### |
Brian Carlstrom | ced4bff | 2013-11-14 23:44:56 -0800 | [diff] [blame] | 2 | # dexpreopt support - typically used on user builds to run dexopt (for Dalvik) or dex2oat (for ART) ahead of time |
Ying Wang | e7874c4 | 2010-09-17 16:36:06 -0700 | [diff] [blame] | 3 | # |
| 4 | #################################### |
| 5 | |
Colin Cross | 6db5b0e | 2018-11-16 21:26:33 -0800 | [diff] [blame] | 6 | include $(BUILD_SYSTEM)/dex_preopt_config.mk |
Alex Light | 4e358ab | 2016-06-16 14:47:10 -0700 | [diff] [blame] | 7 | |
Nicolas Geoffray | cdd4343 | 2017-03-24 14:45:59 +0000 | [diff] [blame] | 8 | # Method returning whether the install path $(1) should be for system_other. |
Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 9 | # Under SANITIZE_LITE, we do not want system_other. Just put things under /data/asan. |
| 10 | ifeq ($(SANITIZE_LITE),true) |
| 11 | install-on-system-other = |
| 12 | else |
Nicolas Geoffray | 4a0ad4a | 2017-06-12 15:19:16 +0100 | [diff] [blame] | 13 | 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))))) |
Andreas Gampe | 4ed21d1 | 2017-06-16 10:24:54 -0700 | [diff] [blame] | 14 | endif |
Nicolas Geoffray | cdd4343 | 2017-03-24 14:45:59 +0000 | [diff] [blame] | 15 | |
Nicolas Geoffray | 7e8ca9a | 2019-04-05 17:49:56 +0100 | [diff] [blame] | 16 | # 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. |
| 18 | ALL_DEFAULT_INSTALLED_MODULES += $(call copy-many-files,$(DEXPREOPT_IMAGE_PROFILE_BUILT_INSTALLED),$(PRODUCT_OUT)) |
| 19 | |
Nicolas Geoffray | 269bc74 | 2019-02-22 15:33:23 +0000 | [diff] [blame] | 20 | # Install boot images. Note that there can be multiple. |
David Srbecky | 6dd11ec | 2020-02-11 13:46:45 +0000 | [diff] [blame] | 21 | my_boot_image_arch := TARGET_ARCH |
| 22 | my_boot_image_out := $(PRODUCT_OUT) |
| 23 | my_boot_image_syms := $(TARGET_OUT_UNSTRIPPED) |
Yo Chiang | 3ca4980 | 2020-07-01 20:16:07 +0800 | [diff] [blame^] | 24 | DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \ |
| 25 | $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \ |
| 26 | $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \ |
| 27 | $(my_boot_image_module))) |
David Srbecky | 6dd11ec | 2020-02-11 13:46:45 +0000 | [diff] [blame] | 28 | ifdef TARGET_2ND_ARCH |
| 29 | my_boot_image_arch := TARGET_2ND_ARCH |
Yo Chiang | 3ca4980 | 2020-07-01 20:16:07 +0800 | [diff] [blame^] | 30 | 2ND_DEFAULT_DEX_PREOPT_INSTALLED_IMAGE_MODULE := \ |
| 31 | $(foreach my_boot_image_name,$(DEXPREOPT_IMAGE_NAMES),$(strip \ |
| 32 | $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \ |
| 33 | $(my_boot_image_module))) |
David Srbecky | 6dd11ec | 2020-02-11 13:46:45 +0000 | [diff] [blame] | 34 | endif |
| 35 | # Install boot images for testing on host. We exclude framework image as it is not part of art manifest. |
| 36 | my_boot_image_arch := HOST_ARCH |
| 37 | my_boot_image_out := $(HOST_OUT) |
| 38 | my_boot_image_syms := $(HOST_OUT)/symbols |
Yo Chiang | 3ca4980 | 2020-07-01 20:16:07 +0800 | [diff] [blame^] | 39 | HOST_BOOT_IMAGE_MODULE := \ |
| 40 | $(foreach my_boot_image_name,art_host,$(strip \ |
| 41 | $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \ |
| 42 | $(my_boot_image_module))) |
| 43 | HOST_BOOT_IMAGE := $(call module-installed-files,$(HOST_BOOT_IMAGE_MODULE)) |
David Srbecky | 6dd11ec | 2020-02-11 13:46:45 +0000 | [diff] [blame] | 44 | ifdef HOST_2ND_ARCH |
| 45 | my_boot_image_arch := HOST_2ND_ARCH |
Yo Chiang | 3ca4980 | 2020-07-01 20:16:07 +0800 | [diff] [blame^] | 46 | 2ND_HOST_BOOT_IMAGE_MODULE := \ |
| 47 | $(foreach my_boot_image_name,art_host,$(strip \ |
| 48 | $(eval include $(BUILD_SYSTEM)/dex_preopt_libart.mk) \ |
| 49 | $(my_boot_image_module))) |
| 50 | 2ND_HOST_BOOT_IMAGE := $(call module-installed-files,$(2ND_HOST_BOOT_IMAGE_MODULE)) |
David Srbecky | 6dd11ec | 2020-02-11 13:46:45 +0000 | [diff] [blame] | 51 | endif |
| 52 | my_boot_image_arch := |
| 53 | my_boot_image_out := |
| 54 | my_boot_image_syms := |
Yo Chiang | 3ca4980 | 2020-07-01 20:16:07 +0800 | [diff] [blame^] | 55 | my_boot_image_module := |
Brian Carlstrom | ced4bff | 2013-11-14 23:44:56 -0800 | [diff] [blame] | 56 | |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 57 | # Build the boot.zip which contains the boot jars and their compilation output |
| 58 | # We can do this only if preopt is enabled and if the product uses libart config (which sets the |
| 59 | # default properties for preopting). |
| 60 | ifeq ($(WITH_DEXPREOPT), true) |
Calin Juravle | cdff6b1 | 2019-05-01 15:34:47 -0700 | [diff] [blame] | 61 | ifeq ($(PRODUCT_USES_DEFAULT_ART_CONFIG), true) |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 62 | |
| 63 | boot_zip := $(PRODUCT_OUT)/boot.zip |
Colin Cross | d8badf5 | 2019-02-20 12:39:57 -0800 | [diff] [blame] | 64 | bootclasspath_jars := $(DEXPREOPT_BOOTCLASSPATH_DEX_FILES) |
| 65 | system_server_jars := $(foreach m,$(PRODUCT_SYSTEM_SERVER_JARS),$(PRODUCT_OUT)/system/framework/$(m).jar) |
Calin Juravle | 8955a99 | 2018-05-10 11:33:27 -0700 | [diff] [blame] | 66 | |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 67 | $(boot_zip): PRIVATE_BOOTCLASSPATH_JARS := $(bootclasspath_jars) |
| 68 | $(boot_zip): PRIVATE_SYSTEM_SERVER_JARS := $(system_server_jars) |
Calin Juravle | abdea21 | 2019-12-04 16:50:17 -0800 | [diff] [blame] | 69 | $(boot_zip): $(bootclasspath_jars) $(system_server_jars) $(SOONG_ZIP) $(MERGE_ZIPS) $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 70 | @echo "Create boot package: $@" |
Calin Juravle | 8955a99 | 2018-05-10 11:33:27 -0700 | [diff] [blame] | 71 | rm -f $@ |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 72 | $(SOONG_ZIP) -o $@.tmp \ |
Colin Cross | d8badf5 | 2019-02-20 12:39:57 -0800 | [diff] [blame] | 73 | -C $(dir $(firstword $(PRIVATE_BOOTCLASSPATH_JARS)))/.. $(addprefix -f ,$(PRIVATE_BOOTCLASSPATH_JARS)) \ |
| 74 | -C $(PRODUCT_OUT) $(addprefix -f ,$(PRIVATE_SYSTEM_SERVER_JARS)) |
Calin Juravle | abdea21 | 2019-12-04 16:50:17 -0800 | [diff] [blame] | 75 | $(MERGE_ZIPS) $@ $@.tmp $(DEXPREOPT_IMAGE_ZIP_boot) $(DEXPREOPT_IMAGE_ZIP_art) |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 76 | rm -f $@.tmp |
Calin Juravle | 8955a99 | 2018-05-10 11:33:27 -0700 | [diff] [blame] | 77 | |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 78 | $(call dist-for-goals, droidcore, $(boot_zip)) |
| 79 | |
Calin Juravle | cdff6b1 | 2019-05-01 15:34:47 -0700 | [diff] [blame] | 80 | endif #PRODUCT_USES_DEFAULT_ART_CONFIG |
Calin Juravle | 6bfdcda | 2019-04-16 13:05:42 -0700 | [diff] [blame] | 81 | endif #WITH_DEXPREOPT |