blob: 3f25ae12f703678a06b8c8a2d8a18f0aa7385d4b [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
38# Directory used for temporary test files on the host.
Ian Rogers6a6d3c22014-07-23 08:03:36 -070039ifneq ($(TMPDIR),)
40ART_HOST_TEST_DIR := $(TMPDIR)/test-art-$(shell echo $$PPID)
41else
Andreas Gampe34a8a0f2016-07-20 21:09:29 -070042ART_HOST_TEST_DIR := /tmp/$(USER)/test-art-$(shell echo $$PPID)
Ian Rogers6a6d3c22014-07-23 08:03:36 -070043endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070044
Brian Carlstromab00b7a2015-06-19 22:05:35 -070045# core.oat location on the device.
Ian Rogersafd9acc2014-06-17 08:21:54 -070046TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$(DEX2OAT_TARGET_ARCH)/core.oat
47ifdef TARGET_2ND_ARCH
482ND_TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core.oat
49endif
50
Andreas Gampe63fc30e2014-10-24 21:58:16 -070051CORE_OAT_SUFFIX := .oat
52
Brian Carlstromab00b7a2015-06-19 22:05:35 -070053# core.oat locations under the out directory.
Andreas Gampe63fc30e2014-10-24 21:58:16 -070054HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070055ifneq ($(HOST_PREFER_32_BIT),true)
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700562ND_HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070057endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070058HOST_CORE_OAT_OUTS :=
59TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070060ifdef TARGET_2ND_ARCH
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700612ND_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 -070062endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070063TARGET_CORE_OAT_OUTS :=
64
65CORE_IMG_SUFFIX := .art
Ian Rogersafd9acc2014-06-17 08:21:54 -070066
Brian Carlstromab00b7a2015-06-19 22:05:35 -070067# core.art locations under the out directory.
Andreas Gampe63fc30e2014-10-24 21:58:16 -070068HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070069ifneq ($(HOST_PREFER_32_BIT),true)
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700702ND_HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070071endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070072HOST_CORE_IMG_OUTS :=
73TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core
Ian Rogersafd9acc2014-06-17 08:21:54 -070074ifdef TARGET_2ND_ARCH
Andreas Gampe63fc30e2014-10-24 21:58:16 -0700752ND_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 -070076endif
Andreas Gampe63fc30e2014-10-24 21:58:16 -070077TARGET_CORE_IMG_OUTS :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070078
79# Oat location of core.art.
80HOST_CORE_IMG_LOCATION := $(HOST_OUT_JAVA_LIBRARIES)/core.art
81TARGET_CORE_IMG_LOCATION := $(ART_TARGET_TEST_OUT)/core.art
82
83# Jar files for core.art.
Narayan Kamathcf662712016-01-05 14:33:58 +000084TARGET_CORE_JARS := core-oj core-libart conscrypt okhttp bouncycastle apache-xml
Ian Rogersafd9acc2014-06-17 08:21:54 -070085HOST_CORE_JARS := $(addsuffix -hostdex,$(TARGET_CORE_JARS))
86
87HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
Nicolas Geoffrayd8959612015-12-27 15:46:35 +000088ifeq ($(ART_TEST_ANDROID_ROOT),)
Ian Rogersafd9acc2014-06-17 08:21:54 -070089TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_JARS),/$(DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
Nicolas Geoffrayd8959612015-12-27 15:46:35 +000090else
91TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_JARS),$(ART_TEST_ANDROID_ROOT)/framework/$(jar).jar)
92endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070093
94HOST_CORE_DEX_FILES := $(foreach jar,$(HOST_CORE_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar)
95TARGET_CORE_DEX_FILES := $(foreach jar,$(TARGET_CORE_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar)
Sebastien Hertz19ac0272015-02-24 17:39:50 +010096
97# Classpath for Jack compilation: we only need core-libart.
Przemyslaw Szczepaniak121b25e2015-11-20 11:24:33 +000098HOST_JACK_CLASSPATH_DEPENDENCIES := $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj-hostdex,t,COMMON)/classes.jack $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart-hostdex,t,COMMON)/classes.jack
99HOST_JACK_CLASSPATH := $(abspath $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj-hostdex,t,COMMON)/classes.jack):$(abspath $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart-hostdex,t,COMMON)/classes.jack)
100TARGET_JACK_CLASSPATH_DEPENDENCIES := $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj, ,COMMON)/classes.jack $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart, ,COMMON)/classes.jack
101TARGET_JACK_CLASSPATH := $(abspath $(call intermediates-dir-for,JAVA_LIBRARIES,core-oj, ,COMMON)/classes.jack):$(abspath $(call intermediates-dir-for,JAVA_LIBRARIES,core-libart, ,COMMON)/classes.jack)
Sebastien Hertz2b763c32016-03-31 09:22:50 +0200102
Richard Uhlerc5a00042016-07-01 13:10:56 -0700103ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
104ART_TARGET_DEX_DEPENDENCIES := $(foreach jar,$(TARGET_CORE_JARS),$(TARGET_OUT_JAVA_LIBRARIES)/$(jar).jar)
105
Alex Light49948e92016-08-11 15:35:28 -0700106ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti
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))
108ifdef HOST_2ND_ARCH
109ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so)
110endif
111
112ART_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
113ifdef TARGET_2ND_ARCH
114ART_TARGET_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
115endif
116
Colin Cross31963602016-08-30 16:18:42 -0700117ART_CORE_EXECUTABLES := \
118 dex2oat \
119 imgdiag \
120 oatdump \
121 patchoat \
122 profman \
123
124# Depend on the -target or -host phony targets generated by the build system
125# for each module
126ART_TARGET_EXECUTABLES :=
127ifneq ($(ART_BUILD_TARGET_NDEBUG),false)
128ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)-target)
129endif
130ifneq ($(ART_BUILD_TARGET_DEBUG),false)
131ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)d-target)
132endif
133
134ART_HOST_EXECUTABLES :=
135ifneq ($(ART_BUILD_HOST_NDEBUG),false)
136ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)-host)
137endif
138ifneq ($(ART_BUILD_HOST_DEBUG),false)
139ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)d-host)
140endif
141
Igor Murashkin37743352014-11-13 14:38:00 -0800142endif # ART_ANDROID_COMMON_PATH_MK