blob: 26d4d227c3b289eb936c478918361bbb0581fb34 [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 Carlstrom47a0d5a2011-10-12 21:20:05 -070017# art-cache
18ART_CACHE_DIR := /data/art-cache
19ART_CACHE_OUT := $(TARGET_OUT_DATA)/art-cache
20
Brian Carlstrombd411022012-02-07 12:09:09 -080021# $(1): pathname
22define art-cache-out
23$(ART_CACHE_OUT)/$(subst /,@,$(1))
24endef
25
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -080026# directory used for gtests on device
27ART_NATIVETEST_DIR := /data/nativetest/art
28ART_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
29
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070030# directory used for tests on device
31ART_TEST_DIR := /data/art-test
32ART_TEST_OUT := $(TARGET_OUT_DATA)/art-test
33
Brian Carlstromcdc8de42011-07-19 14:23:17 -070034ART_CPP_EXTENSION := .cc
Carl Shapiro9bf84fd2011-06-17 17:05:25 -070035
Elliott Hughes0af55432011-08-17 18:37:28 -070036ART_C_INCLUDES := \
37 external/gtest/include \
38 external/icu4c/common \
39 external/icu4c/i18n \
Elliott Hughes8d768a92011-09-14 16:35:25 -070040 external/valgrind/dynamic_annotations \
buzbeec143c552011-08-20 17:38:58 -070041 external/zlib \
42 art/src \
43 dalvik/libdex
Brian Carlstromb0460ea2011-07-29 10:08:05 -070044
Elliott Hughes1d3f1142011-09-13 12:00:00 -070045art_cflags := \
Elliott Hughes7f40ffc2011-09-04 10:50:01 -070046 -O2 \
Carl Shapiro1fb86202011-06-27 17:43:13 -070047 -ggdb3 \
48 -Wall \
49 -Werror \
50 -Wextra \
51 -Wno-unused-parameter \
Elliott Hugheseaa200d2012-01-05 16:30:31 -080052 -Wstrict-aliasing=3 \
Carl Shapiro1fb86202011-06-27 17:43:13 -070053 -fno-align-jumps \
54 -fstrict-aliasing
55
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -080056ifeq ($(HOST_OS),linux)
Shih-wei Liao24782c62012-01-08 12:46:11 -080057 art_non_debug_cflags := \
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070058 -Wframe-larger-than=1728
Brian Carlstrom69d7a6b2011-12-15 17:31:21 -080059endif
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070060
61art_debug_cflags := \
62 -UNDEBUG
63
Elliott Hughes1d3f1142011-09-13 12:00:00 -070064ART_HOST_CFLAGS := $(art_cflags) -DANDROID_SMP=1
65
66ART_TARGET_CFLAGS := $(art_cflags)
67ifeq ($(TARGET_CPU_SMP),true)
68 ART_TARGET_CFLAGS += -DANDROID_SMP=1
69else
70 ART_TARGET_CFLAGS += -DANDROID_SMP=0
71endif
72
Brian Carlstrom89521892011-12-07 22:05:07 -080073# To use oprofile_android --callgraph, uncomment this and recompile with "mmm art -B -j16"
74# ART_TARGET_CFLAGS += -fno-omit-frame-pointer -marm -mapcs
75
Elliott Hughes3b6baaa2011-10-14 19:13:56 -070076ART_HOST_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
77ART_TARGET_NON_DEBUG_CFLAGS := $(art_non_debug_cflags)
78
Brian Carlstrom86927212011-09-15 11:31:11 -070079# TODO: move -fkeep-inline-functions to art_debug_cflags when target gcc > 4.4
Elliott Hughes1ba27142012-01-20 15:32:00 -080080ART_HOST_DEBUG_CFLAGS := $(art_debug_cflags) -fkeep-inline-functions
Elliott Hughesad6c9c32012-01-19 17:39:12 -080081
82ifneq ($(HOST_OS),linux)
83 # Some Mac OS pthread header files are broken with -fkeep-inline-functions.
Elliott Hughes34cf5142012-01-20 16:39:13 -080084 ART_HOST_DEBUG_CFLAGS := $(filter-out -fkeep-inline-functions,$(ART_HOST_DEBUG_CFLAGS))
Elliott Hughesad6c9c32012-01-19 17:39:12 -080085endif
86
Brian Carlstrom86927212011-09-15 11:31:11 -070087ART_TARGET_DEBUG_CFLAGS := $(art_debug_cflags)
Elliott Hughes1d3f1142011-09-13 12:00:00 -070088
Brian Carlstrom69b15fb2011-09-03 12:25:21 -070089DEX2OAT_SRC_FILES := \
90 src/dex2oat.cc
91
Brian Carlstrom78128a62011-09-15 17:21:19 -070092OATDUMP_SRC_FILES := \
93 src/oatdump.cc
94
Brian Carlstrom69b15fb2011-09-03 12:25:21 -070095OATEXEC_SRC_FILES := \
96 src/oatexec.cc
Carl Shapiro9bf84fd2011-06-17 17:05:25 -070097
Brian Carlstrom934486c2011-07-12 23:42:50 -070098LIBART_COMMON_SRC_FILES := \
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -070099 src/assembler.cc \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700100 src/assembler_arm.cc \
101 src/assembler_x86.cc \
Elliott Hughes5ea047b2011-09-13 14:38:18 -0700102 src/atomic.cc.arm \
Ian Rogersb033c752011-07-20 12:22:35 -0700103 src/calling_convention.cc \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700104 src/calling_convention_arm.cc \
105 src/calling_convention_x86.cc \
Ian Rogers5d76c432011-10-31 21:42:49 -0700106 src/card_table.cc \
Ian Rogersbdb03912011-09-14 00:55:44 -0700107 src/context.cc \
Elliott Hughes85d15452011-09-16 17:33:01 -0700108 src/context_arm.cc.arm \
109 src/context_x86.cc \
Elliott Hughesa2501992011-08-26 19:39:54 -0700110 src/check_jni.cc \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700111 src/class_linker.cc \
Brian Carlstrom1f870082011-08-23 16:02:11 -0700112 src/class_loader.cc \
Brian Carlstrom3320cf42011-10-04 14:58:28 -0700113 src/compiled_method.cc \
Brian Carlstrom9ea1cb12011-08-24 23:18:18 -0700114 src/compiler.cc \
Brian Carlstrom2cc022b2011-08-25 10:05:39 -0700115 src/compiler/Dataflow.cc \
116 src/compiler/Frontend.cc \
117 src/compiler/IntermediateRep.cc \
118 src/compiler/Ralloc.cc \
119 src/compiler/SSATransformation.cc \
120 src/compiler/Utility.cc \
121 src/compiler/codegen/RallocUtil.cc \
122 src/compiler/codegen/arm/ArchUtility.cc \
123 src/compiler/codegen/arm/ArmRallocUtil.cc \
124 src/compiler/codegen/arm/Assemble.cc \
125 src/compiler/codegen/arm/LocalOptimizations.cc \
126 src/compiler/codegen/arm/armv7-a/Codegen.cc \
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700127 src/dalvik_system_DexFile.cc \
Elliott Hughes01158d72011-09-19 19:47:10 -0700128 src/dalvik_system_VMDebug.cc \
Elliott Hughes7ede61e2011-09-14 18:18:06 -0700129 src/dalvik_system_VMRuntime.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700130 src/dalvik_system_VMStack.cc \
Elliott Hughes01158d72011-09-19 19:47:10 -0700131 src/dalvik_system_Zygote.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700132 src/debugger.cc \
Brian Carlstrom7e49dca2011-07-22 18:07:34 -0700133 src/dex_cache.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700134 src/dex_file.cc \
jeffhao10037c82012-01-23 15:06:23 -0800135 src/dex_file_verifier.cc \
Carl Shapiro12eb78e2011-06-24 14:51:06 -0700136 src/dex_instruction.cc \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700137 src/dex_verifier.cc \
Ian Rogers30fab402012-01-23 15:43:46 -0800138 src/dlmalloc.c \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700139 src/file.cc \
140 src/file_linux.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700141 src/heap.cc \
Elliott Hughes5e71b522011-10-20 13:12:32 -0700142 src/heap_bitmap.cc \
Jesse Wilsonc4824e62011-11-01 14:39:04 -0400143 src/hprof/hprof.cc \
Jesse Wilson0c54ac12011-11-09 15:14:05 -0500144 src/hprof/hprof_record.cc \
Brian Carlstrom4a289ed2011-08-16 17:17:49 -0700145 src/image.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700146 src/image_writer.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700147 src/indirect_reference_table.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700148 src/intern_table.cc \
Elliott Hughesd369bb72011-09-12 14:41:14 -0700149 src/java_lang_Class.cc \
Elliott Hughesbf86d042011-08-31 17:53:14 -0700150 src/java_lang_Object.cc \
151 src/java_lang_Runtime.cc \
152 src/java_lang_String.cc \
153 src/java_lang_System.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700154 src/java_lang_Thread.cc \
Elliott Hughes1240dad2011-09-09 16:24:50 -0700155 src/java_lang_Throwable.cc \
Elliott Hughes64bf5a32011-09-20 14:43:12 -0700156 src/java_lang_VMClassLoader.cc \
Brian Carlstrom5b8e4c82011-09-18 01:38:59 -0700157 src/java_lang_reflect_Array.cc \
Elliott Hughes2a20cfd2011-09-23 19:30:41 -0700158 src/java_lang_reflect_Constructor.cc \
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700159 src/java_lang_reflect_Field.cc \
160 src/java_lang_reflect_Method.cc \
Jesse Wilson95caa792011-10-12 18:14:17 -0400161 src/java_lang_reflect_Proxy.cc \
Elliott Hughesbf86d042011-08-31 17:53:14 -0700162 src/java_util_concurrent_atomic_AtomicLong.cc \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700163 src/jdwp/jdwp_constants.cc \
164 src/jdwp/jdwp_event.cc \
165 src/jdwp/jdwp_expand_buf.cc \
166 src/jdwp/jdwp_handler.cc \
167 src/jdwp/jdwp_main.cc \
168 src/jdwp/jdwp_socket.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700169 src/jni_compiler.cc \
Ian Rogersdf20fe02011-07-20 20:34:16 -0700170 src/jni_internal.cc \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700171 src/jni_internal_arm.cc \
172 src/jni_internal_x86.cc \
Elliott Hughes42ee1422011-09-06 12:33:32 -0700173 src/logging.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700174 src/mark_stack.cc \
175 src/mark_sweep.cc \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700176 src/managed_register_arm.cc \
177 src/managed_register_x86.cc \
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700178 src/mem_map.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700179 src/memory_region.cc \
Elliott Hughes54e7df12011-09-16 11:47:04 -0700180 src/monitor.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700181 src/mutex.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700182 src/oat.cc \
183 src/oat_file.cc \
184 src/oat_writer.cc \
Carl Shapiro3ee755d2011-06-28 12:11:04 -0700185 src/object.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700186 src/offsets.cc \
Brian Carlstrom395520e2011-09-25 19:35:00 -0700187 src/org_apache_harmony_dalvik_ddmc_DdmServer.cc \
Elliott Hughesf6a1e1e2011-10-25 16:28:04 -0700188 src/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700189 src/os_linux.cc \
Brian Carlstromae826982011-11-09 01:33:42 -0800190 src/primitive.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700191 src/reference_table.cc \
Elliott Hughes418d20f2011-09-22 14:00:39 -0700192 src/reflection.cc \
Carl Shapirod4e48fd2011-06-30 18:53:29 -0700193 src/runtime.cc \
Elliott Hughese27955c2011-08-26 15:21:24 -0700194 src/signal_catcher.cc \
Carl Shapiro69759ea2011-07-21 18:13:35 -0700195 src/space.cc \
Elliott Hughes68e76522011-10-05 13:22:16 -0700196 src/stack.cc \
Carl Shapirob5573532011-07-12 18:22:59 -0700197 src/stringpiece.cc \
Elliott Hugheseb4f6142011-07-15 17:43:51 -0700198 src/stringprintf.cc \
Shih-wei Liao31384c52011-09-06 15:27:45 -0700199 src/stub_arm.cc \
200 src/stub_x86.cc \
Elliott Hughes5ee7a8b2011-09-13 16:40:07 -0700201 src/sun_misc_Unsafe.cc \
Brian Carlstromb0460ea2011-07-29 10:08:05 -0700202 src/thread.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700203 src/thread_list.cc \
jeffhaoe343b762011-12-05 16:36:44 -0800204 src/trace.cc \
Shih-wei Liao2d831012011-09-28 22:06:53 -0700205 src/runtime_support.cc \
Elliott Hughes814e4032011-08-23 12:07:56 -0700206 src/utf.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700207 src/utils.cc \
Elliott Hughes5c9f0b42011-12-15 18:15:46 -0800208 src/zip_archive.cc
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700209
Brian Carlstrom934486c2011-07-12 23:42:50 -0700210LIBART_TARGET_SRC_FILES := \
211 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughes872d4ec2011-10-21 17:07:15 -0700212 src/jdwp/jdwp_adb.cc \
Elliott Hughesffe67362011-07-17 12:09:27 -0700213 src/logging_android.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700214 src/monitor_android.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700215 src/runtime_android.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700216 src/thread_android.cc \
Elliott Hughes5c9f0b42011-12-15 18:15:46 -0800217 src/thread_arm.cc \
218 src/runtime_support_arm.S
Carl Shapiroa5d5cfd2011-06-21 12:46:59 -0700219
Brian Carlstrom934486c2011-07-12 23:42:50 -0700220LIBART_HOST_SRC_FILES := \
221 $(LIBART_COMMON_SRC_FILES) \
Elliott Hughesffe67362011-07-17 12:09:27 -0700222 src/logging_linux.cc \
Elliott Hughesfc861622011-10-17 17:57:47 -0700223 src/monitor_linux.cc \
Ian Rogersb033c752011-07-20 12:22:35 -0700224 src/runtime_linux.cc \
Elliott Hughes8daa0922011-09-11 13:46:25 -0700225 src/thread_linux.cc \
Elliott Hughes5c9f0b42011-12-15 18:15:46 -0800226 src/thread_x86.cc \
227 src/runtime_support_x86.S
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700228
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700229LIBARTTEST_COMMON_SRC_FILES := \
Shih-wei Liaoa6af3c32011-10-17 15:25:11 -0700230 test/StackWalk/stack_walk_jni.cc \
231 test/ReferenceMap/stack_walk_refmap_jni.cc
Brian Carlstromcdc8de42011-07-19 14:23:17 -0700232
Brian Carlstrom934486c2011-07-12 23:42:50 -0700233TEST_COMMON_SRC_FILES := \
Carl Shapiro0e5d75d2011-07-06 18:28:37 -0700234 src/class_linker_test.cc \
Brian Carlstromaded5f72011-10-07 17:15:04 -0700235 src/compiler_test.cc \
Brian Carlstrom7e49dca2011-07-22 18:07:34 -0700236 src/dex_cache_test.cc \
Carl Shapiro1fb86202011-06-27 17:43:13 -0700237 src/dex_file_test.cc \
238 src/dex_instruction_visitor_test.cc \
jeffhaoba5ebb92011-08-25 17:24:37 -0700239 src/dex_verifier_test.cc \
Shih-wei Liao2fb97532011-08-11 16:17:23 -0700240 src/exception_test.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700241 src/file_test.cc \
Brian Carlstrom1f870082011-08-23 16:02:11 -0700242 src/heap_test.cc \
Brian Carlstromdb4d5402011-08-09 12:18:28 -0700243 src/image_test.cc \
Elliott Hughes6c1a3942011-08-17 15:00:06 -0700244 src/indirect_reference_table_test.cc \
Brian Carlstrom7e93b502011-08-04 14:16:22 -0700245 src/intern_table_test.cc \
Ian Rogerscd2764f2011-09-02 15:38:24 -0700246 src/jni_internal_test.cc \
247 src/jni_compiler_test.cc \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700248 src/managed_register_arm_test.cc \
249 src/managed_register_x86_test.cc \
Brian Carlstromcd74c4b2012-01-23 13:21:00 -0800250 src/mutex_test.cc \
Brian Carlstrome24fa612011-09-29 00:53:55 -0700251 src/oat_test.cc \
Carl Shapiro894d0fa2011-06-30 14:48:49 -0700252 src/object_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700253 src/reference_table_test.cc \
Carl Shapirofc322c72011-07-27 00:20:01 -0700254 src/runtime_test.cc \
Brian Carlstromb0460ea2011-07-29 10:08:05 -0700255 src/space_test.cc \
Elliott Hughes11e45072011-08-16 17:40:46 -0700256 src/utils_test.cc \
Brian Carlstromaded5f72011-10-07 17:15:04 -0700257 src/zip_archive_test.cc
Jesse Wilsonc981ace2011-06-22 14:17:14 -0700258
Brian Carlstrom934486c2011-07-12 23:42:50 -0700259TEST_TARGET_SRC_FILES := \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700260 $(TEST_COMMON_SRC_FILES)
Carl Shapiro008e4122011-06-23 17:27:46 -0700261
Brian Carlstrom934486c2011-07-12 23:42:50 -0700262TEST_HOST_SRC_FILES := \
263 $(TEST_COMMON_SRC_FILES) \
Ian Rogers2c8f6532011-09-02 17:16:34 -0700264 src/assembler_x86_test.cc
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700265
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800266# subdirectories of test/ which are used as inputs for gtests
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700267TEST_DEX_DIRECTORIES := \
Shih-wei Liao303b01e2011-09-14 00:46:13 -0700268 AbstractMethod \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700269 AllFields \
Ian Rogers0571d352011-11-03 19:51:38 -0700270 CreateMethodSignature \
Brian Carlstrom33f741e2011-10-03 11:24:05 -0700271 ExceptionHandle \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700272 IntMath \
273 Interfaces \
274 Main \
275 MyClass \
276 MyClassNatives \
277 Nested \
278 ProtoCompare \
279 ProtoCompare2 \
280 StaticLeafMethods \
281 Statics \
jeffhaoabcfde32011-09-29 15:05:18 -0700282 StaticsFromCode \
Brian Carlstrom9f30b382011-08-28 22:41:38 -0700283 XandY
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700284
Brian Carlstrom32b4b2a2012-01-31 16:21:40 -0800285# subdirectories of test/ which are used with test-art-target-oat
286# Declare the simplest tests (Main, HelloWorld, and Fibonacci) first, the rest are alphabetical
287TEST_OAT_DIRECTORIES := \
288 Main \
289 HelloWorld \
290 Fibonacci \
291 \
292 ExceptionTest \
293 GrowthLimit \
294 IntMath \
295 Invoke \
296 MemUsage \
297 ParallelGC \
298 ReferenceMap \
299 ReflectionTest \
300 StackWalk \
301 ThreadStress
302
303# TODO: Enable when the StackWalk2 tests are passing
304# StackWalk2 \
305
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700306ART_BUILD_TARGET := false
307ART_BUILD_HOST := false
308ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
309 ART_BUILD_TARGET := true
310endif
311ifeq ($(ART_BUILD_TARGET_DEBUG),true)
312 ART_BUILD_TARGET := true
313endif
314ifeq ($(ART_BUILD_HOST_NDEBUG),true)
315 ART_BUILD_HOST := true
316endif
317ifeq ($(ART_BUILD_HOST_DEBUG),true)
318 ART_BUILD_HOST := true
319endif