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 17ifndef ART_ANDROID_COMMON_PATH_MK 18ART_ANDROID_COMMON_PATH_MK := true 19 20include art/build/Android.common.mk 21include art/build/Android.common_build.mk 22 23# Directory used for dalvik-cache on device. 24ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache 25 26# Directory used for gtests on device. 27# $(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 32ART_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# core.oat location on the device. 39TARGET_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 44CORE_OAT_SUFFIX := .oat 45 46# core.oat locations under the out directory. 47HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core 48ifneq ($(HOST_PREFER_32_BIT),true) 492ND_HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core 50endif 51HOST_CORE_OAT_OUTS := 52TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core 53ifdef TARGET_2ND_ARCH 542ND_TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core 55endif 56TARGET_CORE_OAT_OUTS := 57 58CORE_IMG_SUFFIX := .art 59 60# core.art locations under the out directory. 61HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core 62ifneq ($(HOST_PREFER_32_BIT),true) 632ND_HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core 64endif 65HOST_CORE_IMG_OUTS := 66TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core 67ifdef TARGET_2ND_ARCH 682ND_TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core 69endif 70TARGET_CORE_IMG_OUTS := 71 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 76# Modules to compile for core.art. 77CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml 78HOST_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),) 82TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 83else 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. 90TEST_CORE_JARS := $(CORE_IMG_JARS) conscrypt 91HOST_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) 94ifeq ($(ART_TEST_ANDROID_ROOT),) 95TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 96else 97TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(ART_TEST_ANDROID_ROOT)/framework/$(jar).jar) 98endif 99HOST_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) 101 102ART_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) 104 105ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti 106ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid 107ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 108ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 109ifdef HOST_2ND_ARCH 110ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 111ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 112endif 113 114ART_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 115ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 116ifdef TARGET_2ND_ARCH 117ART_TARGET_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 118ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 119endif 120 121ART_CORE_DEBUGGABLE_EXECUTABLES := \ 122 dex2oat \ 123 dexoptanalyzer \ 124 imgdiag \ 125 oatdump \ 126 profman \ 127 128ART_CORE_EXECUTABLES := \ 129 dalvikvm \ 130 dexlist \ 131 132# Depend on the -target or -host phony targets generated by the build system 133# for each module 134ART_TARGET_EXECUTABLES := 135ifneq ($(ART_BUILD_TARGET_NDEBUG),false) 136ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-target) 137endif 138ifneq ($(ART_BUILD_TARGET_DEBUG),false) 139ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-target) 140endif 141 142ART_HOST_EXECUTABLES := 143ifneq ($(ART_BUILD_HOST_NDEBUG),false) 144ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-host) 145endif 146ifneq ($(ART_BUILD_HOST_DEBUG),false) 147ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-host) 148endif 149 150endif # ART_ANDROID_COMMON_PATH_MK 151