blob: a7bf9445962066ab4063bfc2965b88c680daea3b [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
Anwar Ghuloum8447d842013-04-30 17:27:40 -070017ART_SMALL_MODE := false
18ifneq ($(wildcard art/SMALL_ART),)
19$(info Enabling ART_SMALL_MODE because of existence of art/SMALL_ART)
20ART_SMALL_MODE := true
Ian Rogersf3e98552013-03-20 15:49:49 -070021endif
Anwar Ghulouma72dd8b2013-06-03 17:01:15 -070022ifeq ($(WITH_ART_SMALL_MODE), true)
23ART_SMALL_MODE := true
24endif
Ian Rogersf3e98552013-03-20 15:49:49 -070025
Brian Carlstrom06809ed2012-09-17 14:19:20 -070026ART_USE_PORTABLE_COMPILER := false
27ifneq ($(wildcard art/USE_PORTABLE_COMPILER),)
28$(info Enabling ART_USE_PORTABLE_COMPILER because of existence of art/USE_PORTABLE_COMPILER)
29ART_USE_PORTABLE_COMPILER := true
30endif
31ifeq ($(WITH_ART_USE_PORTABLE_COMPILER),true)
32$(info Enabling ART_USE_PORTABLE_COMPILER because WITH_ART_USE_PORTABLE_COMPILER=true)
33ART_USE_PORTABLE_COMPILER := true
34endif
Shih-wei Liaod1fec812012-02-13 09:51:10 -080035
Shih-wei Liaod1fec812012-02-13 09:51:10 -080036LLVM_ROOT_PATH := external/llvm
37include $(LLVM_ROOT_PATH)/llvm.mk
Shih-wei Liaod1fec812012-02-13 09:51:10 -080038
Ian Rogerscd5d0422013-05-17 15:54:01 -070039# Clang build.
40# ART_TARGET_CLANG := true
41# ART_HOST_CLANG := true
42
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -080043# directory used for gtests on device
44ART_NATIVETEST_DIR := /data/nativetest/art
45ART_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
46
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070047# directory used for tests on device
48ART_TEST_DIR := /data/art-test
49ART_TEST_OUT := $(TARGET_OUT_DATA)/art-test
50
Brian Carlstromcdc8de42011-07-19 14:23:17 -070051ART_CPP_EXTENSION := .cc
Carl Shapiro9bf84fd2011-06-17 17:05:25 -070052
Elliott Hughes0af55432011-08-17 18:37:28 -070053ART_C_INCLUDES := \
54 external/gtest/include \
Ian Rogers1d54e732013-05-02 21:10:01 -070055 external/valgrind/main/include \
buzbeec143c552011-08-20 17:38:58 -070056 external/zlib \
Brian Carlstrom700c8d32012-11-05 10:42:02 -080057 frameworks/compile/mclinker/include \
Elliott Hughesadb8c672012-03-06 16:49:32 -080058 art/src
Brian Carlstromb0460ea2011-07-29 10:08:05 -070059
Elliott Hughes1d3f1142011-09-13 12:00:00 -070060art_cflags := \
Ian Rogers637c65b2013-05-31 11:46:00 -070061 -fno-rtti \
Ian Rogers646c3d72012-02-17 23:55:19 -080062 -O2 \
Carl Shapiro1fb86202011-06-27 17:43:13 -070063 -ggdb3 \
64 -Wall \
65 -Werror \
66 -Wextra \
Elliott Hugheseaa200d2012-01-05 16:30:31 -080067 -Wstrict-aliasing=3 \
Carl Shapiro1fb86202011-06-27 17:43:13 -070068 -fstrict-aliasing
69
Anwar Ghuloumc44f68f2013-05-10 13:24:54 -070070ifeq ($(ART_SMALL_MODE),true)
71 art_cflags += -DART_SMALL_MODE=1
Ian Rogersf3e98552013-03-20 15:49:49 -070072endif
73
Brian Carlstrom700c8d32012-11-05 10:42:02 -080074# TODO: enable -std=gnu++0x for auto support when on Ubuntu 12.04 LTS (Precise Pangolin)
75# On 10.04 LTS (Lucid Lynx), it can cause dependencies on GLIBCXX_3.4.14 version symbols.
76
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -080077ifeq ($(HOST_OS),linux)
Shih-wei Liao24782c62012-01-08 12:46:11 -080078 art_non_debug_cflags := \
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070079 -Wframe-larger-than=1728
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -080080endif
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070081
82art_debug_cflags := \
Ian Rogers1ffa32f2013-02-05 18:29:08 -080083 -fno-inline \
Elliott Hughes06e3ad42012-02-07 14:51:57 -080084 -DDYNAMIC_ANNOTATIONS_ENABLED=1 \
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070085 -UNDEBUG
86
jeffhao8161c032012-10-31 15:50:00 -070087# start of image reserved address space
88IMG_HOST_BASE_ADDRESS := 0x60000000
89
90ifeq ($(TARGET_ARCH),mips)
91IMG_TARGET_BASE_ADDRESS := 0x30000000
92else
93IMG_TARGET_BASE_ADDRESS := 0x60000000
94endif
95
96ART_HOST_CFLAGS := $(art_cflags) -DANDROID_SMP=1 -DART_BASE_ADDRESS=$(IMG_HOST_BASE_ADDRESS)
Ian Rogers9adbff52013-01-23 18:19:03 -080097
98ifeq ($(TARGET_ARCH),x86)
99ART_TARGET_CFLAGS += -msse2
100endif
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700101
jeffhao8161c032012-10-31 15:50:00 -0700102ART_TARGET_CFLAGS := $(art_cflags) -DART_TARGET -DART_BASE_ADDRESS=$(IMG_TARGET_BASE_ADDRESS)
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700103ifeq ($(TARGET_CPU_SMP),true)
104 ART_TARGET_CFLAGS += -DANDROID_SMP=1
105else
106 ART_TARGET_CFLAGS += -DANDROID_SMP=0
107endif
108
Ian Rogersba3ce9a2013-05-17 18:50:09 -0700109# Enable thread-safety for GCC 4.6 on the target but not for GCC 4.7 where this feature was removed.
110ifneq ($(filter 4.6 4.6.%, $(TARGET_GCC_VERSION)),)
111 ART_TARGET_CFLAGS += -Wthread-safety
112else
113 # Warn if not using GCC 4.6 for target builds when not doing a top-level or 'mma' build.
114 ifneq ($(ONE_SHOT_MAKEFILE),)
115 # Enable target GCC 4.6 with: export TARGET_GCC_VERSION_EXP=4.6
116 $(info Using target GCC $(TARGET_GCC_VERSION) disables thread-safety checks.)
117 endif
118endif
119# We build with GCC 4.6 on the host.
120ART_HOST_CFLAGS += -Wthread-safety
121
Ian Rogersf89eccd2013-05-30 10:50:43 -0700122# Make host builds easier to debug and profile by not omitting the frame pointer.
123ART_HOST_CFLAGS += -fno-omit-frame-pointer
124
Brian Carlstrom89521892011-12-07 22:05:07 -0800125# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
126# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
127
Elliott Hughes3b6baaa2011-10-14 19:13:56 -0700128ART_HOST_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
129ART_TARGET_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
130
Brian Carlstromfd2ec542012-05-02 15:08:57 -0700131# TODO: move -fkeep-inline-functions to art_debug_cflags when target gcc > 4.4 (and -lsupc++)
Elliott Hughes1ba27142012-01-20 15:32:00 -0800132ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags) -fkeep-inline-functions
Brian Carlstromfd2ec542012-05-02 15:08:57 -0700133ART_HOST_DEBUG_LDLIBS := -lsupc++
Elliott Hughesad6c9c32012-01-19 17:39:12 -0800134
135ifneq ($(HOST_OS),linux)
136 # Some Mac OS pthread header files are broken with -fkeep-inline-functions.
Elliott Hughes34cf5142012-01-20 16:39:13 -0800137 ART_HOST_DEBUG_CFLAGS := $(filter-out -fkeep-inline-functions,$(ART_HOST_DEBUG_CFLAGS))
Elliott Hughes60234562012-06-01 12:25:59 -0700138 # Mac OS doesn't have libsupc++.
139 ART_HOST_DEBUG_LDLIBS := $(filter-out -lsupc++,$(ART_HOST_DEBUG_LDLIBS))
Elliott Hughesad6c9c32012-01-19 17:39:12 -0800140endif
141
Brian Carlstrom86927212011-09-15 11:31:11 -0700142ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags)
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700143
Ian Rogersc928de92013-02-27 14:30:44 -0800144ifeq ($(ART_USE_PORTABLE_COMPILER),true)
TDYa12758e63f92012-04-24 13:16:47 -0700145PARALLEL_ART_COMPILE_JOBS := -j8
146endif
147
Brian Carlstrom69b15fb2011-09-03 12:25:21 -0700148DEX2OAT_SRC_FILES := \
149 src/dex2oat.cc
150
Brian Carlstrom78128a62011-09-15 17:21:19 -0700151OATDUMP_SRC_FILES := \
Elliott Hughes3e778f72012-05-21 15:29:52 -0700152 src/oatdump.cc
Brian Carlstrom78128a62011-09-15 17:21:19 -0700153
Brian Carlstrom934486c2011-07-12 23:42:50 -0700154LIBART_COMMON_SRC_FILES := \
Elliott Hughes5ea047b2011-09-13 14:38:18 -0700155 src/atomic.cc.arm \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800156 src/barrier.cc \
Elliott Hughes07ed66b2012-12-12 18:34:25 -0800157 src/base/logging.cc \
Elliott Hughes76b61672012-12-12 17:47:30 -0800158 src/base/mutex.cc \
Elliott Hughese222ee02012-12-13 14:41:43 -0800159 src/base/stringpiece.cc \
160 src/base/stringprintf.cc \
Ian Rogersc928de92013-02-27 14:30:44 -0800161 src/base/timing_logger.cc \
Elliott Hughes76160052012-12-12 16:31:20 -0800162 src/base/unix_file/fd_file.cc \
163 src/base/unix_file/mapped_file.cc \
164 src/base/unix_file/null_file.cc \
165 src/base/unix_file/random_access_file_utils.cc \
166 src/base/unix_file/string_file.cc \
Elliott Hughesa2501992011-08-26 19:39:54 -0700167 src/check_jni.cc \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700168 src/class_linker.cc \
Ian Rogers87e552d2012-08-31 15:54:48 -0700169 src/common_throws.cc \
Brian Carlstrom3320cf42011-10-04 14:58:28 -0700170 src/compiled_method.cc \
Ian Rogers1212a022013-03-04 10:48:41 -0800171 src/compiler/driver/compiler_driver.cc \
Ian Rogers4c1c2832013-03-04 18:30:13 -0800172 src/compiler/llvm/runtime_support_llvm.cc \
Jeff Hao0aba0ba2013-06-03 14:49:28 -0700173 src/compiler/stubs/portable/stubs.cc \
174 src/compiler/stubs/quick/stubs.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700175 src/debugger.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700176 src/dex_file.cc \
jeffhao10037c82012-01-23 15:06:23 -0800177 src/dex_file_verifier.cc \
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700178 src/dex_instruction.cc \
Elliott Hughes3e778f72012-05-21 15:29:52 -0700179 src/disassembler.cc \
180 src/disassembler_arm.cc \
181 src/disassembler_mips.cc \
182 src/disassembler_x86.cc \
Brian Carlstrom700c8d32012-11-05 10:42:02 -0800183 src/elf_file.cc \
Brian Carlstromcd60ac72013-01-20 17:09:51 -0800184 src/file_output_stream.cc \
Ian Rogers1d54e732013-05-02 21:10:01 -0700185 src/gc/allocator/dlmalloc.cc \
186 src/gc/accounting/card_table.cc \
187 src/gc/accounting/heap_bitmap.cc \
188 src/gc/accounting/mod_union_table.cc \
189 src/gc/accounting/space_bitmap.cc \
190 src/gc/collector/garbage_collector.cc \
191 src/gc/collector/mark_sweep.cc \
192 src/gc/collector/partial_mark_sweep.cc \
193 src/gc/collector/sticky_mark_sweep.cc \
194 src/gc/heap.cc \
195 src/gc/space/dlmalloc_space.cc \
196 src/gc/space/image_space.cc \
197 src/gc/space/large_object_space.cc \
198 src/gc/space/space.cc \
Jesse Wilsonc4824e62011-11-01 14:39:04 -0400199 src/hprof/hprof.cc \
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700200 src/image.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700201 src/image_writer.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700202 src/indirect_reference_table.cc \
jeffhao725a9572012-11-13 18:20:12 -0800203 src/instrumentation.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700204 src/intern_table.cc \
Ian Rogers2fa6b2e2012-10-17 00:10:17 -0700205 src/interpreter/interpreter.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700206 src/jdwp/jdwp_event.cc \
207 src/jdwp/jdwp_expand_buf.cc \
208 src/jdwp/jdwp_handler.cc \
209 src/jdwp/jdwp_main.cc \
Elliott Hughes4b9702c2013-02-20 18:13:24 -0800210 src/jdwp/jdwp_request.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700211 src/jdwp/jdwp_socket.cc \
Elliott Hughes64f574f2013-02-20 14:57:12 -0800212 src/jdwp/object_registry.cc \
Ian Rogersdf20fe02011-07-20 20:34:16 -0700213 src/jni_internal.cc \
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700214 src/jobject_comparator.cc \
Ian Rogers81d425b2012-09-27 16:03:43 -0700215 src/locks.cc \
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700216 src/mem_map.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700217 src/memory_region.cc \
Elliott Hughes64f574f2013-02-20 14:57:12 -0800218 src/mirror/abstract_method.cc \
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800219 src/mirror/array.cc \
220 src/mirror/class.cc \
221 src/mirror/dex_cache.cc \
222 src/mirror/field.cc \
223 src/mirror/object.cc \
224 src/mirror/stack_trace_element.cc \
225 src/mirror/string.cc \
226 src/mirror/throwable.cc \
Elliott Hughes54e7df12011-09-16 11:47:04 -0700227 src/monitor.cc \
Ian Rogers0dae08e2012-04-14 13:55:11 -0700228 src/native/dalvik_system_DexFile.cc \
229 src/native/dalvik_system_VMDebug.cc \
230 src/native/dalvik_system_VMRuntime.cc \
231 src/native/dalvik_system_VMStack.cc \
232 src/native/dalvik_system_Zygote.cc \
233 src/native/java_lang_Class.cc \
234 src/native/java_lang_Object.cc \
235 src/native/java_lang_Runtime.cc \
236 src/native/java_lang_String.cc \
237 src/native/java_lang_System.cc \
238 src/native/java_lang_Thread.cc \
239 src/native/java_lang_Throwable.cc \
240 src/native/java_lang_VMClassLoader.cc \
241 src/native/java_lang_reflect_Array.cc \
242 src/native/java_lang_reflect_Constructor.cc \
243 src/native/java_lang_reflect_Field.cc \
244 src/native/java_lang_reflect_Method.cc \
245 src/native/java_lang_reflect_Proxy.cc \
246 src/native/java_util_concurrent_atomic_AtomicLong.cc \
247 src/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc \
248 src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \
249 src/native/sun_misc_Unsafe.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800250 src/oat.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700251 src/oat/utils/arm/assembler_arm.cc \
252 src/oat/utils/arm/managed_register_arm.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800253 src/oat/utils/assembler.cc \
jeffhao7fbee072012-08-24 17:56:54 -0700254 src/oat/utils/mips/assembler_mips.cc \
255 src/oat/utils/mips/managed_register_mips.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700256 src/oat/utils/x86/assembler_x86.cc \
257 src/oat/utils/x86/managed_register_x86.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700258 src/oat_file.cc \
259 src/oat_writer.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700260 src/offsets.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700261 src/os_linux.cc \
Brian Carlstromae826982011-11-09 01:33:42 -0800262 src/primitive.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700263 src/reference_table.cc \
Elliott Hughes418d20f2011-09-22 14:00:39 -0700264 src/reflection.cc \
Carl Shapirod4e48fd2011-06-30 18:53:29 -0700265 src/runtime.cc \
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -0800266 src/runtime_support.cc \
Elliott Hughese27955c2011-08-26 15:21:24 -0700267 src/signal_catcher.cc \
Elliott Hughes68e76522011-10-05 13:22:16 -0700268 src/stack.cc \
Brian Carlstromb0460ea2011-07-29 10:08:05 -0700269 src/thread.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700270 src/thread_list.cc \
Mathieu Chartier0e4627e2012-10-23 16:13:36 -0700271 src/thread_pool.cc \
Ian Rogers62d6c772013-02-27 08:32:07 -0800272 src/throw_location.cc \
jeffhaoe343b762011-12-05 16:36:44 -0800273 src/trace.cc \
Elliott Hughes814e4032011-08-23 12:07:56 -0700274 src/utf.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700275 src/utils.cc \
Brian Carlstromcd60ac72013-01-20 17:09:51 -0800276 src/vector_output_stream.cc \
Ian Rogers0c7abda2012-09-19 13:33:42 -0700277 src/verifier/dex_gc_map.cc \
Ian Rogers7b3ddd22013-02-21 15:19:52 -0800278 src/verifier/instruction_flags.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700279 src/verifier/method_verifier.cc \
280 src/verifier/reg_type.cc \
281 src/verifier/reg_type_cache.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800282 src/verifier/register_line.cc \
283 src/well_known_classes.cc \
284 src/zip_archive.cc
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700285
Ian Rogers57b86d42012-03-27 16:05:41 -0700286LIBART_COMMON_SRC_FILES += \
Ian Rogers57b86d42012-03-27 16:05:41 -0700287 src/oat/runtime/context.cc \
288 src/oat/runtime/support_alloc.cc \
289 src/oat/runtime/support_cast.cc \
Ian Rogers306057f2012-11-26 12:45:53 -0800290 src/oat/runtime/support_deoptimize.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800291 src/oat/runtime/support_dexcache.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700292 src/oat/runtime/support_field.cc \
293 src/oat/runtime/support_fillarray.cc \
jeffhao725a9572012-11-13 18:20:12 -0800294 src/oat/runtime/support_instrumentation.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700295 src/oat/runtime/support_invoke.cc \
296 src/oat/runtime/support_jni.cc \
297 src/oat/runtime/support_locks.cc \
298 src/oat/runtime/support_math.cc \
299 src/oat/runtime/support_proxy.cc \
300 src/oat/runtime/support_stubs.cc \
301 src/oat/runtime/support_thread.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800302 src/oat/runtime/support_throw.cc \
Ian Rogersc928de92013-02-27 14:30:44 -0800303 src/oat/runtime/support_interpreter.cc
Shih-wei Liaod1fec812012-02-13 09:51:10 -0800304
Brian Carlstrom934486c2011-07-12 23:42:50 -0700305LIBART_TARGET_SRC_FILES := \
306 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughes07ed66b2012-12-12 18:34:25 -0800307 src/base/logging_android.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700308 src/jdwp/jdwp_adb.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700309 src/monitor_android.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700310 src/runtime_android.cc \
Brian Carlstrom51477332012-03-25 20:20:26 -0700311 src/thread_android.cc
312
313ifeq ($(TARGET_ARCH),arm)
Ian Rogers57b86d42012-03-27 16:05:41 -0700314LIBART_TARGET_SRC_FILES += \
315 src/oat/runtime/arm/context_arm.cc.arm \
316 src/oat/runtime/arm/oat_support_entrypoints_arm.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700317 src/oat/runtime/arm/runtime_support_arm.S
Brian Carlstrom51477332012-03-25 20:20:26 -0700318else # TARGET_ARCH != arm
319ifeq ($(TARGET_ARCH),x86)
Ian Rogers57b86d42012-03-27 16:05:41 -0700320LIBART_TARGET_SRC_FILES += \
321 src/oat/runtime/x86/context_x86.cc \
322 src/oat/runtime/x86/oat_support_entrypoints_x86.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700323 src/oat/runtime/x86/runtime_support_x86.S
Brian Carlstrom51477332012-03-25 20:20:26 -0700324else # TARGET_ARCH != x86
325ifeq ($(TARGET_ARCH),mips)
Ian Rogers57b86d42012-03-27 16:05:41 -0700326LIBART_TARGET_SRC_FILES += \
jeffhao7fbee072012-08-24 17:56:54 -0700327 src/oat/runtime/mips/context_mips.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700328 src/oat/runtime/mips/oat_support_entrypoints_mips.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700329 src/oat/runtime/mips/runtime_support_mips.S
330else # TARGET_ARCH != mips
331$(error unsupported TARGET_ARCH=$(TARGET_ARCH))
332endif # TARGET_ARCH != mips
333endif # TARGET_ARCH != x86
334endif # TARGET_ARCH != arm
Ian Rogers776ac1f2012-04-13 23:36:36 -0700335
336ifeq ($(TARGET_ARCH),arm)
337LIBART_TARGET_SRC_FILES += src/thread_arm.cc
338else # TARGET_ARCH != arm
339ifeq ($(TARGET_ARCH),x86)
340LIBART_TARGET_SRC_FILES += src/thread_x86.cc
341else # TARGET_ARCH != x86
342ifeq ($(TARGET_ARCH),mips)
343LIBART_TARGET_SRC_FILES += src/thread_mips.cc
Brian Carlstrom51477332012-03-25 20:20:26 -0700344else # TARGET_ARCH != mips
345$(error unsupported TARGET_ARCH=$(TARGET_ARCH))
346endif # TARGET_ARCH != mips
347endif # TARGET_ARCH != x86
348endif # TARGET_ARCH != arm
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700349
Brian Carlstrom934486c2011-07-12 23:42:50 -0700350LIBART_HOST_SRC_FILES := \
351 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughes07ed66b2012-12-12 18:34:25 -0800352 src/base/logging_linux.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700353 src/monitor_linux.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700354 src/runtime_linux.cc \
Brian Carlstrom51477332012-03-25 20:20:26 -0700355 src/thread_linux.cc
356
357ifeq ($(HOST_ARCH),x86)
Ian Rogers57b86d42012-03-27 16:05:41 -0700358LIBART_HOST_SRC_FILES += \
Ian Rogers57b86d42012-03-27 16:05:41 -0700359 src/oat/runtime/x86/context_x86.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800360 src/oat/runtime/x86/oat_support_entrypoints_x86.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700361 src/oat/runtime/x86/runtime_support_x86.S
362else # HOST_ARCH != x86
363$(error unsupported HOST_ARCH=$(HOST_ARCH))
364endif # HOST_ARCH != x86
Ian Rogers776ac1f2012-04-13 23:36:36 -0700365
366ifeq ($(HOST_ARCH),x86)
367LIBART_HOST_SRC_FILES += src/thread_x86.cc
Brian Carlstrom51477332012-03-25 20:20:26 -0700368else # HOST_ARCH != x86
369$(error unsupported HOST_ARCH=$(HOST_ARCH))
370endif # HOST_ARCH != x86
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700371
Ian Rogers776ac1f2012-04-13 23:36:36 -0700372
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700373LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \
Elliott Hughes76b61672012-12-12 17:47:30 -0800374 src/base/mutex.h \
buzbee395116c2013-02-27 14:30:25 -0800375 src/compiler/dex/compiler_enums.h \
Brian Carlstrom88f36542012-10-16 23:24:21 -0700376 src/dex_file.h \
Ian Rogersa75a0132012-09-28 11:41:42 -0700377 src/dex_instruction.h \
Ian Rogers1d54e732013-05-02 21:10:01 -0700378 src/gc/collector/gc_type.h \
379 src/gc/space/space.h \
380 src/gc/heap.h \
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700381 src/indirect_reference_table.h \
382 src/instruction_set.h \
383 src/invoke_type.h \
Elliott Hughes460384f2012-04-04 16:53:10 -0700384 src/jdwp/jdwp.h \
385 src/jdwp/jdwp_constants.h \
Ian Rogers81d425b2012-09-27 16:03:43 -0700386 src/locks.h \
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800387 src/mirror/class.h \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700388 src/thread.h \
Ian Rogersc928de92013-02-27 14:30:44 -0800389 src/thread_state.h \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800390 src/verifier/method_verifier.h
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700391
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700392LIBARTTEST_COMMON_SRC_FILES := \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800393 test/ReferenceMap/stack_walk_refmap_jni.cc \
394 test/StackWalk/stack_walk_jni.cc
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700395
Brian Carlstrom934486c2011-07-12 23:42:50 -0700396TEST_COMMON_SRC_FILES := \
Mathieu Chartier0e4627e2012-10-23 16:13:36 -0700397 src/barrier_test.cc \
Sameer Abu Asala8439542013-02-14 16:06:42 -0800398 src/base/histogram_test.cc \
Elliott Hughes76b61672012-12-12 17:47:30 -0800399 src/base/mutex_test.cc \
Elliott Hughes76160052012-12-12 16:31:20 -0800400 src/base/unix_file/fd_file_test.cc \
401 src/base/unix_file/mapped_file_test.cc \
402 src/base/unix_file/null_file_test.cc \
403 src/base/unix_file/random_access_file_utils_test.cc \
404 src/base/unix_file/string_file_test.cc \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700405 src/class_linker_test.cc \
Ian Rogers1212a022013-03-04 10:48:41 -0800406 src/compiler/driver/compiler_driver_test.cc \
Ian Rogers8550c9c2013-03-04 12:21:02 -0800407 src/compiler/jni/jni_compiler_test.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700408 src/dex_file_test.cc \
409 src/dex_instruction_visitor_test.cc \
Brian Carlstrom265091e2013-01-30 14:08:26 -0800410 src/dex_method_iterator_test.cc \
Brian Carlstrom700c8d32012-11-05 10:42:02 -0800411 src/elf_writer_test.cc \
Shih-wei Liao2fb97532011-08-11 16:17:23 -0700412 src/exception_test.cc \
Ian Rogers1d54e732013-05-02 21:10:01 -0700413 src/gc/accounting/space_bitmap_test.cc \
414 src/gc/heap_test.cc \
415 src/gc/space/space_test.cc \
Brian Carlstrom4b2966b2012-05-22 08:54:52 -0700416 src/gtest_test.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700417 src/image_test.cc \
Ian Rogers2bcb4a42012-11-08 10:39:18 -0800418 src/indenter_test.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700419 src/indirect_reference_table_test.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700420 src/intern_table_test.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800421 src/jni_internal_test.cc \
Ian Rogers2dd0e2c2013-01-24 12:42:14 -0800422 src/mirror/dex_cache_test.cc \
Ian Rogersc928de92013-02-27 14:30:44 -0800423 src/mirror/object_test.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700424 src/oat/utils/arm/managed_register_arm_test.cc \
425 src/oat/utils/x86/managed_register_x86_test.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700426 src/oat_test.cc \
Brian Carlstromcd60ac72013-01-20 17:09:51 -0800427 src/output_stream_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700428 src/reference_table_test.cc \
Logan Chien008fa512012-06-22 08:09:57 -0700429 src/runtime_support_test.cc \
Carl Shapirofc322c72011-07-27 00:20:01 -0700430 src/runtime_test.cc \
Mathieu Chartier0e4627e2012-10-23 16:13:36 -0700431 src/thread_pool_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700432 src/utils_test.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700433 src/verifier/method_verifier_test.cc \
Brian Carlstrom6ff7f802013-01-30 13:55:02 -0800434 src/verifier/reg_type_test.cc \
435 src/zip_archive_test.cc
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700436
Brian Carlstrom934486c2011-07-12 23:42:50 -0700437TEST_TARGET_SRC_FILES := \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700438 $(TEST_COMMON_SRC_FILES)
Carl Shapiro008e4122011-06-23 17:27:46 -0700439
Brian Carlstrom934486c2011-07-12 23:42:50 -0700440TEST_HOST_SRC_FILES := \
441 $(TEST_COMMON_SRC_FILES) \
Ian Rogers57b86d42012-03-27 16:05:41 -0700442 src/oat/utils/x86/assembler_x86_test.cc
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700443
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800444# subdirectories of test/ which are used as inputs for gtests
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700445TEST_DEX_DIRECTORIES := \
Shih-wei Liao303b01e2011-09-14 00:46:13 -0700446 AbstractMethod \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700447 AllFields \
Ian Rogers0571d352011-11-03 19:51:38 -0700448 CreateMethodSignature \
Brian Carlstrom33f741e2011-10-03 11:24:05 -0700449 ExceptionHandle \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700450 Interfaces \
451 Main \
452 MyClass \
453 MyClassNatives \
454 Nested \
Elliott Hughes77405792012-03-15 15:22:12 -0700455 NonStaticLeafMethods \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700456 ProtoCompare \
457 ProtoCompare2 \
458 StaticLeafMethods \
459 Statics \
jeffhaoabcfde32011-09-29 15:05:18 -0700460 StaticsFromCode \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700461 XandY
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700462
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800463# subdirectories of test/ which are used with test-art-target-oat
Ian Rogers9ac995b2013-01-10 19:46:57 -0800464# Declare the simplest tests (Main, HelloWorld) first, the rest are alphabetical
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800465TEST_OAT_DIRECTORIES := \
466 Main \
467 HelloWorld \
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800468 \
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800469 ParallelGC \
470 ReferenceMap \
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800471 StackWalk \
472 ThreadStress
473
474# TODO: Enable when the StackWalk2 tests are passing
475# StackWalk2 \
476
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700477ART_BUILD_TARGET := false
478ART_BUILD_HOST := false
Brian Carlstrom265091e2013-01-30 14:08:26 -0800479ART_BUILD_NDEBUG := false
480ART_BUILD_DEBUG := false
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700481ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
482 ART_BUILD_TARGET := true
Brian Carlstrom265091e2013-01-30 14:08:26 -0800483 ART_BUILD_NDEBUG := true
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700484endif
485ifeq ($(ART_BUILD_TARGET_DEBUG),true)
486 ART_BUILD_TARGET := true
Brian Carlstrom265091e2013-01-30 14:08:26 -0800487 ART_BUILD_DEBUG := true
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700488endif
489ifeq ($(ART_BUILD_HOST_NDEBUG),true)
490 ART_BUILD_HOST := true
Brian Carlstrom265091e2013-01-30 14:08:26 -0800491 ART_BUILD_NDEBUG := true
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700492endif
493ifeq ($(ART_BUILD_HOST_DEBUG),true)
494 ART_BUILD_HOST := true
Brian Carlstrom265091e2013-01-30 14:08:26 -0800495 ART_BUILD_DEBUG := true
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700496endif