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_MK 18 ART_ANDROID_COMMON_MK = true 19 20 ART_TARGET_SUPPORTED_ARCH := arm arm64 mips mips64 x86 x86_64 21 ART_HOST_SUPPORTED_ARCH := x86 x86_64 22 23 ifneq ($(HOST_OS),darwin) 24 ART_HOST_SUPPORTED_ARCH := x86 x86_64 25 else 26 # Mac OS doesn't support low-4GB allocation in a 64-bit process. So we won't be able to create 27 # our heaps. 28 ART_HOST_SUPPORTED_ARCH := x86 29 ART_MULTILIB_OVERRIDE_host := 32 30 endif 31 32 ART_COVERAGE := false 33 34 ifeq ($(ART_COVERAGE),true) 35 # https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html 36 GCOV_PREFIX := /data/local/tmp/gcov 37 # GCOV_PREFIX_STRIP is an integer that defines how many levels should be 38 # stripped off the beginning of the path. We want the paths in $GCOV_PREFIX to 39 # be relative to $ANDROID_BUILD_TOP so we can just adb pull from the top and not 40 # have to worry about placing things ourselves. 41 GCOV_PREFIX_STRIP := $(shell echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l) 42 GCOV_ENV := GCOV_PREFIX=$(GCOV_PREFIX) GCOV_PREFIX_STRIP=$(GCOV_PREFIX_STRIP) 43 else 44 GCOV_ENV := 45 endif 46 47 ifeq (,$(filter $(TARGET_ARCH),$(ART_TARGET_SUPPORTED_ARCH))) 48 $(warning unsupported TARGET_ARCH=$(TARGET_ARCH)) 49 endif 50 ifeq (,$(filter $(HOST_ARCH),$(ART_HOST_SUPPORTED_ARCH))) 51 $(warning unsupported HOST_ARCH=$(HOST_ARCH)) 52 endif 53 54 # Primary vs. secondary 55 2ND_TARGET_ARCH := $(TARGET_2ND_ARCH) 56 TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 57 2ND_TARGET_INSTRUCTION_SET_FEATURES := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) 58 ifdef TARGET_2ND_ARCH 59 ifneq ($(filter %64,$(TARGET_ARCH)),) 60 ART_PHONY_TEST_TARGET_SUFFIX := 64 61 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 32 62 ART_TARGET_ARCH_32 := $(TARGET_2ND_ARCH) 63 ART_TARGET_ARCH_64 := $(TARGET_ARCH) 64 else 65 # TODO: ??? 66 $(warning Do not know what to do with this multi-target configuration!) 67 ART_PHONY_TEST_TARGET_SUFFIX := 32 68 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 69 ART_TARGET_ARCH_32 := $(TARGET_ARCH) 70 ART_TARGET_ARCH_64 := 71 endif 72 else 73 ifneq ($(filter %64,$(TARGET_ARCH)),) 74 ART_PHONY_TEST_TARGET_SUFFIX := 64 75 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 76 ART_TARGET_ARCH_32 := 77 ART_TARGET_ARCH_64 := $(TARGET_ARCH) 78 else 79 ART_PHONY_TEST_TARGET_SUFFIX := 32 80 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 81 ART_TARGET_ARCH_32 := $(TARGET_ARCH) 82 ART_TARGET_ARCH_64 := 83 endif 84 endif 85 86 ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX) 87 ART_HOST_SHLIB_EXTENSION ?= .so 88 ifeq ($(HOST_PREFER_32_BIT),true) 89 ART_PHONY_TEST_HOST_SUFFIX := 32 90 2ND_ART_PHONY_TEST_HOST_SUFFIX := 91 ART_HOST_ARCH_32 := x86 92 ART_HOST_ARCH_64 := 93 ART_HOST_ARCH := x86 94 2ND_ART_HOST_ARCH := 95 2ND_HOST_ARCH := 96 ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH) 97 ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES) 98 2ND_ART_HOST_OUT_SHARED_LIBRARIES := 99 else 100 ART_PHONY_TEST_HOST_SUFFIX := 64 101 2ND_ART_PHONY_TEST_HOST_SUFFIX := 32 102 ART_HOST_ARCH_32 := x86 103 ART_HOST_ARCH_64 := x86_64 104 ART_HOST_ARCH := x86_64 105 2ND_ART_HOST_ARCH := x86 106 2ND_HOST_ARCH := x86 107 ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH) 108 ART_HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT_SHARED_LIBRARIES) 109 2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES) 110 endif 111 112 endif # ART_ANDROID_COMMON_MK 113