blob: 33d3d6a41026ee2516993f04fedcf096b2851fe4 [file] [log] [blame]
Brian Carlstrom7940e442013-07-12 13:46:57 -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
17LOCAL_PATH := $(call my-dir)
18
Ian Rogersafd9acc2014-06-17 08:21:54 -070019include art/build/Android.common_build.mk
Brian Carlstrom7940e442013-07-12 13:46:57 -070020
21LIBART_COMMON_SRC_FILES := \
Mathieu Chartierc7853442015-03-27 14:35:38 -070022 art_field.cc \
Mathieu Chartiere401d142015-04-22 13:56:20 -070023 art_method.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070024 atomic.cc.arm \
25 barrier.cc \
26 base/allocator.cc \
Mathieu Chartierb666f482015-02-18 14:33:14 -080027 base/arena_allocator.cc \
Mathieu Chartiere5d80f82015-10-15 17:47:48 -070028 base/arena_bit_vector.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070029 base/bit_vector.cc \
Vladimir Marko5096e662015-12-08 19:25:49 +000030 base/file_magic.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070031 base/hex_dump.cc \
32 base/logging.cc \
33 base/mutex.cc \
Mathieu Chartierb666f482015-02-18 14:33:14 -080034 base/scoped_arena_allocator.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070035 base/scoped_flock.cc \
36 base/stringpiece.cc \
37 base/stringprintf.cc \
Vladimir Marko80afd022015-05-19 18:08:00 +010038 base/time_utils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070039 base/timing_logger.cc \
40 base/unix_file/fd_file.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070041 base/unix_file/random_access_file_utils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070042 check_jni.cc \
43 class_linker.cc \
Mathieu Chartiercc5ebdf2015-07-27 11:19:43 -070044 class_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070045 common_throws.cc \
46 debugger.cc \
47 dex_file.cc \
48 dex_file_verifier.cc \
49 dex_instruction.cc \
50 elf_file.cc \
Artem Udovichenkod9786b02015-10-14 16:36:55 +030051 fault_handler.cc \
Man Cao8c2ff642015-05-27 17:25:30 -070052 gc/allocation_record.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070053 gc/allocator/dlmalloc.cc \
54 gc/allocator/rosalloc.cc \
Mathieu Chartier4858a932015-01-23 13:18:53 -080055 gc/accounting/bitmap.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070056 gc/accounting/card_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070057 gc/accounting/heap_bitmap.cc \
58 gc/accounting/mod_union_table.cc \
59 gc/accounting/remembered_set.cc \
60 gc/accounting/space_bitmap.cc \
61 gc/collector/concurrent_copying.cc \
62 gc/collector/garbage_collector.cc \
63 gc/collector/immune_region.cc \
Mathieu Chartier763a31e2015-11-16 16:05:55 -080064 gc/collector/immune_spaces.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070065 gc/collector/mark_compact.cc \
66 gc/collector/mark_sweep.cc \
67 gc/collector/partial_mark_sweep.cc \
68 gc/collector/semi_space.cc \
69 gc/collector/sticky_mark_sweep.cc \
70 gc/gc_cause.cc \
71 gc/heap.cc \
72 gc/reference_processor.cc \
73 gc/reference_queue.cc \
Mathieu Chartieraa516822015-10-02 15:53:37 -070074 gc/scoped_gc_critical_section.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070075 gc/space/bump_pointer_space.cc \
76 gc/space/dlmalloc_space.cc \
77 gc/space/image_space.cc \
78 gc/space/large_object_space.cc \
79 gc/space/malloc_space.cc \
Hiroshi Yamauchi2cd334a2015-01-09 14:03:35 -080080 gc/space/region_space.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070081 gc/space/rosalloc_space.cc \
82 gc/space/space.cc \
83 gc/space/zygote_space.cc \
Mathieu Chartiera5eae692014-12-17 17:56:03 -080084 gc/task_processor.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070085 hprof/hprof.cc \
86 image.cc \
87 indirect_reference_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070088 instrumentation.cc \
89 intern_table.cc \
90 interpreter/interpreter.cc \
91 interpreter/interpreter_common.cc \
Colin Crosse84e4f72015-03-18 14:01:19 -070092 interpreter/interpreter_goto_table_impl.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070093 interpreter/interpreter_switch_impl.cc \
Andreas Gampe2969bcd2015-03-09 12:57:41 -070094 interpreter/unstarted_runtime.cc \
Ian Rogers68d8b422014-07-17 11:09:10 -070095 java_vm_ext.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070096 jdwp/jdwp_event.cc \
97 jdwp/jdwp_expand_buf.cc \
98 jdwp/jdwp_handler.cc \
99 jdwp/jdwp_main.cc \
100 jdwp/jdwp_request.cc \
101 jdwp/jdwp_socket.cc \
102 jdwp/object_registry.cc \
Ian Rogers68d8b422014-07-17 11:09:10 -0700103 jni_env_ext.cc \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800104 jit/jit.cc \
105 jit/jit_code_cache.cc \
106 jit/jit_instrumentation.cc \
Calin Juravle31f2c152015-10-23 17:56:15 +0100107 jit/offline_profiling_info.cc \
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100108 jit/profiling_info.cc \
Igor Murashkinfc1ccd72015-07-30 15:11:09 -0700109 lambda/art_lambda_method.cc \
Igor Murashkine2facc52015-07-10 13:49:08 -0700110 lambda/box_table.cc \
Igor Murashkinfc1ccd72015-07-30 15:11:09 -0700111 lambda/closure.cc \
112 lambda/closure_builder.cc \
Igor Murashkin6918bf12015-09-27 19:19:06 -0700113 lambda/leaking_allocator.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700114 jni_internal.cc \
115 jobject_comparator.cc \
Mathieu Chartierc7853442015-03-27 14:35:38 -0700116 linear_alloc.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700117 mem_map.cc \
118 memory_region.cc \
Mathieu Chartierfc58af42015-04-16 18:00:39 -0700119 mirror/abstract_method.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700120 mirror/array.cc \
121 mirror/class.cc \
122 mirror/dex_cache.cc \
Mathieu Chartierdaaf3262015-03-24 13:30:28 -0700123 mirror/field.cc \
Mathieu Chartierfc58af42015-04-16 18:00:39 -0700124 mirror/method.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700125 mirror/object.cc \
126 mirror/reference.cc \
127 mirror/stack_trace_element.cc \
128 mirror/string.cc \
129 mirror/throwable.cc \
130 monitor.cc \
Calin Juravlec8423522014-08-12 20:55:20 +0100131 native_bridge_art_interface.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700132 native/dalvik_system_DexFile.cc \
133 native/dalvik_system_VMDebug.cc \
134 native/dalvik_system_VMRuntime.cc \
135 native/dalvik_system_VMStack.cc \
136 native/dalvik_system_ZygoteHooks.cc \
137 native/java_lang_Class.cc \
138 native/java_lang_DexCache.cc \
139 native/java_lang_Object.cc \
140 native/java_lang_Runtime.cc \
141 native/java_lang_String.cc \
Jeff Hao848f70a2014-01-15 13:49:50 -0800142 native/java_lang_StringFactory.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700143 native/java_lang_System.cc \
144 native/java_lang_Thread.cc \
145 native/java_lang_Throwable.cc \
146 native/java_lang_VMClassLoader.cc \
Mathieu Chartiera5a53ef2014-09-12 12:58:05 -0700147 native/java_lang_ref_FinalizerReference.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700148 native/java_lang_ref_Reference.cc \
149 native/java_lang_reflect_Array.cc \
150 native/java_lang_reflect_Constructor.cc \
151 native/java_lang_reflect_Field.cc \
152 native/java_lang_reflect_Method.cc \
153 native/java_lang_reflect_Proxy.cc \
154 native/java_util_concurrent_atomic_AtomicLong.cc \
Jeff Hao848f70a2014-01-15 13:49:50 -0800155 native/libcore_util_CharsetUtils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700156 native/org_apache_harmony_dalvik_ddmc_DdmServer.cc \
157 native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \
Piotr Jastrzebskidf0b17a2015-04-24 09:18:00 +0100158 native/OpenjdkJvm.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700159 native/sun_misc_Unsafe.cc \
160 oat.cc \
161 oat_file.cc \
Richard Uhler66d874d2015-01-15 09:37:19 -0800162 oat_file_assistant.cc \
Mathieu Chartierf9c6fc62015-10-07 11:44:05 -0700163 oat_file_manager.cc \
Nicolas Geoffray524e7ea2015-10-16 17:13:34 +0100164 oat_quick_method_header.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700165 object_lock.cc \
166 offsets.cc \
167 os_linux.cc \
168 parsed_options.cc \
169 primitive.cc \
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300170 profiler.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700171 quick_exception_handler.cc \
172 quick/inline_method_analyser.cc \
173 reference_table.cc \
174 reflection.cc \
175 runtime.cc \
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800176 runtime_options.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700177 signal_catcher.cc \
178 stack.cc \
Nicolas Geoffray004c2302015-03-20 10:06:38 +0000179 stack_map.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700180 thread.cc \
181 thread_list.cc \
182 thread_pool.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700183 trace.cc \
184 transaction.cc \
Artem Udovichenkod9786b02015-10-14 16:36:55 +0300185 type_lookup_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700186 utf.cc \
187 utils.cc \
188 verifier/dex_gc_map.cc \
189 verifier/instruction_flags.cc \
190 verifier/method_verifier.cc \
191 verifier/reg_type.cc \
192 verifier/reg_type_cache.cc \
193 verifier/register_line.cc \
194 well_known_classes.cc \
195 zip_archive.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700196
197LIBART_COMMON_SRC_FILES += \
Ian Rogers22d5e732014-07-15 22:23:51 -0700198 arch/context.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800199 arch/instruction_set.cc \
200 arch/instruction_set_features.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700201 arch/memcmp16.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800202 arch/arm/instruction_set_features_arm.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700203 arch/arm/registers_arm.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800204 arch/arm64/instruction_set_features_arm64.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700205 arch/arm64/registers_arm64.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800206 arch/mips/instruction_set_features_mips.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700207 arch/mips/registers_mips.cc \
Andreas Gampe57b34292015-01-14 15:45:59 -0800208 arch/mips64/instruction_set_features_mips64.cc \
209 arch/mips64/registers_mips64.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800210 arch/x86/instruction_set_features_x86.cc \
211 arch/x86/registers_x86.cc \
212 arch/x86_64/registers_x86_64.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700213 entrypoints/entrypoint_utils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700214 entrypoints/jni/jni_entrypoints.cc \
215 entrypoints/math_entrypoints.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700216 entrypoints/quick/quick_alloc_entrypoints.cc \
217 entrypoints/quick/quick_cast_entrypoints.cc \
218 entrypoints/quick/quick_deoptimization_entrypoints.cc \
219 entrypoints/quick/quick_dexcache_entrypoints.cc \
220 entrypoints/quick/quick_field_entrypoints.cc \
221 entrypoints/quick/quick_fillarray_entrypoints.cc \
222 entrypoints/quick/quick_instrumentation_entrypoints.cc \
223 entrypoints/quick/quick_jni_entrypoints.cc \
224 entrypoints/quick/quick_lock_entrypoints.cc \
225 entrypoints/quick/quick_math_entrypoints.cc \
226 entrypoints/quick/quick_thread_entrypoints.cc \
227 entrypoints/quick/quick_throw_entrypoints.cc \
228 entrypoints/quick/quick_trampoline_entrypoints.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700229
Elliott Hughes7ac7e322014-06-27 17:20:59 -0700230LIBART_TARGET_LDFLAGS :=
Ian Rogersc5f17732014-06-05 20:48:42 -0700231LIBART_HOST_LDFLAGS :=
Colin Crossdc781a12014-02-04 16:22:03 -0800232
Tamas Berghammer76e5eab2015-09-02 11:24:33 +0100233# Keep the __jit_debug_register_code symbol as a unique symbol during ICF for architectures where
234# we use gold as the linker (arm, x86, x86_64). The symbol is used by the debuggers to detect when
235# new jit code is generated. We don't want it to be called when a different function with the same
236# (empty) body is called.
237JIT_DEBUG_REGISTER_CODE_LDFLAGS := -Wl,--keep-unique,__jit_debug_register_code
238LIBART_TARGET_LDFLAGS_arm := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS)
239LIBART_TARGET_LDFLAGS_x86 := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS)
240LIBART_TARGET_LDFLAGS_x86_64 := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS)
241JIT_DEBUG_REGISTER_CODE_LDFLAGS :=
242
Brian Carlstrom7940e442013-07-12 13:46:57 -0700243LIBART_TARGET_SRC_FILES := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700244 $(LIBART_COMMON_SRC_FILES) \
Ian Rogers22d5e732014-07-15 22:23:51 -0700245 jdwp/jdwp_adb.cc \
246 monitor_android.cc \
247 runtime_android.cc \
248 thread_android.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700249
Colin Crossdc781a12014-02-04 16:22:03 -0800250LIBART_TARGET_SRC_FILES_arm := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700251 arch/arm/context_arm.cc.arm \
252 arch/arm/entrypoints_init_arm.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800253 arch/arm/instruction_set_features_assembly_tests.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700254 arch/arm/jni_entrypoints_arm.S \
255 arch/arm/memcmp16_arm.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700256 arch/arm/quick_entrypoints_arm.S \
Zheng Xu5667fdb2014-10-23 18:29:55 +0800257 arch/arm/quick_entrypoints_cc_arm.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700258 arch/arm/thread_arm.cc \
259 arch/arm/fault_handler_arm.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800260
Stuart Monteithb95a5342014-03-12 13:32:32 +0000261LIBART_TARGET_SRC_FILES_arm64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700262 arch/arm64/context_arm64.cc \
263 arch/arm64/entrypoints_init_arm64.cc \
264 arch/arm64/jni_entrypoints_arm64.S \
265 arch/arm64/memcmp16_arm64.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700266 arch/arm64/quick_entrypoints_arm64.S \
267 arch/arm64/thread_arm64.cc \
268 monitor_pool.cc \
269 arch/arm64/fault_handler_arm64.cc
Stuart Monteithb95a5342014-03-12 13:32:32 +0000270
Ying Wangc6585b72014-04-23 18:19:44 -0700271LIBART_SRC_FILES_x86 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700272 arch/x86/context_x86.cc \
273 arch/x86/entrypoints_init_x86.cc \
274 arch/x86/jni_entrypoints_x86.S \
Alexander Ivchenko907194a2014-07-14 18:54:34 +0400275 arch/x86/memcmp16_x86.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700276 arch/x86/quick_entrypoints_x86.S \
277 arch/x86/thread_x86.cc \
278 arch/x86/fault_handler_x86.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800279
Ying Wangc6585b72014-04-23 18:19:44 -0700280LIBART_TARGET_SRC_FILES_x86 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700281 $(LIBART_SRC_FILES_x86)
Ying Wangc6585b72014-04-23 18:19:44 -0700282
Dave Allisondfd3b472014-07-16 16:04:32 -0700283# Note that the fault_handler_x86.cc is not a mistake. This file is
284# shared between the x86 and x86_64 architectures.
Ying Wangc6585b72014-04-23 18:19:44 -0700285LIBART_SRC_FILES_x86_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700286 arch/x86_64/context_x86_64.cc \
287 arch/x86_64/entrypoints_init_x86_64.cc \
288 arch/x86_64/jni_entrypoints_x86_64.S \
Varvara Rainchik2a0bffd2014-07-30 17:01:24 +0400289 arch/x86_64/memcmp16_x86_64.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700290 arch/x86_64/quick_entrypoints_x86_64.S \
291 arch/x86_64/thread_x86_64.cc \
292 monitor_pool.cc \
Dave Allisondfd3b472014-07-16 16:04:32 -0700293 arch/x86/fault_handler_x86.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800294
Ying Wangc6585b72014-04-23 18:19:44 -0700295LIBART_TARGET_SRC_FILES_x86_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700296 $(LIBART_SRC_FILES_x86_64) \
Colin Crossdc781a12014-02-04 16:22:03 -0800297
298LIBART_TARGET_SRC_FILES_mips := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700299 arch/mips/context_mips.cc \
300 arch/mips/entrypoints_init_mips.cc \
301 arch/mips/jni_entrypoints_mips.S \
302 arch/mips/memcmp16_mips.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700303 arch/mips/quick_entrypoints_mips.S \
304 arch/mips/thread_mips.cc \
305 arch/mips/fault_handler_mips.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800306
Andreas Gampe1a5c4062015-01-15 12:10:47 -0800307LIBART_TARGET_SRC_FILES_mips64 := \
308 arch/mips64/context_mips64.cc \
309 arch/mips64/entrypoints_init_mips64.cc \
310 arch/mips64/jni_entrypoints_mips64.S \
311 arch/mips64/memcmp16_mips64.S \
312 arch/mips64/quick_entrypoints_mips64.S \
313 arch/mips64/thread_mips64.cc \
314 monitor_pool.cc \
315 arch/mips64/fault_handler_mips64.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700316
Brian Carlstrom7940e442013-07-12 13:46:57 -0700317LIBART_HOST_SRC_FILES := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700318 $(LIBART_COMMON_SRC_FILES) \
Ian Rogers22d5e732014-07-15 22:23:51 -0700319 monitor_linux.cc \
320 runtime_linux.cc \
321 thread_linux.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700322
Ying Wangc6585b72014-04-23 18:19:44 -0700323LIBART_HOST_SRC_FILES_32 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700324 $(LIBART_SRC_FILES_x86)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700325
Ying Wangc6585b72014-04-23 18:19:44 -0700326LIBART_HOST_SRC_FILES_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700327 $(LIBART_SRC_FILES_x86_64)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700328
329LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \
Ian Rogersd582fa42014-11-05 23:46:43 -0800330 arch/instruction_set.h \
Mathieu Chartierbad02672014-08-25 13:08:22 -0700331 base/allocator.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700332 base/mutex.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700333 debugger.h \
Andreas Gampe4303ba92014-11-06 01:00:46 -0800334 base/unix_file/fd_file.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700335 dex_file.h \
336 dex_instruction.h \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800337 dex_instruction_utils.h \
Mathieu Chartiere34fa1d2015-01-14 14:55:47 -0800338 gc_root.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700339 gc/allocator_type.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700340 gc/allocator/rosalloc.h \
Mathieu Chartierb363f662014-07-16 13:28:58 -0700341 gc/collector_type.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700342 gc/collector/gc_type.h \
343 gc/heap.h \
Hiroshi Yamauchid25f8422015-01-30 16:25:12 -0800344 gc/space/region_space.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700345 gc/space/space.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700346 gc/weak_root_state.h \
Mathieu Chartiere401d142015-04-22 13:56:20 -0700347 image.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700348 instrumentation.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700349 indirect_reference_table.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700350 invoke_type.h \
351 jdwp/jdwp.h \
352 jdwp/jdwp_constants.h \
353 lock_word.h \
354 mirror/class.h \
355 oat.h \
356 object_callbacks.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700357 profiler_options.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700358 quick/inline_method_analyser.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700359 runtime.h \
360 stack.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700361 thread.h \
362 thread_state.h \
363 verifier/method_verifier.h
Brian Carlstrom7940e442013-07-12 13:46:57 -0700364
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700365LIBART_CFLAGS := -DBUILDING_LIBART=1
Brian Carlstrom7940e442013-07-12 13:46:57 -0700366
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900367LIBART_TARGET_CFLAGS :=
368LIBART_HOST_CFLAGS :=
369
Christopher Ferrisfc35de02014-07-10 18:53:22 -0700370ifeq ($(MALLOC_IMPL),dlmalloc)
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900371 LIBART_TARGET_CFLAGS += -DUSE_DLMALLOC
Christopher Ferrisfc35de02014-07-10 18:53:22 -0700372else
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900373 LIBART_TARGET_CFLAGS += -DUSE_JEMALLOC
Christopher Ferrisc4ddc042014-05-13 14:47:50 -0700374endif
375
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700376# Default dex2oat instruction set features.
377LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES := default
378LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := default
3792ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := default
380ifeq ($(DEX2OAT_TARGET_ARCH),arm)
381 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a15 krait denver))
Andreas Gampe72a122c2014-11-13 19:10:33 -0800382 LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := atomic_ldrd_strd,div
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700383 else
384 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a7))
385 LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := div
386 endif
387 endif
388endif
389ifeq ($(2ND_DEX2OAT_TARGET_ARCH),arm)
390 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a15 krait denver))
Andreas Gampe72a122c2014-11-13 19:10:33 -0800391 2ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := atomic_ldrd_strd,div
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700392 else
393 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a7))
394 2ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := div
395 endif
396 endif
397endif
398
Brian Carlstrom7940e442013-07-12 13:46:57 -0700399# $(1): target or host
400# $(2): ndebug or debug
Calin Juravle65e069d2015-06-08 10:35:24 +0100401# $(3): static or shared (empty means shared, applies only for host)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700402define build-libart
403 ifneq ($(1),target)
404 ifneq ($(1),host)
405 $$(error expected target or host for argument 1, received $(1))
406 endif
407 endif
408 ifneq ($(2),ndebug)
409 ifneq ($(2),debug)
410 $$(error expected ndebug or debug for argument 2, received $(2))
411 endif
412 endif
413
414 art_target_or_host := $(1)
415 art_ndebug_or_debug := $(2)
Calin Juravle65e069d2015-06-08 10:35:24 +0100416 art_static_or_shared := $(3)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700417
Ian Rogersafd9acc2014-06-17 08:21:54 -0700418 include $$(CLEAR_VARS)
419 LOCAL_CPP_EXTENSION := $$(ART_CPP_EXTENSION)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700420 ifeq ($$(art_ndebug_or_debug),ndebug)
421 LOCAL_MODULE := libart
Dehao Chen6c36a8b2014-11-13 14:13:58 -0800422 ifeq ($$(art_target_or_host),target)
423 LOCAL_FDO_SUPPORT := true
424 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700425 else # debug
426 LOCAL_MODULE := libartd
427 endif
428
429 LOCAL_MODULE_TAGS := optional
Calin Juravle65e069d2015-06-08 10:35:24 +0100430
431 ifeq ($$(art_static_or_shared),static)
432 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
433 else
434 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
435 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700436
437 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700438 LOCAL_SRC_FILES := $$(LIBART_TARGET_SRC_FILES)
439 $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \
440 $$(eval LOCAL_SRC_FILES_$$(arch) := $$$$(LIBART_TARGET_SRC_FILES_$$(arch))))
Brian Carlstrom7940e442013-07-12 13:46:57 -0700441 else # host
Ian Rogersafd9acc2014-06-17 08:21:54 -0700442 LOCAL_SRC_FILES := $$(LIBART_HOST_SRC_FILES)
443 LOCAL_SRC_FILES_32 := $$(LIBART_HOST_SRC_FILES_32)
444 LOCAL_SRC_FILES_64 := $$(LIBART_HOST_SRC_FILES_64)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700445 LOCAL_IS_HOST_MODULE := true
446 endif
447
Colin Crossdc781a12014-02-04 16:22:03 -0800448 GENERATED_SRC_DIR := $$(call local-generated-sources-dir)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700449 ENUM_OPERATOR_OUT_CC_FILES := $$(patsubst %.h,%_operator_out.cc,$$(LIBART_ENUM_OPERATOR_OUT_HEADER_FILES))
450 ENUM_OPERATOR_OUT_GEN := $$(addprefix $$(GENERATED_SRC_DIR)/,$$(ENUM_OPERATOR_OUT_CC_FILES))
451
452$$(ENUM_OPERATOR_OUT_GEN): art/tools/generate-operator-out.py
453$$(ENUM_OPERATOR_OUT_GEN): PRIVATE_CUSTOM_TOOL = art/tools/generate-operator-out.py $(LOCAL_PATH) $$< > $$@
454$$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PATH)/%.h
455 $$(transform-generated-source)
456
457 LOCAL_GENERATED_SOURCES += $$(ENUM_OPERATOR_OUT_GEN)
458
Ian Rogersafd9acc2014-06-17 08:21:54 -0700459 LOCAL_CFLAGS := $$(LIBART_CFLAGS)
Dan Albert58bea4a2014-08-09 18:08:07 -0700460 LOCAL_LDFLAGS := $$(LIBART_LDFLAGS)
Ian Rogersc5f17732014-06-05 20:48:42 -0700461 ifeq ($$(art_target_or_host),target)
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900462 LOCAL_CFLAGS += $$(LIBART_TARGET_CFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700463 LOCAL_LDFLAGS += $$(LIBART_TARGET_LDFLAGS)
Tamas Berghammer76e5eab2015-09-02 11:24:33 +0100464 $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \
465 $$(eval LOCAL_LDFLAGS_$$(arch) := $$(LIBART_TARGET_LDFLAGS_$$(arch))))
Calin Juravle65e069d2015-06-08 10:35:24 +0100466 else #host
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900467 LOCAL_CFLAGS += $$(LIBART_HOST_CFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700468 LOCAL_LDFLAGS += $$(LIBART_HOST_LDFLAGS)
Calin Juravle65e069d2015-06-08 10:35:24 +0100469 ifeq ($$(art_static_or_shared),static)
470 LOCAL_LDFLAGS += -static
471 endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700472 endif
Colin Crossdc781a12014-02-04 16:22:03 -0800473
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700474 # Clang usage
Brian Carlstrom7940e442013-07-12 13:46:57 -0700475 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700476 $$(eval $$(call set-target-local-clang-vars))
477 $$(eval $$(call set-target-local-cflags-vars,$(2)))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700478 LOCAL_CFLAGS_$(DEX2OAT_TARGET_ARCH) += -DART_DEFAULT_INSTRUCTION_SET_FEATURES="$(LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES)"
479 LOCAL_CFLAGS_$(2ND_DEX2OAT_TARGET_ARCH) += -DART_DEFAULT_INSTRUCTION_SET_FEATURES="$(2ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES)"
Brian Carlstrom7940e442013-07-12 13:46:57 -0700480 else # host
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700481 LOCAL_CLANG := $$(ART_HOST_CLANG)
482 LOCAL_LDLIBS := $$(ART_HOST_LDLIBS)
483 LOCAL_LDLIBS += -ldl -lpthread
484 ifeq ($$(HOST_OS),linux)
485 LOCAL_LDLIBS += -lrt
486 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700487 LOCAL_CFLAGS += $$(ART_HOST_CFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700488 LOCAL_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES="$(LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES)"
Roland Levillain12bd7212015-06-04 17:50:27 +0100489 LOCAL_ASFLAGS += $$(ART_HOST_ASFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700490
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700491 ifeq ($$(art_ndebug_or_debug),debug)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700492 LOCAL_CFLAGS += $$(ART_HOST_DEBUG_CFLAGS)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700493 else
Ian Rogersafd9acc2014-06-17 08:21:54 -0700494 LOCAL_CFLAGS += $$(ART_HOST_NON_DEBUG_CFLAGS)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700495 endif
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700496 LOCAL_MULTILIB := both
Brian Carlstrom7940e442013-07-12 13:46:57 -0700497 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700498
Ian Rogersafd9acc2014-06-17 08:21:54 -0700499 LOCAL_C_INCLUDES += $$(ART_C_INCLUDES)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800500 LOCAL_C_INCLUDES += art/cmdline
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700501 LOCAL_C_INCLUDES += art/sigchainlib
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800502 LOCAL_C_INCLUDES += art
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700503
Calin Juravle65e069d2015-06-08 10:35:24 +0100504 ifeq ($$(art_static_or_shared),static)
Dmitriy Ivanov44409d32015-11-11 14:18:55 -0800505 LOCAL_STATIC_LIBRARIES := libnativehelper
506 LOCAL_STATIC_LIBRARIES += libnativebridge
507 LOCAL_STATIC_LIBRARIES += libnativeloader
508 LOCAL_STATIC_LIBRARIES += libsigchain_dummy
509 LOCAL_STATIC_LIBRARIES += libbacktrace
510 LOCAL_STATIC_LIBRARIES += liblz4
Calin Juravle65e069d2015-06-08 10:35:24 +0100511 else
Dmitriy Ivanov44409d32015-11-11 14:18:55 -0800512 LOCAL_SHARED_LIBRARIES := libnativehelper
513 LOCAL_SHARED_LIBRARIES += libnativebridge
514 LOCAL_SHARED_LIBRARIES += libnativeloader
515 LOCAL_SHARED_LIBRARIES += libsigchain
516 LOCAL_SHARED_LIBRARIES += libbacktrace
517 LOCAL_SHARED_LIBRARIES += liblz4
Calin Juravle65e069d2015-06-08 10:35:24 +0100518 endif
519
Brian Carlstrom7940e442013-07-12 13:46:57 -0700520 ifeq ($$(art_target_or_host),target)
Ian Rogers872dd822014-10-30 11:19:14 -0700521 LOCAL_SHARED_LIBRARIES += libdl
522 # ZipArchive support, the order matters here to get all symbols.
Narayan Kamath657318c2015-04-28 09:56:28 +0100523 LOCAL_STATIC_LIBRARIES := libziparchive libz libbase
Ian Rogers872dd822014-10-30 11:19:14 -0700524 # For android::FileMap used by libziparchive.
525 LOCAL_SHARED_LIBRARIES += libutils
526 # For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted.
527 LOCAL_SHARED_LIBRARIES += libcutils
Brian Carlstrom7940e442013-07-12 13:46:57 -0700528 else # host
Calin Juravle65e069d2015-06-08 10:35:24 +0100529 ifeq ($$(art_static_or_shared),static)
Alex Light4cd27d62015-08-18 23:03:42 +0000530 LOCAL_STATIC_LIBRARIES += libziparchive-host libz
Calin Juravle65e069d2015-06-08 10:35:24 +0100531 # For ashmem_create_region.
532 LOCAL_STATIC_LIBRARIES += libcutils
533 else
Alex Light4cd27d62015-08-18 23:03:42 +0000534 LOCAL_SHARED_LIBRARIES += libziparchive-host libz-host
Calin Juravle65e069d2015-06-08 10:35:24 +0100535 # For ashmem_create_region.
536 LOCAL_SHARED_LIBRARIES += libcutils
537 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700538 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700539 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
Ian Rogersc7dd2952014-10-21 23:31:19 -0700540 LOCAL_ADDITIONAL_DEPENDENCIES += $$(LOCAL_PATH)/Android.mk
Colin Crossdc781a12014-02-04 16:22:03 -0800541
542 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700543 LOCAL_MODULE_TARGET_ARCH := $$(ART_TARGET_SUPPORTED_ARCH)
Colin Crossdc781a12014-02-04 16:22:03 -0800544 endif
545
Dan Albert31fb2602014-09-30 22:10:10 -0700546 LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE)
547
Brian Carlstrom7940e442013-07-12 13:46:57 -0700548 ifeq ($$(art_target_or_host),target)
Christopher Ferrisd59b7b12014-04-01 12:29:09 -0700549 ifneq ($$(art_ndebug_or_debug),debug)
550 # Leave the symbols in the shared library so that stack unwinders can
551 # produce meaningful name resolution.
552 LOCAL_STRIP_MODULE := keep_symbols
553 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700554 include $$(BUILD_SHARED_LIBRARY)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700555 else # host
Calin Juravle65e069d2015-06-08 10:35:24 +0100556 ifeq ($$(art_static_or_shared),static)
557 include $$(BUILD_HOST_STATIC_LIBRARY)
558 else
559 include $$(BUILD_HOST_SHARED_LIBRARY)
560 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700561 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700562
563 # Clear locally defined variables.
564 GENERATED_SRC_DIR :=
565 ENUM_OPERATOR_OUT_CC_FILES :=
566 ENUM_OPERATOR_OUT_GEN :=
567 art_target_or_host :=
568 art_ndebug_or_debug :=
Calin Juravle65e069d2015-06-08 10:35:24 +0100569 art_static_or_shared :=
Brian Carlstrom7940e442013-07-12 13:46:57 -0700570endef
571
Ian Rogers719d1a32014-03-06 12:13:39 -0800572# We always build dex2oat and dependencies, even if the host build is otherwise disabled, since
573# they are used to cross compile for the target.
Junmo Park76ab3472014-08-11 21:28:16 +0900574ifeq ($(ART_BUILD_HOST_NDEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700575 $(eval $(call build-libart,host,ndebug))
Calin Juravle65e069d2015-06-08 10:35:24 +0100576 ifeq ($(ART_BUILD_HOST_STATIC),true)
577 $(eval $(call build-libart,host,ndebug,static))
578 endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700579endif
Junmo Park76ab3472014-08-11 21:28:16 +0900580ifeq ($(ART_BUILD_HOST_DEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700581 $(eval $(call build-libart,host,debug))
Calin Juravle65e069d2015-06-08 10:35:24 +0100582 ifeq ($(ART_BUILD_HOST_STATIC),true)
583 $(eval $(call build-libart,host,debug,static))
584 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700585endif
Ian Rogers719d1a32014-03-06 12:13:39 -0800586
587ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700588# $(error $(call build-libart,target,ndebug))
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700589 $(eval $(call build-libart,target,ndebug))
Ian Rogers719d1a32014-03-06 12:13:39 -0800590endif
591ifeq ($(ART_BUILD_TARGET_DEBUG),true)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700592 $(eval $(call build-libart,target,debug))
Ian Rogers719d1a32014-03-06 12:13:39 -0800593endif
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700594
Ian Rogersafd9acc2014-06-17 08:21:54 -0700595# Clear locally defined variables.
596LOCAL_PATH :=
597LIBART_COMMON_SRC_FILES :=
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700598LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES :=
599LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES :=
6002ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES :=
Tamas Berghammer0fd58122015-11-12 11:05:50 +0000601LIBART_HOST_LDFLAGS :=
Tamas Berghammer76e5eab2015-09-02 11:24:33 +0100602LIBART_TARGET_LDFLAGS :=
603LIBART_TARGET_LDFLAGS_arm :=
604LIBART_TARGET_LDFLAGS_arm64 :=
605LIBART_TARGET_LDFLAGS_x86 :=
606LIBART_TARGET_LDFLAGS_x86_64 :=
607LIBART_TARGET_LDFLAGS_mips :=
608LIBART_TARGET_LDFLAGS_mips64 :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700609LIBART_TARGET_SRC_FILES :=
610LIBART_TARGET_SRC_FILES_arm :=
611LIBART_TARGET_SRC_FILES_arm64 :=
612LIBART_TARGET_SRC_FILES_x86 :=
613LIBART_TARGET_SRC_FILES_x86_64 :=
614LIBART_TARGET_SRC_FILES_mips :=
Andreas Gampe1a5c4062015-01-15 12:10:47 -0800615LIBART_TARGET_SRC_FILES_mips64 :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700616LIBART_HOST_SRC_FILES :=
617LIBART_HOST_SRC_FILES_32 :=
618LIBART_HOST_SRC_FILES_64 :=
619LIBART_ENUM_OPERATOR_OUT_HEADER_FILES :=
620LIBART_CFLAGS :=
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900621LIBART_TARGET_CFLAGS :=
622LIBART_HOST_CFLAGS :=
Elliott Hughes7ac7e322014-06-27 17:20:59 -0700623build-libart :=