blob: 6952d691babf74c14993435c1525c93dcebbe82f [file] [log] [blame]
Carl Shapiro7b216702011-06-17 15:09:26 -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_MK
18ART_ANDROID_COMMON_MK = true
Dragos Sbirlea37c19bc2013-07-29 09:38:31 -070019
Andreas Gampe1a5c4062015-01-15 12:10:47 -080020ART_TARGET_SUPPORTED_ARCH := arm arm64 mips mips64 x86 x86_64
Ian Rogersafd9acc2014-06-17 08:21:54 -070021ART_HOST_SUPPORTED_ARCH := x86 x86_64
Colin Crossdc781a12014-02-04 16:22:03 -080022
Ying Wang754a4452015-07-21 12:05:30 -070023ifneq ($(HOST_OS),darwin)
24 ART_HOST_SUPPORTED_ARCH := x86 x86_64
25else
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
30endif
31
Dan Albert31fb2602014-09-30 22:10:10 -070032ART_COVERAGE := false
33
34ifeq ($(ART_COVERAGE),true)
35# https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
36GCOV_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.
41GCOV_PREFIX_STRIP := $(shell echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l)
42GCOV_ENV := GCOV_PREFIX=$(GCOV_PREFIX) GCOV_PREFIX_STRIP=$(GCOV_PREFIX_STRIP)
43else
44GCOV_ENV :=
45endif
46
Ian Rogersafd9acc2014-06-17 08:21:54 -070047ifeq (,$(filter $(TARGET_ARCH),$(ART_TARGET_SUPPORTED_ARCH)))
Colin Crossdc781a12014-02-04 16:22:03 -080048$(warning unsupported TARGET_ARCH=$(TARGET_ARCH))
49endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070050ifeq (,$(filter $(HOST_ARCH),$(ART_HOST_SUPPORTED_ARCH)))
51$(warning unsupported HOST_ARCH=$(HOST_ARCH))
Brian Carlstromafdc5602014-06-10 15:42:52 -070052endif
Andreas Gampe922141a2014-03-12 10:59:26 -070053
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070054# Primary vs. secondary
552ND_TARGET_ARCH := $(TARGET_2ND_ARCH)
Ian Rogersafd9acc2014-06-17 08:21:54 -070056TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
572ND_TARGET_INSTRUCTION_SET_FEATURES := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070058ifdef TARGET_2ND_ARCH
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070059 ifneq ($(filter %64,$(TARGET_ARCH)),)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070060 ART_PHONY_TEST_TARGET_SUFFIX := 64
61 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 32
Brian Carlstrom0e12bdc2014-05-14 17:44:28 -070062 ART_TARGET_ARCH_32 := $(TARGET_2ND_ARCH)
63 ART_TARGET_ARCH_64 := $(TARGET_ARCH)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070064 else
65 # TODO: ???
66 $(error Do not know what to do with this multi-target configuration!)
67 endif
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070068else
Nicolas Geoffray7372b762014-11-07 10:10:39 +000069 ifneq ($(filter %64,$(TARGET_ARCH)),)
70 ART_PHONY_TEST_TARGET_SUFFIX := 64
71 2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
72 ART_TARGET_ARCH_32 :=
73 ART_TARGET_ARCH_64 := $(TARGET_ARCH)
74 else
75 ART_PHONY_TEST_TARGET_SUFFIX := 32
76 2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
77 ART_TARGET_ARCH_32 := $(TARGET_ARCH)
78 ART_TARGET_ARCH_64 :=
79 endif
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070080endif
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070081
Ian Rogers665de8a2014-06-24 21:34:09 -070082ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX)
83ART_HOST_SHLIB_EXTENSION ?= .so
Ian Rogersafd9acc2014-06-17 08:21:54 -070084ifeq ($(HOST_PREFER_32_BIT),true)
85 ART_PHONY_TEST_HOST_SUFFIX := 32
86 2ND_ART_PHONY_TEST_HOST_SUFFIX :=
87 ART_HOST_ARCH_32 := x86
88 ART_HOST_ARCH_64 :=
89 ART_HOST_ARCH := x86
90 2ND_ART_HOST_ARCH :=
91 2ND_HOST_ARCH :=
Ian Rogers665de8a2014-06-24 21:34:09 -070092 ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -070093 ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
94 2ND_ART_HOST_OUT_SHARED_LIBRARIES :=
Elliott Hughes1d3f1142011-09-13 12:00:00 -070095else
Ian Rogersafd9acc2014-06-17 08:21:54 -070096 ART_PHONY_TEST_HOST_SUFFIX := 64
97 2ND_ART_PHONY_TEST_HOST_SUFFIX := 32
98 ART_HOST_ARCH_32 := x86
99 ART_HOST_ARCH_64 := x86_64
100 ART_HOST_ARCH := x86_64
101 2ND_ART_HOST_ARCH := x86
102 2ND_HOST_ARCH := x86
Ian Rogers665de8a2014-06-24 21:34:09 -0700103 ART_HOST_LIBRARY_PATH := $(HOST_LIBRARY_PATH)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700104 ART_HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT_SHARED_LIBRARIES)
105 2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700106endif
Andreas Gampe2fe07922014-04-21 07:50:39 -0700107
Igor Murashkin37743352014-11-13 14:38:00 -0800108endif # ART_ANDROID_COMMON_MK