blob: 0373b5866e99c5e8d60bd2e37fe3413ea927af8d [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
Brian Carlstrom06809ed2012-09-17 14:19:20 -070017ART_USE_PORTABLE_COMPILER := false
18ifneq ($(wildcard art/USE_PORTABLE_COMPILER),)
19$(info Enabling ART_USE_PORTABLE_COMPILER because of existence of art/USE_PORTABLE_COMPILER)
20ART_USE_PORTABLE_COMPILER := true
21endif
22ifeq ($(WITH_ART_USE_PORTABLE_COMPILER),true)
23$(info Enabling ART_USE_PORTABLE_COMPILER because WITH_ART_USE_PORTABLE_COMPILER=true)
24ART_USE_PORTABLE_COMPILER := true
25endif
26ifeq ($(ART_USE_PORTABLE_COMPILER),true)
27WITH_ART_USE_QUICK_COMPILER := true
28WITH_ART_USE_LLVM_COMPILER := true
29endif
30
Shih-wei Liaod1fec812012-02-13 09:51:10 -080031# Use llvm as the backend
Shih-wei Liaod1fec812012-02-13 09:51:10 -080032ART_USE_LLVM_COMPILER := false
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070033ifneq ($(wildcard art/USE_LLVM_COMPILER),)
34$(info Enabling ART_USE_LLVM_COMPILER because of existence of art/USE_LLVM_COMPILER)
35ART_USE_LLVM_COMPILER := true
36endif
37ifeq ($(WITH_ART_USE_LLVM_COMPILER),true)
38$(info Enabling ART_USE_LLVM_COMPILER because WITH_ART_USE_LLVM_COMPILER=true)
39ART_USE_LLVM_COMPILER := true
Shih-wei Liaod1fec812012-02-13 09:51:10 -080040endif
41
Shih-wei Liao21d28f52012-06-12 05:55:00 -070042ART_USE_DEXLANG_FRONTEND := false
43ifeq ($(ART_USE_LLVM_COMPILER),true)
44 ifneq ($(wildcard art/USE_DEXLANG_FRONTEND),)
45 $(info Enabling ART_USE_DEXLANG_FRONTEND because of existence of art/USE_DEXLANG_FRONTEND)
46 ART_USE_DEXLANG_FRONTEND := true
47 endif
48 ifeq ($(WITH_ART_USE_DEXLANG_FRONTEND),true)
49 $(info Enabling ART_USE_DEXLANG_FRONTEND because WITH_ART_USE_DEXLANG_FRONTEND=true)
50 ART_USE_DEXLANG_FRONTEND := true
51 endif
52endif
53
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -070054ART_USE_GREENLAND_COMPILER := false
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070055ifneq ($(wildcard art/USE_GREENLAND_COMPILER),)
56$(info Enabling ART_USE_GREENLAND_COMPILER because of existence of art/USE_GREENLAND_COMPILER)
57ART_USE_GREENLAND_COMPILER := true
58endif
59ifeq ($(WITH_ART_USE_GREENLAND_COMPILER),true)
60$(info Enabling ART_USE_GREENLAND_COMPILER because WITH_ART_USE_GREENLAND_COMPILER=true)
61ART_USE_GREENLAND_COMPILER := true
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -070062endif
63
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070064ART_USE_QUICK_COMPILER := false
buzbee2cfc6392012-05-07 14:51:40 -070065ifneq ($(wildcard art/USE_QUICK_COMPILER),)
66ART_USE_QUICK_COMPILER := true
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070067$(info Enabling ART_USE_QUICK_COMPILER because of existence of art/USE_QUICK_COMPILER)
68endif
69ifeq ($(WITH_ART_USE_QUICK_COMPILER),true)
70ART_USE_QUICK_COMPILER := true
71$(info Enabling ART_USE_QUICK_COMPILER because WITH_ART_USE_QUICK_COMPILER=true)
buzbee2cfc6392012-05-07 14:51:40 -070072endif
73
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070074ifeq ($(words $(filter true,$(ART_USE_LLVM_COMPILER) $(ART_USE_GREENLAND_COMPILER) $(ART_USE_QUICK_COMPILER))),0)
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -070075ART_REQUIRE_LLVM := false
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070076else #!0
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070077ART_REQUIRE_LLVM := true
Brian Carlstrom9ba4f472012-07-18 23:04:15 -070078endif #!0
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -070079
80ifeq ($(ART_REQUIRE_LLVM),true)
Shih-wei Liaod1fec812012-02-13 09:51:10 -080081LLVM_ROOT_PATH := external/llvm
82include $(LLVM_ROOT_PATH)/llvm.mk
83endif
84
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -080085# directory used for gtests on device
86ART_NATIVETEST_DIR := /data/nativetest/art
87ART_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
88
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070089# directory used for tests on device
90ART_TEST_DIR := /data/art-test
91ART_TEST_OUT := $(TARGET_OUT_DATA)/art-test
92
Brian Carlstromcdc8de42011-07-19 14:23:17 -070093ART_CPP_EXTENSION := .cc
Carl Shapiro9bf84fd2011-06-17 17:05:25 -070094
Elliott Hughes0af55432011-08-17 18:37:28 -070095ART_C_INCLUDES := \
96 external/gtest/include \
97 external/icu4c/common \
98 external/icu4c/i18n \
Elliott Hughes8d768a92011-09-14 16:35:25 -070099 external/valgrind/dynamic_annotations \
buzbeec143c552011-08-20 17:38:58 -0700100 external/zlib \
Elliott Hughesadb8c672012-03-06 16:49:32 -0800101 art/src
Brian Carlstromb0460ea2011-07-29 10:08:05 -0700102
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700103art_cflags := \
Ian Rogers646c3d72012-02-17 23:55:19 -0800104 -O2 \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700105 -ggdb3 \
106 -Wall \
107 -Werror \
108 -Wextra \
Elliott Hugheseaa200d2012-01-05 16:30:31 -0800109 -Wstrict-aliasing=3 \
Elliott Hughesf8349362012-06-18 15:00:06 -0700110 -Wthread-safety \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700111 -fstrict-aliasing
112
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -0800113ifeq ($(HOST_OS),linux)
Shih-wei Liao24782c62012-01-08 12:46:11 -0800114 art_non_debug_cflags := \
Elliott Hughes3b6baaa2011-10-14 19:13:56 -0700115 -Wframe-larger-than=1728
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -0800116endif
Elliott Hughes3b6baaa2011-10-14 19:13:56 -0700117
118art_debug_cflags := \
Elliott Hughes06e3ad42012-02-07 14:51:57 -0800119 -DDYNAMIC_ANNOTATIONS_ENABLED=1 \
Elliott Hughes3b6baaa2011-10-14 19:13:56 -0700120 -UNDEBUG
121
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700122ART_HOST_CFLAGS := $(art_cflags) -DANDROID_SMP=1
Elliott Hughesf8349362012-06-18 15:00:06 -0700123# The host GCC isn't necessarily new enough to support -Wthread-safety (GCC 4.4).
124ART_HOST_CFLAGS := $(filter-out -Wthread-safety,$(ART_HOST_CFLAGS))
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700125
Logan Chien08e1ba32012-05-08 15:08:51 +0800126ART_TARGET_CFLAGS := $(art_cflags) -DART_TARGET
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700127ifeq ($(TARGET_CPU_SMP),true)
128 ART_TARGET_CFLAGS += -DANDROID_SMP=1
129else
130 ART_TARGET_CFLAGS += -DANDROID_SMP=0
131endif
132
Brian Carlstrom89521892011-12-07 22:05:07 -0800133# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
134# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
135
Elliott Hughes3b6baaa2011-10-14 19:13:56 -0700136ART_HOST_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
137ART_TARGET_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
138
Brian Carlstromfd2ec542012-05-02 15:08:57 -0700139# TODO: move -fkeep-inline-functions to art_debug_cflags when target gcc > 4.4 (and -lsupc++)
Elliott Hughes1ba27142012-01-20 15:32:00 -0800140ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags) -fkeep-inline-functions
Brian Carlstromfd2ec542012-05-02 15:08:57 -0700141ART_HOST_DEBUG_LDLIBS := -lsupc++
Elliott Hughesad6c9c32012-01-19 17:39:12 -0800142
143ifneq ($(HOST_OS),linux)
144 # Some Mac OS pthread header files are broken with -fkeep-inline-functions.
Elliott Hughes34cf5142012-01-20 16:39:13 -0800145 ART_HOST_DEBUG_CFLAGS := $(filter-out -fkeep-inline-functions,$(ART_HOST_DEBUG_CFLAGS))
Elliott Hughes60234562012-06-01 12:25:59 -0700146 # Mac OS doesn't have libsupc++.
147 ART_HOST_DEBUG_LDLIBS := $(filter-out -lsupc++,$(ART_HOST_DEBUG_LDLIBS))
Elliott Hughesad6c9c32012-01-19 17:39:12 -0800148endif
149
Brian Carlstrom86927212011-09-15 11:31:11 -0700150ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags)
Elliott Hughes1d3f1142011-09-13 12:00:00 -0700151
TDYa12758e63f92012-04-24 13:16:47 -0700152ifeq ($(ART_USE_LLVM_COMPILER),true)
153PARALLEL_ART_COMPILE_JOBS := -j8
154endif
155
Brian Carlstrom69b15fb2011-09-03 12:25:21 -0700156DEX2OAT_SRC_FILES := \
157 src/dex2oat.cc
158
Brian Carlstrom78128a62011-09-15 17:21:19 -0700159OATDUMP_SRC_FILES := \
Elliott Hughes3e778f72012-05-21 15:29:52 -0700160 src/oatdump.cc
Brian Carlstrom78128a62011-09-15 17:21:19 -0700161
Brian Carlstrom69b15fb2011-09-03 12:25:21 -0700162OATEXEC_SRC_FILES := \
163 src/oatexec.cc
Carl Shapiro9bf84fd2011-06-17 17:05:25 -0700164
Brian Carlstrom934486c2011-07-12 23:42:50 -0700165LIBART_COMMON_SRC_FILES := \
Elliott Hughes5ea047b2011-09-13 14:38:18 -0700166 src/atomic.cc.arm \
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 \
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -0700171 src/compiler.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700172 src/debugger.cc \
Brian Carlstrom7e49dca2011-07-22 18:07:34 -0700173 src/dex_cache.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700174 src/dex_file.cc \
jeffhao10037c82012-01-23 15:06:23 -0800175 src/dex_file_verifier.cc \
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700176 src/dex_instruction.cc \
Elliott Hughes3e778f72012-05-21 15:29:52 -0700177 src/disassembler.cc \
178 src/disassembler_arm.cc \
179 src/disassembler_mips.cc \
180 src/disassembler_x86.cc \
Ian Rogers15bf2d32012-08-28 17:33:04 -0700181 src/dlmalloc.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700182 src/file.cc \
183 src/file_linux.cc \
Mathieu Chartier7469ebf2012-09-24 16:28:36 -0700184 src/gc/card_table.cc \
185 src/gc/heap_bitmap.cc \
Mathieu Chartier1c23e1e2012-10-12 14:14:11 -0700186 src/gc/large_object_space.cc \
Mathieu Chartier7469ebf2012-09-24 16:28:36 -0700187 src/gc/mark_sweep.cc \
188 src/gc/mod_union_table.cc \
189 src/gc/space.cc \
190 src/gc/space_bitmap.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700191 src/heap.cc \
Jesse Wilsonc4824e62011-11-01 14:39:04 -0400192 src/hprof/hprof.cc \
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700193 src/image.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700194 src/image_writer.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700195 src/indirect_reference_table.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700196 src/intern_table.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700197 src/jdwp/jdwp_event.cc \
198 src/jdwp/jdwp_expand_buf.cc \
199 src/jdwp/jdwp_handler.cc \
200 src/jdwp/jdwp_main.cc \
201 src/jdwp/jdwp_socket.cc \
Ian Rogersdf20fe02011-07-20 20:34:16 -0700202 src/jni_internal.cc \
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700203 src/jobject_comparator.cc \
Ian Rogers81d425b2012-09-27 16:03:43 -0700204 src/locks.cc \
Elliott Hughes42ee1422011-09-06 12:33:32 -0700205 src/logging.cc \
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700206 src/mem_map.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700207 src/memory_region.cc \
Elliott Hughes54e7df12011-09-16 11:47:04 -0700208 src/monitor.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700209 src/mutex.cc \
Ian Rogers0dae08e2012-04-14 13:55:11 -0700210 src/native/dalvik_system_DexFile.cc \
211 src/native/dalvik_system_VMDebug.cc \
212 src/native/dalvik_system_VMRuntime.cc \
213 src/native/dalvik_system_VMStack.cc \
214 src/native/dalvik_system_Zygote.cc \
215 src/native/java_lang_Class.cc \
216 src/native/java_lang_Object.cc \
217 src/native/java_lang_Runtime.cc \
218 src/native/java_lang_String.cc \
219 src/native/java_lang_System.cc \
220 src/native/java_lang_Thread.cc \
221 src/native/java_lang_Throwable.cc \
222 src/native/java_lang_VMClassLoader.cc \
223 src/native/java_lang_reflect_Array.cc \
224 src/native/java_lang_reflect_Constructor.cc \
225 src/native/java_lang_reflect_Field.cc \
226 src/native/java_lang_reflect_Method.cc \
227 src/native/java_lang_reflect_Proxy.cc \
228 src/native/java_util_concurrent_atomic_AtomicLong.cc \
229 src/native/org_apache_harmony_dalvik_ddmc_DdmServer.cc \
230 src/native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \
231 src/native/sun_misc_Unsafe.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700232 src/oat/runtime/arm/stub_arm.cc \
jeffhao7fbee072012-08-24 17:56:54 -0700233 src/oat/runtime/mips/stub_mips.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700234 src/oat/runtime/x86/stub_x86.cc \
jeffhao7fbee072012-08-24 17:56:54 -0700235 src/oat/utils/assembler.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700236 src/oat/utils/arm/assembler_arm.cc \
237 src/oat/utils/arm/managed_register_arm.cc \
jeffhao7fbee072012-08-24 17:56:54 -0700238 src/oat/utils/mips/assembler_mips.cc \
239 src/oat/utils/mips/managed_register_mips.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700240 src/oat/utils/x86/assembler_x86.cc \
241 src/oat/utils/x86/managed_register_x86.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700242 src/oat.cc \
243 src/oat_file.cc \
244 src/oat_writer.cc \
Carl Shapiro3ee755d2011-06-28 12:11:04 -0700245 src/object.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700246 src/offsets.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700247 src/os_linux.cc \
Brian Carlstromae826982011-11-09 01:33:42 -0800248 src/primitive.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700249 src/reference_table.cc \
Elliott Hughes418d20f2011-09-22 14:00:39 -0700250 src/reflection.cc \
Carl Shapirod4e48fd2011-06-30 18:53:29 -0700251 src/runtime.cc \
Shih-wei Liaoa8a9c342012-03-03 22:35:16 -0800252 src/runtime_support.cc \
Elliott Hughese27955c2011-08-26 15:21:24 -0700253 src/signal_catcher.cc \
Elliott Hughes68e76522011-10-05 13:22:16 -0700254 src/stack.cc \
Carl Shapirob5573532011-07-12 18:22:59 -0700255 src/stringpiece.cc \
Elliott Hugheseb4f6142011-07-15 17:43:51 -0700256 src/stringprintf.cc \
Brian Carlstromb0460ea2011-07-29 10:08:05 -0700257 src/thread.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700258 src/thread_list.cc \
jeffhaoe343b762011-12-05 16:36:44 -0800259 src/trace.cc \
Elliott Hughes814e4032011-08-23 12:07:56 -0700260 src/utf.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700261 src/utils.cc \
Elliott Hugheseac76672012-05-24 21:56:51 -0700262 src/well_known_classes.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700263 src/zip_archive.cc \
Ian Rogers0c7abda2012-09-19 13:33:42 -0700264 src/verifier/dex_gc_map.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700265 src/verifier/method_verifier.cc \
266 src/verifier/reg_type.cc \
267 src/verifier/reg_type_cache.cc \
268 src/verifier/register_line.cc
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700269
Shih-wei Liaod1fec812012-02-13 09:51:10 -0800270ifeq ($(ART_USE_LLVM_COMPILER),true)
271LIBART_COMMON_SRC_FILES += \
TDYa12789f96052012-07-12 20:49:53 -0700272 src/greenland/inferred_reg_category_map.cc \
Logan Chien67008a62012-06-06 18:23:12 +0800273 src/compiler_llvm/procedure_linkage_table.cc \
Logan Chien937105a2012-04-02 02:37:37 +0800274 src/compiler_llvm/runtime_support_llvm.cc
Shih-wei Liao6e94f142012-04-16 18:14:14 -0700275endif
276
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -0700277ifeq ($(ART_USE_GREENLAND_COMPILER),true)
278LIBART_COMMON_SRC_FILES += \
TDYa12789f96052012-07-12 20:49:53 -0700279 src/greenland/inferred_reg_category_map.cc \
Shih-wei Liao21d28f52012-06-12 05:55:00 -0700280 src/greenland/runtime_entry_points.cc \
281 src/greenland/runtime/support_alloc.cc \
282 src/greenland/runtime/support_cast.cc \
283 src/greenland/runtime/support_dexcache.cc \
284 src/greenland/runtime/support_exception.cc \
285 src/greenland/runtime/support_field.cc \
286 src/greenland/runtime/support_thread.cc
Shih-wei Liaoe94d9b22012-05-22 09:01:24 -0700287endif
288
Ian Rogers57b86d42012-03-27 16:05:41 -0700289LIBART_COMMON_SRC_FILES += \
Ian Rogers57b86d42012-03-27 16:05:41 -0700290 src/oat/runtime/context.cc \
291 src/oat/runtime/support_alloc.cc \
292 src/oat/runtime/support_cast.cc \
293 src/oat/runtime/support_debug.cc \
294 src/oat/runtime/support_dexcache.cc \
295 src/oat/runtime/support_field.cc \
296 src/oat/runtime/support_fillarray.cc \
297 src/oat/runtime/support_invoke.cc \
298 src/oat/runtime/support_jni.cc \
299 src/oat/runtime/support_locks.cc \
300 src/oat/runtime/support_math.cc \
301 src/oat/runtime/support_proxy.cc \
302 src/oat/runtime/support_stubs.cc \
303 src/oat/runtime/support_thread.cc \
304 src/oat/runtime/support_throw.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700305 src/oat/runtime/support_trace.cc
Shih-wei Liaod1fec812012-02-13 09:51:10 -0800306
Brian Carlstrom934486c2011-07-12 23:42:50 -0700307LIBART_TARGET_SRC_FILES := \
308 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700309 src/jdwp/jdwp_adb.cc \
Elliott Hughesffe67362011-07-17 12:09:27 -0700310 src/logging_android.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700311 src/monitor_android.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700312 src/runtime_android.cc \
Brian Carlstrom51477332012-03-25 20:20:26 -0700313 src/thread_android.cc
314
315ifeq ($(TARGET_ARCH),arm)
Ian Rogers57b86d42012-03-27 16:05:41 -0700316LIBART_TARGET_SRC_FILES += \
317 src/oat/runtime/arm/context_arm.cc.arm \
318 src/oat/runtime/arm/oat_support_entrypoints_arm.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700319 src/oat/runtime/arm/runtime_support_arm.S
Brian Carlstrom51477332012-03-25 20:20:26 -0700320else # TARGET_ARCH != arm
321ifeq ($(TARGET_ARCH),x86)
Ian Rogers57b86d42012-03-27 16:05:41 -0700322LIBART_TARGET_SRC_FILES += \
323 src/oat/runtime/x86/context_x86.cc \
324 src/oat/runtime/x86/oat_support_entrypoints_x86.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700325 src/oat/runtime/x86/runtime_support_x86.S
Brian Carlstrom51477332012-03-25 20:20:26 -0700326else # TARGET_ARCH != x86
327ifeq ($(TARGET_ARCH),mips)
Ian Rogers57b86d42012-03-27 16:05:41 -0700328LIBART_TARGET_SRC_FILES += \
jeffhao7fbee072012-08-24 17:56:54 -0700329 src/oat/runtime/mips/context_mips.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700330 src/oat/runtime/mips/oat_support_entrypoints_mips.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700331 src/oat/runtime/mips/runtime_support_mips.S
332else # TARGET_ARCH != mips
333$(error unsupported TARGET_ARCH=$(TARGET_ARCH))
334endif # TARGET_ARCH != mips
335endif # TARGET_ARCH != x86
336endif # TARGET_ARCH != arm
Ian Rogers776ac1f2012-04-13 23:36:36 -0700337
338ifeq ($(TARGET_ARCH),arm)
339LIBART_TARGET_SRC_FILES += src/thread_arm.cc
340else # TARGET_ARCH != arm
341ifeq ($(TARGET_ARCH),x86)
342LIBART_TARGET_SRC_FILES += src/thread_x86.cc
343else # TARGET_ARCH != x86
344ifeq ($(TARGET_ARCH),mips)
345LIBART_TARGET_SRC_FILES += src/thread_mips.cc
Brian Carlstrom51477332012-03-25 20:20:26 -0700346else # TARGET_ARCH != mips
347$(error unsupported TARGET_ARCH=$(TARGET_ARCH))
348endif # TARGET_ARCH != mips
349endif # TARGET_ARCH != x86
350endif # TARGET_ARCH != arm
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700351
Brian Carlstrom934486c2011-07-12 23:42:50 -0700352LIBART_HOST_SRC_FILES := \
353 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughesffe67362011-07-17 12:09:27 -0700354 src/logging_linux.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700355 src/monitor_linux.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700356 src/runtime_linux.cc \
Brian Carlstrom51477332012-03-25 20:20:26 -0700357 src/thread_linux.cc
358
359ifeq ($(HOST_ARCH),x86)
Ian Rogers57b86d42012-03-27 16:05:41 -0700360LIBART_HOST_SRC_FILES += \
361 src/oat/runtime/x86/oat_support_entrypoints_x86.cc \
362 src/oat/runtime/x86/context_x86.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700363 src/oat/runtime/x86/runtime_support_x86.S
364else # HOST_ARCH != x86
365$(error unsupported HOST_ARCH=$(HOST_ARCH))
366endif # HOST_ARCH != x86
Ian Rogers776ac1f2012-04-13 23:36:36 -0700367
368ifeq ($(HOST_ARCH),x86)
369LIBART_HOST_SRC_FILES += src/thread_x86.cc
Brian Carlstrom51477332012-03-25 20:20:26 -0700370else # HOST_ARCH != x86
371$(error unsupported HOST_ARCH=$(HOST_ARCH))
372endif # HOST_ARCH != x86
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700373
Ian Rogers776ac1f2012-04-13 23:36:36 -0700374
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700375LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \
Ian Rogersa75a0132012-09-28 11:41:42 -0700376 src/dex_instruction.h \
Mathieu Chartier7469ebf2012-09-24 16:28:36 -0700377 src/gc/space.h \
Mathieu Chartierfd678be2012-08-30 14:50:54 -0700378 src/heap.h \
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700379 src/indirect_reference_table.h \
380 src/instruction_set.h \
381 src/invoke_type.h \
Elliott Hughes460384f2012-04-04 16:53:10 -0700382 src/jdwp/jdwp.h \
383 src/jdwp/jdwp_constants.h \
Ian Rogers81d425b2012-09-27 16:03:43 -0700384 src/locks.h \
Elliott Hughes34e06962012-04-09 13:55:55 -0700385 src/mutex.h \
Elliott Hughes48257562012-06-06 17:42:44 -0700386 src/object.h \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700387 src/thread.h \
388 src/verifier/method_verifier.h
Elliott Hughes0e57ccb2012-04-03 16:04:52 -0700389
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700390LIBARTTEST_COMMON_SRC_FILES := \
Shih-wei Liaoa6af3c32011-10-17 15:25:11 -0700391 test/StackWalk/stack_walk_jni.cc \
392 test/ReferenceMap/stack_walk_refmap_jni.cc
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700393
Brian Carlstrom934486c2011-07-12 23:42:50 -0700394TEST_COMMON_SRC_FILES := \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700395 src/class_linker_test.cc \
Brian Carlstromaded5f72011-10-07 17:15:04 -0700396 src/compiler_test.cc \
Brian Carlstrom7e49dca2011-07-22 18:07:34 -0700397 src/dex_cache_test.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700398 src/dex_file_test.cc \
399 src/dex_instruction_visitor_test.cc \
Shih-wei Liao2fb97532011-08-11 16:17:23 -0700400 src/exception_test.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700401 src/file_test.cc \
Mathieu Chartier7469ebf2012-09-24 16:28:36 -0700402 src/gc/space_bitmap_test.cc \
403 src/gc/space_test.cc \
Brian Carlstrom4b2966b2012-05-22 08:54:52 -0700404 src/gtest_test.cc \
Brian Carlstrom1f870082011-08-23 16:02:11 -0700405 src/heap_test.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700406 src/image_test.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700407 src/indirect_reference_table_test.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700408 src/intern_table_test.cc \
Ian Rogerscd2764f2011-09-02 15:38:24 -0700409 src/jni_internal_test.cc \
410 src/jni_compiler_test.cc \
Ian Rogers57b86d42012-03-27 16:05:41 -0700411 src/oat/utils/arm/managed_register_arm_test.cc \
412 src/oat/utils/x86/managed_register_x86_test.cc \
Brian Carlstromcd74c4b2012-01-23 13:21:00 -0800413 src/mutex_test.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700414 src/oat_test.cc \
Carl Shapiro894d0fa2011-06-30 14:48:49 -0700415 src/object_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700416 src/reference_table_test.cc \
Logan Chien008fa512012-06-22 08:09:57 -0700417 src/runtime_support_test.cc \
Carl Shapirofc322c72011-07-27 00:20:01 -0700418 src/runtime_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700419 src/utils_test.cc \
Ian Rogers776ac1f2012-04-13 23:36:36 -0700420 src/zip_archive_test.cc \
421 src/verifier/method_verifier_test.cc \
422 src/verifier/reg_type_test.cc
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700423
Brian Carlstrom934486c2011-07-12 23:42:50 -0700424TEST_TARGET_SRC_FILES := \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700425 $(TEST_COMMON_SRC_FILES)
Carl Shapiro008e4122011-06-23 17:27:46 -0700426
Brian Carlstrom934486c2011-07-12 23:42:50 -0700427TEST_HOST_SRC_FILES := \
428 $(TEST_COMMON_SRC_FILES) \
Ian Rogers57b86d42012-03-27 16:05:41 -0700429 src/oat/utils/x86/assembler_x86_test.cc
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700430
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800431# subdirectories of test/ which are used as inputs for gtests
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700432TEST_DEX_DIRECTORIES := \
Shih-wei Liao303b01e2011-09-14 00:46:13 -0700433 AbstractMethod \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700434 AllFields \
Ian Rogers0571d352011-11-03 19:51:38 -0700435 CreateMethodSignature \
Brian Carlstrom33f741e2011-10-03 11:24:05 -0700436 ExceptionHandle \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700437 IntMath \
438 Interfaces \
439 Main \
440 MyClass \
441 MyClassNatives \
442 Nested \
Elliott Hughes77405792012-03-15 15:22:12 -0700443 NonStaticLeafMethods \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700444 ProtoCompare \
445 ProtoCompare2 \
446 StaticLeafMethods \
447 Statics \
jeffhaoabcfde32011-09-29 15:05:18 -0700448 StaticsFromCode \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700449 XandY
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700450
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800451# subdirectories of test/ which are used with test-art-target-oat
452# Declare the simplest tests (Main, HelloWorld, and Fibonacci) first, the rest are alphabetical
453TEST_OAT_DIRECTORIES := \
454 Main \
455 HelloWorld \
456 Fibonacci \
457 \
458 ExceptionTest \
459 GrowthLimit \
Mathieu Chartierbba47a42012-05-30 10:53:58 -0700460 ConcurrentGC \
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800461 IntMath \
462 Invoke \
463 MemUsage \
464 ParallelGC \
465 ReferenceMap \
466 ReflectionTest \
467 StackWalk \
468 ThreadStress
469
470# TODO: Enable when the StackWalk2 tests are passing
471# StackWalk2 \
472
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700473ART_BUILD_TARGET := false
474ART_BUILD_HOST := false
475ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
476 ART_BUILD_TARGET := true
477endif
478ifeq ($(ART_BUILD_TARGET_DEBUG),true)
479 ART_BUILD_TARGET := true
480endif
481ifeq ($(ART_BUILD_HOST_NDEBUG),true)
482 ART_BUILD_HOST := true
483endif
484ifeq ($(ART_BUILD_HOST_DEBUG),true)
485 ART_BUILD_HOST := true
486endif