Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 17 | ifndef ART_ANDROID_COMMON_PATH_MK |
| 18 | ART_ANDROID_COMMON_PATH_MK := true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 20 | # We cannot build things that require host core images from prebuilts, because |
| 21 | # they aren't present there. Set up a variable to skip all build rules that |
| 22 | # relate to them, because `m checkbuild` complains on rules with nonexisting |
| 23 | # dependencies, even if they won't get called. |
| 24 | # TODO(b/172480617): Remove this when ART sources are no longer in platform manifests. |
Cole Faust | 76aa34b | 2022-02-22 17:03:02 -0800 | [diff] [blame] | 25 | ifeq (true,$(ART_MODULE_BUILD_FROM_SOURCE)) |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 26 | my_art_module_source_build := true |
Cole Faust | 76aa34b | 2022-02-22 17:03:02 -0800 | [diff] [blame] | 27 | else ifeq (false,$(ART_MODULE_BUILD_FROM_SOURCE)) |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 28 | my_art_module_source_build := false |
| 29 | else |
Cole Faust | 76aa34b | 2022-02-22 17:03:02 -0800 | [diff] [blame] | 30 | $(error ART_MODULE_BUILD_FROM_SOURCE is neither true nor false - mk file ordering problem?) |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 31 | endif |
| 32 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 33 | ifeq (true,$(my_art_module_source_build)) |
| 34 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 35 | include art/build/Android.common.mk |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 36 | include art/build/Android.common_build.mk |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 37 | |
| 38 | # Directory used for dalvik-cache on device. |
| 39 | ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache |
| 40 | |
| 41 | # Directory used for gtests on device. |
Andreas Gampe | 1fe5e5c | 2014-07-11 21:14:35 -0700 | [diff] [blame] | 42 | # $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on |
| 43 | # the host, so we can strip everything but the directory to find out whether it is "nativetest" or |
| 44 | # "nativetest64." |
| 45 | ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art |
| 46 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 47 | ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art |
| 48 | |
| 49 | # Directory used for oat tests on device. |
| 50 | ART_TARGET_TEST_DIR := /data/art-test |
| 51 | ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test |
| 52 | |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 53 | # Modules to compile for core.art. |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 54 | CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 55 | HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) |
Nicolas Geoffray | 31e0dc2 | 2020-03-20 15:48:09 +0000 | [diff] [blame] | 56 | TARGET_CORE_IMG_JARS := $(CORE_IMG_JARS) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 57 | HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) |
| 58 | ifeq ($(ART_TEST_ANDROID_ROOT),) |
Nicolas Geoffray | a144c27 | 2019-02-20 12:03:53 +0000 | [diff] [blame] | 59 | TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 60 | else |
| 61 | TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar) |
| 62 | endif |
| 63 | HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) |
Nicolas Geoffray | 31e0dc2 | 2020-03-20 15:48:09 +0000 | [diff] [blame] | 64 | TARGET_CORE_IMG_DEX_FILES := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar).com.android.art.testing, ,COMMON)/javalib.jar) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 65 | |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 66 | # Also copy the jar files next to host boot.art image. |
Jiakai Zhang | b978419 | 2021-12-13 14:11:43 +0000 | [diff] [blame] | 67 | # `dexpreopt_bootjars.go` uses a single source of input regardless of variants, so we should use the |
| 68 | # same source for `CORE_IMG_JARS` to avoid checksum mismatches on the oat files. |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 69 | HOST_BOOT_IMAGE_JARS := $(foreach jar,$(CORE_IMG_JARS),$(HOST_OUT)/apex/com.android.art/javalib/$(jar).jar) |
Jiakai Zhang | b978419 | 2021-12-13 14:11:43 +0000 | [diff] [blame] | 70 | CORE_IMG_JAR_DIR := $(OUT_DIR)/soong/$(PRODUCT_DEVICE)/dex_artjars_input |
| 71 | $(HOST_BOOT_IMAGE_JARS): $(HOST_OUT)/apex/com.android.art/javalib/%.jar : $(CORE_IMG_JAR_DIR)/%.jar |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 72 | $(copy-file-to-target) |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 73 | |
Jiakai Zhang | b978419 | 2021-12-13 14:11:43 +0000 | [diff] [blame] | 74 | # We can still use the host variant of `conscrypt` and `core-icu4j` because they don't go into the |
| 75 | # primary boot image that is used in host gtests, and hence can't lead to checksum mismatches. |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 76 | HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar |
| 77 | $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar : $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar |
| 78 | $(copy-file-to-target) |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 79 | HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar |
| 80 | $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar : $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar |
| 81 | $(copy-file-to-target) |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 82 | |
David Srbecky | 42df1c7 | 2020-04-07 15:53:47 +0100 | [diff] [blame] | 83 | HOST_CORE_IMG_OUTS += $(HOST_BOOT_IMAGE_JARS) $(HOST_BOOT_IMAGE) $(2ND_HOST_BOOT_IMAGE) |
| 84 | |
Jiakai Zhang | c56152c | 2021-12-15 13:52:13 +0000 | [diff] [blame] | 85 | HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS) core-icu4j conscrypt) |
| 86 | ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 87 | ART_TARGET_DEX_DEPENDENCIES := com.android.art.testing com.android.conscrypt com.android.i18n |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 88 | |
Nikita Iashchenko | 0a110f3 | 2022-04-07 16:57:30 +0100 | [diff] [blame] | 89 | ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti libjdwp |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 90 | ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid |
Nicolas Geoffray | c69b3f8 | 2020-06-22 12:33:38 +0000 | [diff] [blame] | 91 | ART_HOST_CORE_SHARED_LIBRARIES := $(ART_CORE_SHARED_LIBRARIES) libicuuc-host libicui18n-host libicu_jni |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 92 | ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 93 | ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 94 | ifdef HOST_2ND_ARCH |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 95 | ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 96 | ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 97 | endif |
| 98 | |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 99 | # Both the primary and the secondary arches of the libs are built by depending |
| 100 | # on the module name. |
| 101 | ART_DEBUG_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(lib).com.android.art.debug) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 102 | ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 103 | ifdef TARGET_2ND_ARCH |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 104 | ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 105 | endif |
| 106 | |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 107 | ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON := \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 108 | dex2oat \ |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 109 | dexoptanalyzer \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 110 | imgdiag \ |
| 111 | oatdump \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 112 | profman \ |
| 113 | |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 114 | ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) odrefresh |
| 115 | ART_CORE_DEBUGGABLE_EXECUTABLES_HOST := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) |
| 116 | |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 117 | ART_CORE_EXECUTABLES := \ |
| 118 | dalvikvm \ |
| 119 | dexlist \ |
| 120 | |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 121 | # Depend on the -target or -host phony targets generated by the build system |
| 122 | # for each module |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 123 | ART_TARGET_EXECUTABLES := |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 124 | ifneq ($(ART_BUILD_TARGET_NDEBUG),false) |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 125 | ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)-target) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 126 | endif |
| 127 | ifneq ($(ART_BUILD_TARGET_DEBUG),false) |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 128 | ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)d-target) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 129 | endif |
| 130 | |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 131 | ART_HOST_EXECUTABLES := |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 132 | ifneq ($(ART_BUILD_HOST_NDEBUG),false) |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 133 | ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)-host) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 134 | endif |
| 135 | ifneq ($(ART_BUILD_HOST_DEBUG),false) |
Victor Hsieh | 7a3ccd0 | 2021-09-08 11:59:29 -0700 | [diff] [blame] | 136 | ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)d-host) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 137 | endif |
| 138 | |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 139 | # Release ART APEX, included by default in "user" builds. |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 140 | RELEASE_ART_APEX := com.android.art |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 141 | # Debug ART APEX, included by default in "userdebug" and "eng" |
Roland Levillain | 8d5a215 | 2019-07-02 19:40:28 +0100 | [diff] [blame] | 142 | # builds and used in ART device benchmarking. |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 143 | DEBUG_ART_APEX := com.android.art.debug |
| 144 | # Testing ART APEX, used in ART device testing. |
| 145 | TESTING_ART_APEX := com.android.art.testing |
Roland Levillain | f0b1de8 | 2019-07-02 19:25:58 +0100 | [diff] [blame] | 146 | |
Martin Stjernholm | 4bb9f67 | 2020-05-19 01:33:47 +0100 | [diff] [blame] | 147 | RUNTIME_APEX := com.android.runtime |
Orion Hodson | c4d13ae | 2020-01-07 12:46:25 +0000 | [diff] [blame] | 148 | CONSCRYPT_APEX := com.android.conscrypt |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 149 | I18N_APEX := com.android.i18n |
Martin Stjernholm | 4e01411 | 2021-03-08 14:24:44 +0000 | [diff] [blame] | 150 | STATSD_APEX := com.android.os.statsd |
Nicolas Geoffray | caac87a | 2021-01-11 09:51:03 +0000 | [diff] [blame] | 151 | TZDATA_APEX := com.android.tzdata |
Orion Hodson | c4d13ae | 2020-01-07 12:46:25 +0000 | [diff] [blame] | 152 | |
Nicolas Geoffray | 5ece8ff | 2020-07-29 18:20:59 +0100 | [diff] [blame] | 153 | # A phony file to create the ICU data file for host. |
Nicolas Geoffray | 1525960 | 2020-07-30 09:31:15 +0100 | [diff] [blame] | 154 | HOST_I18N_DATA := $(HOST_OUT)/$(I18N_APEX)/timestamp |
Nicolas Geoffray | caac87a | 2021-01-11 09:51:03 +0000 | [diff] [blame] | 155 | # A phony file to create the tz data file for host. |
| 156 | HOST_TZDATA_DATA := $(HOST_OUT)/$(TZDATA_APEX)/timestamp |
Nicolas Geoffray | 5ece8ff | 2020-07-29 18:20:59 +0100 | [diff] [blame] | 157 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame] | 158 | endif # ifeq (true,$(my_art_module_source_build)) |
| 159 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 160 | endif # ART_ANDROID_COMMON_PATH_MK |