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 17 ifndef ART_ANDROID_COMMON_PATH_MK 18 ART_ANDROID_COMMON_PATH_MK := true 19 20 include art/build/Android.common.mk 21 include art/build/Android.common_build.mk 22 23 # Directory used for dalvik-cache on device. 24 ART_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." 30 ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art 31 32 ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art 33 34 # Directory used for oat tests on device. 35 ART_TARGET_TEST_DIR := /data/art-test 36 ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test 37 38 # core.oat location on the device. 39 TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$(DEX2OAT_TARGET_ARCH)/core.oat 40 ifdef TARGET_2ND_ARCH 41 2ND_TARGET_CORE_OAT := $(ART_TARGET_TEST_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core.oat 42 endif 43 44 CORE_OAT_SUFFIX := .oat 45 46 # core.oat locations under the out directory. 47 HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core 48 ifneq ($(HOST_PREFER_32_BIT),true) 49 2ND_HOST_CORE_OAT_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core 50 endif 51 HOST_CORE_OAT_OUTS := 52 TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core 53 ifdef TARGET_2ND_ARCH 54 2ND_TARGET_CORE_OAT_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core 55 endif 56 TARGET_CORE_OAT_OUTS := 57 58 CORE_IMG_SUFFIX := .art 59 60 # core.art locations under the out directory. 61 HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(ART_HOST_ARCH)/core 62 ifneq ($(HOST_PREFER_32_BIT),true) 63 2ND_HOST_CORE_IMG_OUT_BASE := $(HOST_OUT_JAVA_LIBRARIES)/$(2ND_ART_HOST_ARCH)/core 64 endif 65 HOST_CORE_IMG_OUTS := 66 TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$(DEX2OAT_TARGET_ARCH)/core 67 ifdef TARGET_2ND_ARCH 68 2ND_TARGET_CORE_IMG_OUT_BASE := $(ART_TARGET_TEST_OUT)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)/core 69 endif 70 TARGET_CORE_IMG_OUTS := 71 72 # Oat location of core.art. 73 HOST_CORE_IMG_LOCATION := $(HOST_OUT_JAVA_LIBRARIES)/core.art 74 TARGET_CORE_IMG_LOCATION := $(ART_TARGET_TEST_OUT)/core.art 75 76 # Modules to compile for core.art. 77 CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml 78 HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) 79 TARGET_CORE_IMG_JARS := $(addsuffix -testdex,$(CORE_IMG_JARS)) 80 HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 81 ifeq ($(ART_TEST_ANDROID_ROOT),) 82 TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 83 else 84 TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar) 85 endif 86 HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) 87 TARGET_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. 90 TEST_CORE_JARS := $(CORE_IMG_JARS) conscrypt 91 HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(TEST_CORE_JARS)) 92 TARGET_TEST_CORE_JARS := $(addsuffix -testdex,$(TEST_CORE_JARS)) 93 HOST_CORE_DEX_LOCATIONS := $(foreach jar,$(HOST_TEST_CORE_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 94 ifeq ($(ART_TEST_ANDROID_ROOT),) 95 TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 96 else 97 TARGET_CORE_DEX_LOCATIONS := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(ART_TEST_ANDROID_ROOT)/framework/$(jar).jar) 98 endif 99 HOST_CORE_DEX_FILES := $(foreach jar,$(HOST_TEST_CORE_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) 100 TARGET_CORE_DEX_FILES := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar), ,COMMON)/javalib.jar) 101 102 ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 103 ART_TARGET_DEX_DEPENDENCIES := $(foreach jar,$(TARGET_TEST_CORE_JARS),$(TARGET_OUT_JAVA_LIBRARIES)/$(jar).jar) 104 105 ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti 106 ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid 107 ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 108 ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 109 ifdef HOST_2ND_ARCH 110 ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 111 ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 112 endif 113 114 ART_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 115 ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 116 ifdef TARGET_2ND_ARCH 117 ART_TARGET_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 118 ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 119 endif 120 121 ART_CORE_DEBUGGABLE_EXECUTABLES := \ 122 dex2oat \ 123 dexoptanalyzer \ 124 imgdiag \ 125 oatdump \ 126 profman \ 127 128 ART_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 134 ART_TARGET_EXECUTABLES := 135 ifneq ($(ART_BUILD_TARGET_NDEBUG),false) 136 ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-target) 137 endif 138 ifneq ($(ART_BUILD_TARGET_DEBUG),false) 139 ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-target) 140 endif 141 142 ART_HOST_EXECUTABLES := 143 ifneq ($(ART_BUILD_HOST_NDEBUG),false) 144 ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-host) 145 endif 146 ifneq ($(ART_BUILD_HOST_DEBUG),false) 147 ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-host) 148 endif 149 150 endif # ART_ANDROID_COMMON_PATH_MK 151