blob: df35bd8fb3d123fe37f0aa12442ae13c72f4d8f8 [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001#
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 Murashkin37743352014-11-13 14:38:00 -080017ifndef ART_ANDROID_COMMON_PATH_MK
18ART_ANDROID_COMMON_PATH_MK := true
Ian Rogersafd9acc2014-06-17 08:21:54 -070019
20include art/build/Android.common.mk
Colin Cross31963602016-08-30 16:18:42 -070021include art/build/Android.common_build.mk
Ian Rogersafd9acc2014-06-17 08:21:54 -070022
23# Directory used for dalvik-cache on device.
24ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache
25
26# Directory used for gtests on device.
Andreas Gampe1fe5e5c2014-07-11 21:14:35 -070027# $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on
28# the host, so we can strip everything but the directory to find out whether it is "nativetest" or
29# "nativetest64."
30ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art
31
Ian Rogersafd9acc2014-06-17 08:21:54 -070032ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
33
34# Directory used for oat tests on device.
35ART_TARGET_TEST_DIR := /data/art-test
36ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test
37
Brian Carlstromab00b7a2015-06-19 22:05:35 -070038# core.oat location on the device.
Ian Rogersafd9acc2014-06-17 08:21:54 -070039TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$(DEX2OAT_TARGET_ARCH)/core.oat
40ifdef TARGET_2ND_ARCH
412ND_TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core.oat
42endif
43
Andreas Gampe63fc30e2014-10-24 21:58:16 -070044CORE_OAT_SUFFIX := .oat
45
Brian Carlstromab00b7a2015-06-19 22:05:35 -070046# core.oat locations under the out directory.
Andreas Gampe63fc30e2014-10-24 21:58:16 -070047HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070048ifneq ($(HOST_PREFER_32_BIT),true)
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700492ND_HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070050endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070051HOST_CORE_OAT_OUTS :=
52TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070053ifdef TARGET_2ND_ARCH
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700542ND_TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070055endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070056TARGET_CORE_OAT_OUTS :=
57
58CORE_IMG_SUFFIX := .art
Ian Rogersafd9acc2014-06-17 08:21:54 -070059
Brian Carlstromab00b7a2015-06-19 22:05:35 -070060# core.art locations under the out directory.
Andreas Gampe63fc30e2014-10-24 21:58:16 -070061HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070062ifneq ($(HOST_PREFER_32_BIT),true)
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700632ND_HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070064endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070065HOST_CORE_IMG_OUTS :=
66TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070067ifdef TARGET_2ND_ARCH
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700682ND_TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070069endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070070TARGET_CORE_IMG_OUTS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070071
72# Oat location of core.art.
73HOST_CORE_IMG_LOCATION := $(HOST_OUT_JAVA_LIBRARIES)/core.art
74TARGET_CORE_IMG_LOCATION := $(ART_TARGET_TEST_OUT)/core.art
75
Vladimir Marko0ace5632018-12-14 11:11:47 +000076# Modules to compile for core.art.
Victor Chang759845f2019-08-06 16:04:36 +010077CORE_IMG_JARS := core-oj core-libart core-icu4j okhttp bouncycastle apache-xml
Vladimir Marko0ace5632018-12-14 11:11:47 +000078HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS))
79TARGET_CORE_IMG_JARS := $(addsuffix -testdex,$(CORE_IMG_JARS))
80HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
81ifeq ($(ART_TEST_ANDROID_ROOT),)
Nicolas Geoffraya144c272019-02-20 12:03:53 +000082TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
Vladimir Marko0ace5632018-12-14 11:11:47 +000083else
84TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar)
85endif
86HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar)
87TARGET_CORE_IMG_DEX_FILES := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar)
88
89# Jar files for the boot class path for testing. Must start with CORE_IMG_JARS.
Vladimir Markobf68e572018-12-21 11:45:35 +000090TEST_CORE_JARS := $(CORE_IMG_JARS) conscrypt
Vladimir Marko7a85e702018-12-03 18:47:23 +000091HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(TEST_CORE_JARS))
92TARGET_TEST_CORE_JARS := $(addsuffix -testdex,$(TEST_CORE_JARS))
93HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_TEST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
Nicolas Geoffrayd8959612015-12-27 15:46:35 +000094ifeq ($(ART_TEST_ANDROID_ROOT),)
Nicolas Geoffraya144c272019-02-20 12:03:53 +000095TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
Nicolas Geoffrayd8959612015-12-27 15:46:35 +000096else
Vladimir Marko7a85e702018-12-03 18:47:23 +000097TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(ART_TEST_ANDROID_ROOT)/framework/$(jar).jar)
Nicolas Geoffrayd8959612015-12-27 15:46:35 +000098endif
Vladimir Marko7a85e702018-12-03 18:47:23 +000099HOST_CORE_DEX_FILES := $(foreach jar,$(HOST_TEST_CORE_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar)
100TARGET_CORE_DEX_FILES := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar)
Sebastien Hertz19ac0272015-02-24 17:39:50 +0100101
Vladimir Marko7a85e702018-12-03 18:47:23 +0000102ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
103ART_TARGET_DEX_DEPENDENCIES := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(TARGET_OUT_JAVA_LIBRARIES)/$(jar).jar)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700104
Victor Chang65ae6692019-10-11 14:17:21 +0100105ART_CORE_SHARED_LIBRARIES := libicu_jni libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti
Alex Light7b497ee2017-05-25 09:54:15 -0700106ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid
Richard Uhlerc5a00042016-07-01 13:10:56 -0700107ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION))
Alex Light7b497ee2017-05-25 09:54:15 -0700108ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION))
Richard Uhlerc5a00042016-07-01 13:10:56 -0700109ifdef HOST_2ND_ARCH
110ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so)
Alex Light7b497ee2017-05-25 09:54:15 -0700111ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700112endif
113
114ART_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Alex Light7b497ee2017-05-25 09:54:15 -0700115ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700116ifdef TARGET_2ND_ARCH
117ART_TARGET_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Alex Light7b497ee2017-05-25 09:54:15 -0700118ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700119endif
120
Colin Cross02a73352016-09-13 16:47:02 -0700121ART_CORE_DEBUGGABLE_EXECUTABLES := \
Colin Cross31963602016-08-30 16:18:42 -0700122 dex2oat \
Calin Juravle36eb3132017-01-13 16:32:38 -0800123 dexoptanalyzer \
Colin Cross31963602016-08-30 16:18:42 -0700124 imgdiag \
125 oatdump \
Colin Cross31963602016-08-30 16:18:42 -0700126 profman \
127
Colin Cross02a73352016-09-13 16:47:02 -0700128ART_CORE_EXECUTABLES := \
129 dalvikvm \
130 dexlist \
131
Colin Cross31963602016-08-30 16:18:42 -0700132# Depend on the -target or -host phony targets generated by the build system
133# for each module
Colin Cross02a73352016-09-13 16:47:02 -0700134ART_TARGET_EXECUTABLES :=
Colin Cross31963602016-08-30 16:18:42 -0700135ifneq ($(ART_BUILD_TARGET_NDEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700136ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-target)
Colin Cross31963602016-08-30 16:18:42 -0700137endif
138ifneq ($(ART_BUILD_TARGET_DEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700139ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-target)
Colin Cross31963602016-08-30 16:18:42 -0700140endif
141
Colin Cross02a73352016-09-13 16:47:02 -0700142ART_HOST_EXECUTABLES :=
Colin Cross31963602016-08-30 16:18:42 -0700143ifneq ($(ART_BUILD_HOST_NDEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700144ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-host)
Colin Cross31963602016-08-30 16:18:42 -0700145endif
146ifneq ($(ART_BUILD_HOST_DEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700147ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-host)
Colin Cross31963602016-08-30 16:18:42 -0700148endif
149
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100150# Release ART APEX, included by default in "user" builds.
151RELEASE_ART_APEX := com.android.art.release
152# Debug ART APEX, included by default in "userdebug" and "eng"
Roland Levillain8d5a2152019-07-02 19:40:28 +0100153# builds and used in ART device benchmarking.
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100154DEBUG_ART_APEX := com.android.art.debug
155# Testing ART APEX, used in ART device testing.
156TESTING_ART_APEX := com.android.art.testing
Roland Levillainf0b1de82019-07-02 19:25:58 +0100157
Igor Murashkin37743352014-11-13 14:38:00 -0800158endif # ART_ANDROID_COMMON_PATH_MK