blob: 995a1d5c0d54ba58fe1cf8b9c74761af799c09fe [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 \
Ian Rogers22d5e732014-07-15 22:23:51 -070028 base/bit_vector.cc \
29 base/hex_dump.cc \
30 base/logging.cc \
31 base/mutex.cc \
Mathieu Chartierb666f482015-02-18 14:33:14 -080032 base/scoped_arena_allocator.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070033 base/scoped_flock.cc \
34 base/stringpiece.cc \
35 base/stringprintf.cc \
Vladimir Marko80afd022015-05-19 18:08:00 +010036 base/time_utils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070037 base/timing_logger.cc \
38 base/unix_file/fd_file.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070039 base/unix_file/random_access_file_utils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070040 check_jni.cc \
41 class_linker.cc \
Mathieu Chartiercc5ebdf2015-07-27 11:19:43 -070042 class_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070043 common_throws.cc \
44 debugger.cc \
45 dex_file.cc \
46 dex_file_verifier.cc \
47 dex_instruction.cc \
48 elf_file.cc \
Man Cao8c2ff642015-05-27 17:25:30 -070049 gc/allocation_record.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070050 gc/allocator/dlmalloc.cc \
51 gc/allocator/rosalloc.cc \
Mathieu Chartier4858a932015-01-23 13:18:53 -080052 gc/accounting/bitmap.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070053 gc/accounting/card_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070054 gc/accounting/heap_bitmap.cc \
55 gc/accounting/mod_union_table.cc \
56 gc/accounting/remembered_set.cc \
57 gc/accounting/space_bitmap.cc \
58 gc/collector/concurrent_copying.cc \
59 gc/collector/garbage_collector.cc \
60 gc/collector/immune_region.cc \
61 gc/collector/mark_compact.cc \
62 gc/collector/mark_sweep.cc \
63 gc/collector/partial_mark_sweep.cc \
64 gc/collector/semi_space.cc \
65 gc/collector/sticky_mark_sweep.cc \
66 gc/gc_cause.cc \
67 gc/heap.cc \
68 gc/reference_processor.cc \
69 gc/reference_queue.cc \
70 gc/space/bump_pointer_space.cc \
71 gc/space/dlmalloc_space.cc \
72 gc/space/image_space.cc \
73 gc/space/large_object_space.cc \
74 gc/space/malloc_space.cc \
Hiroshi Yamauchi2cd334a2015-01-09 14:03:35 -080075 gc/space/region_space.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070076 gc/space/rosalloc_space.cc \
77 gc/space/space.cc \
78 gc/space/zygote_space.cc \
Mathieu Chartiera5eae692014-12-17 17:56:03 -080079 gc/task_processor.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070080 hprof/hprof.cc \
81 image.cc \
82 indirect_reference_table.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070083 instrumentation.cc \
84 intern_table.cc \
85 interpreter/interpreter.cc \
86 interpreter/interpreter_common.cc \
Colin Crosse84e4f72015-03-18 14:01:19 -070087 interpreter/interpreter_goto_table_impl.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070088 interpreter/interpreter_switch_impl.cc \
Andreas Gampe2969bcd2015-03-09 12:57:41 -070089 interpreter/unstarted_runtime.cc \
Ian Rogers68d8b422014-07-17 11:09:10 -070090 java_vm_ext.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -070091 jdwp/jdwp_event.cc \
92 jdwp/jdwp_expand_buf.cc \
93 jdwp/jdwp_handler.cc \
94 jdwp/jdwp_main.cc \
95 jdwp/jdwp_request.cc \
96 jdwp/jdwp_socket.cc \
97 jdwp/object_registry.cc \
Ian Rogers68d8b422014-07-17 11:09:10 -070098 jni_env_ext.cc \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -080099 jit/jit.cc \
100 jit/jit_code_cache.cc \
101 jit/jit_instrumentation.cc \
Nicolas Geoffray5550ca82015-08-21 18:38:30 +0100102 jit/profiling_info.cc \
Igor Murashkinfc1ccd72015-07-30 15:11:09 -0700103 lambda/art_lambda_method.cc \
Igor Murashkine2facc52015-07-10 13:49:08 -0700104 lambda/box_table.cc \
Igor Murashkinfc1ccd72015-07-30 15:11:09 -0700105 lambda/closure.cc \
106 lambda/closure_builder.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700107 jni_internal.cc \
108 jobject_comparator.cc \
Mathieu Chartierc7853442015-03-27 14:35:38 -0700109 linear_alloc.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700110 mem_map.cc \
111 memory_region.cc \
Mathieu Chartierfc58af42015-04-16 18:00:39 -0700112 mirror/abstract_method.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700113 mirror/array.cc \
114 mirror/class.cc \
115 mirror/dex_cache.cc \
Mathieu Chartierdaaf3262015-03-24 13:30:28 -0700116 mirror/field.cc \
Mathieu Chartierfc58af42015-04-16 18:00:39 -0700117 mirror/method.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700118 mirror/object.cc \
119 mirror/reference.cc \
120 mirror/stack_trace_element.cc \
121 mirror/string.cc \
122 mirror/throwable.cc \
123 monitor.cc \
Calin Juravlec8423522014-08-12 20:55:20 +0100124 native_bridge_art_interface.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700125 native/dalvik_system_DexFile.cc \
126 native/dalvik_system_VMDebug.cc \
127 native/dalvik_system_VMRuntime.cc \
128 native/dalvik_system_VMStack.cc \
129 native/dalvik_system_ZygoteHooks.cc \
130 native/java_lang_Class.cc \
131 native/java_lang_DexCache.cc \
132 native/java_lang_Object.cc \
133 native/java_lang_Runtime.cc \
134 native/java_lang_String.cc \
Jeff Hao848f70a2014-01-15 13:49:50 -0800135 native/java_lang_StringFactory.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700136 native/java_lang_System.cc \
137 native/java_lang_Thread.cc \
138 native/java_lang_Throwable.cc \
139 native/java_lang_VMClassLoader.cc \
Mathieu Chartiera5a53ef2014-09-12 12:58:05 -0700140 native/java_lang_ref_FinalizerReference.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700141 native/java_lang_ref_Reference.cc \
142 native/java_lang_reflect_Array.cc \
143 native/java_lang_reflect_Constructor.cc \
144 native/java_lang_reflect_Field.cc \
145 native/java_lang_reflect_Method.cc \
146 native/java_lang_reflect_Proxy.cc \
147 native/java_util_concurrent_atomic_AtomicLong.cc \
Jeff Hao848f70a2014-01-15 13:49:50 -0800148 native/libcore_util_CharsetUtils.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700149 native/org_apache_harmony_dalvik_ddmc_DdmServer.cc \
150 native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \
151 native/sun_misc_Unsafe.cc \
152 oat.cc \
153 oat_file.cc \
Richard Uhler66d874d2015-01-15 09:37:19 -0800154 oat_file_assistant.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700155 object_lock.cc \
156 offsets.cc \
157 os_linux.cc \
158 parsed_options.cc \
159 primitive.cc \
160 quick_exception_handler.cc \
161 quick/inline_method_analyser.cc \
162 reference_table.cc \
163 reflection.cc \
164 runtime.cc \
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800165 runtime_options.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700166 signal_catcher.cc \
167 stack.cc \
Nicolas Geoffray004c2302015-03-20 10:06:38 +0000168 stack_map.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700169 thread.cc \
170 thread_list.cc \
171 thread_pool.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700172 trace.cc \
173 transaction.cc \
174 profiler.cc \
175 fault_handler.cc \
176 utf.cc \
177 utils.cc \
178 verifier/dex_gc_map.cc \
179 verifier/instruction_flags.cc \
180 verifier/method_verifier.cc \
181 verifier/reg_type.cc \
182 verifier/reg_type_cache.cc \
183 verifier/register_line.cc \
184 well_known_classes.cc \
185 zip_archive.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700186
187LIBART_COMMON_SRC_FILES += \
Ian Rogers22d5e732014-07-15 22:23:51 -0700188 arch/context.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800189 arch/instruction_set.cc \
190 arch/instruction_set_features.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700191 arch/memcmp16.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800192 arch/arm/instruction_set_features_arm.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700193 arch/arm/registers_arm.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800194 arch/arm64/instruction_set_features_arm64.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700195 arch/arm64/registers_arm64.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800196 arch/mips/instruction_set_features_mips.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700197 arch/mips/registers_mips.cc \
Andreas Gampe57b34292015-01-14 15:45:59 -0800198 arch/mips64/instruction_set_features_mips64.cc \
199 arch/mips64/registers_mips64.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800200 arch/x86/instruction_set_features_x86.cc \
201 arch/x86/registers_x86.cc \
202 arch/x86_64/registers_x86_64.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700203 entrypoints/entrypoint_utils.cc \
204 entrypoints/interpreter/interpreter_entrypoints.cc \
205 entrypoints/jni/jni_entrypoints.cc \
206 entrypoints/math_entrypoints.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700207 entrypoints/quick/quick_alloc_entrypoints.cc \
208 entrypoints/quick/quick_cast_entrypoints.cc \
209 entrypoints/quick/quick_deoptimization_entrypoints.cc \
210 entrypoints/quick/quick_dexcache_entrypoints.cc \
211 entrypoints/quick/quick_field_entrypoints.cc \
212 entrypoints/quick/quick_fillarray_entrypoints.cc \
213 entrypoints/quick/quick_instrumentation_entrypoints.cc \
214 entrypoints/quick/quick_jni_entrypoints.cc \
215 entrypoints/quick/quick_lock_entrypoints.cc \
216 entrypoints/quick/quick_math_entrypoints.cc \
217 entrypoints/quick/quick_thread_entrypoints.cc \
218 entrypoints/quick/quick_throw_entrypoints.cc \
219 entrypoints/quick/quick_trampoline_entrypoints.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700220
Elliott Hughes7ac7e322014-06-27 17:20:59 -0700221LIBART_TARGET_LDFLAGS :=
Ian Rogersc5f17732014-06-05 20:48:42 -0700222LIBART_HOST_LDFLAGS :=
Colin Crossdc781a12014-02-04 16:22:03 -0800223
Brian Carlstrom7940e442013-07-12 13:46:57 -0700224LIBART_TARGET_SRC_FILES := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700225 $(LIBART_COMMON_SRC_FILES) \
Ian Rogers22d5e732014-07-15 22:23:51 -0700226 jdwp/jdwp_adb.cc \
227 monitor_android.cc \
228 runtime_android.cc \
229 thread_android.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700230
Colin Crossdc781a12014-02-04 16:22:03 -0800231LIBART_TARGET_SRC_FILES_arm := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700232 arch/arm/context_arm.cc.arm \
233 arch/arm/entrypoints_init_arm.cc \
Ian Rogersd582fa42014-11-05 23:46:43 -0800234 arch/arm/instruction_set_features_assembly_tests.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700235 arch/arm/jni_entrypoints_arm.S \
236 arch/arm/memcmp16_arm.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700237 arch/arm/quick_entrypoints_arm.S \
Zheng Xu5667fdb2014-10-23 18:29:55 +0800238 arch/arm/quick_entrypoints_cc_arm.cc \
Ian Rogers22d5e732014-07-15 22:23:51 -0700239 arch/arm/thread_arm.cc \
240 arch/arm/fault_handler_arm.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800241
Stuart Monteithb95a5342014-03-12 13:32:32 +0000242LIBART_TARGET_SRC_FILES_arm64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700243 arch/arm64/context_arm64.cc \
244 arch/arm64/entrypoints_init_arm64.cc \
245 arch/arm64/jni_entrypoints_arm64.S \
246 arch/arm64/memcmp16_arm64.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700247 arch/arm64/quick_entrypoints_arm64.S \
248 arch/arm64/thread_arm64.cc \
249 monitor_pool.cc \
250 arch/arm64/fault_handler_arm64.cc
Stuart Monteithb95a5342014-03-12 13:32:32 +0000251
Ying Wangc6585b72014-04-23 18:19:44 -0700252LIBART_SRC_FILES_x86 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700253 arch/x86/context_x86.cc \
254 arch/x86/entrypoints_init_x86.cc \
255 arch/x86/jni_entrypoints_x86.S \
Alexander Ivchenko907194a2014-07-14 18:54:34 +0400256 arch/x86/memcmp16_x86.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700257 arch/x86/quick_entrypoints_x86.S \
258 arch/x86/thread_x86.cc \
259 arch/x86/fault_handler_x86.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800260
Ying Wangc6585b72014-04-23 18:19:44 -0700261LIBART_TARGET_SRC_FILES_x86 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700262 $(LIBART_SRC_FILES_x86)
Ying Wangc6585b72014-04-23 18:19:44 -0700263
Dave Allisondfd3b472014-07-16 16:04:32 -0700264# Note that the fault_handler_x86.cc is not a mistake. This file is
265# shared between the x86 and x86_64 architectures.
Ying Wangc6585b72014-04-23 18:19:44 -0700266LIBART_SRC_FILES_x86_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700267 arch/x86_64/context_x86_64.cc \
268 arch/x86_64/entrypoints_init_x86_64.cc \
269 arch/x86_64/jni_entrypoints_x86_64.S \
Varvara Rainchik2a0bffd2014-07-30 17:01:24 +0400270 arch/x86_64/memcmp16_x86_64.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700271 arch/x86_64/quick_entrypoints_x86_64.S \
272 arch/x86_64/thread_x86_64.cc \
273 monitor_pool.cc \
Dave Allisondfd3b472014-07-16 16:04:32 -0700274 arch/x86/fault_handler_x86.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800275
Ying Wangc6585b72014-04-23 18:19:44 -0700276LIBART_TARGET_SRC_FILES_x86_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700277 $(LIBART_SRC_FILES_x86_64) \
Colin Crossdc781a12014-02-04 16:22:03 -0800278
279LIBART_TARGET_SRC_FILES_mips := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700280 arch/mips/context_mips.cc \
281 arch/mips/entrypoints_init_mips.cc \
282 arch/mips/jni_entrypoints_mips.S \
283 arch/mips/memcmp16_mips.S \
Ian Rogers22d5e732014-07-15 22:23:51 -0700284 arch/mips/quick_entrypoints_mips.S \
285 arch/mips/thread_mips.cc \
286 arch/mips/fault_handler_mips.cc
Colin Crossdc781a12014-02-04 16:22:03 -0800287
Andreas Gampe1a5c4062015-01-15 12:10:47 -0800288LIBART_TARGET_SRC_FILES_mips64 := \
289 arch/mips64/context_mips64.cc \
290 arch/mips64/entrypoints_init_mips64.cc \
291 arch/mips64/jni_entrypoints_mips64.S \
292 arch/mips64/memcmp16_mips64.S \
293 arch/mips64/quick_entrypoints_mips64.S \
294 arch/mips64/thread_mips64.cc \
295 monitor_pool.cc \
296 arch/mips64/fault_handler_mips64.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700297
Brian Carlstrom7940e442013-07-12 13:46:57 -0700298LIBART_HOST_SRC_FILES := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700299 $(LIBART_COMMON_SRC_FILES) \
Ian Rogers22d5e732014-07-15 22:23:51 -0700300 monitor_linux.cc \
301 runtime_linux.cc \
302 thread_linux.cc
Brian Carlstrom7940e442013-07-12 13:46:57 -0700303
Ying Wangc6585b72014-04-23 18:19:44 -0700304LIBART_HOST_SRC_FILES_32 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700305 $(LIBART_SRC_FILES_x86)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700306
Ying Wangc6585b72014-04-23 18:19:44 -0700307LIBART_HOST_SRC_FILES_64 := \
Ian Rogers22d5e732014-07-15 22:23:51 -0700308 $(LIBART_SRC_FILES_x86_64)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700309
310LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \
Ian Rogersd582fa42014-11-05 23:46:43 -0800311 arch/instruction_set.h \
Mathieu Chartierbad02672014-08-25 13:08:22 -0700312 base/allocator.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700313 base/mutex.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700314 debugger.h \
Andreas Gampe4303ba92014-11-06 01:00:46 -0800315 base/unix_file/fd_file.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700316 dex_file.h \
317 dex_instruction.h \
Mathieu Chartiere5f13e52015-02-24 09:37:21 -0800318 dex_instruction_utils.h \
Mathieu Chartiere34fa1d2015-01-14 14:55:47 -0800319 gc_root.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700320 gc/allocator_type.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700321 gc/allocator/rosalloc.h \
Mathieu Chartierb363f662014-07-16 13:28:58 -0700322 gc/collector_type.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700323 gc/collector/gc_type.h \
324 gc/heap.h \
Hiroshi Yamauchid25f8422015-01-30 16:25:12 -0800325 gc/space/region_space.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700326 gc/space/space.h \
Mathieu Chartier14c3bf92015-07-13 14:35:43 -0700327 gc/weak_root_state.h \
Mathieu Chartiere401d142015-04-22 13:56:20 -0700328 image.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700329 instrumentation.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700330 indirect_reference_table.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700331 invoke_type.h \
332 jdwp/jdwp.h \
333 jdwp/jdwp_constants.h \
334 lock_word.h \
335 mirror/class.h \
336 oat.h \
337 object_callbacks.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700338 profiler_options.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700339 quick/inline_method_analyser.h \
Ian Rogers6a3c1fc2014-10-31 00:33:20 -0700340 runtime.h \
341 stack.h \
Ian Rogers22d5e732014-07-15 22:23:51 -0700342 thread.h \
343 thread_state.h \
344 verifier/method_verifier.h
Brian Carlstrom7940e442013-07-12 13:46:57 -0700345
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700346LIBART_CFLAGS := -DBUILDING_LIBART=1
Brian Carlstrom7940e442013-07-12 13:46:57 -0700347
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900348LIBART_TARGET_CFLAGS :=
349LIBART_HOST_CFLAGS :=
350
Christopher Ferrisfc35de02014-07-10 18:53:22 -0700351ifeq ($(MALLOC_IMPL),dlmalloc)
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900352 LIBART_TARGET_CFLAGS += -DUSE_DLMALLOC
Christopher Ferrisfc35de02014-07-10 18:53:22 -0700353else
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900354 LIBART_TARGET_CFLAGS += -DUSE_JEMALLOC
Christopher Ferrisc4ddc042014-05-13 14:47:50 -0700355endif
356
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700357# Default dex2oat instruction set features.
358LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES := default
359LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := default
3602ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := default
361ifeq ($(DEX2OAT_TARGET_ARCH),arm)
362 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a15 krait denver))
Andreas Gampe72a122c2014-11-13 19:10:33 -0800363 LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := atomic_ldrd_strd,div
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700364 else
365 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a7))
366 LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := div
367 endif
368 endif
369endif
370ifeq ($(2ND_DEX2OAT_TARGET_ARCH),arm)
371 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a15 krait denver))
Andreas Gampe72a122c2014-11-13 19:10:33 -0800372 2ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := atomic_ldrd_strd,div
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700373 else
374 ifneq (,$(filter $(DEX2OAT_TARGET_CPU_VARIANT),cortex-a7))
375 2ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES := div
376 endif
377 endif
378endif
379
Brian Carlstrom7940e442013-07-12 13:46:57 -0700380# $(1): target or host
381# $(2): ndebug or debug
Calin Juravle65e069d2015-06-08 10:35:24 +0100382# $(3): static or shared (empty means shared, applies only for host)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700383define build-libart
384 ifneq ($(1),target)
385 ifneq ($(1),host)
386 $$(error expected target or host for argument 1, received $(1))
387 endif
388 endif
389 ifneq ($(2),ndebug)
390 ifneq ($(2),debug)
391 $$(error expected ndebug or debug for argument 2, received $(2))
392 endif
393 endif
394
395 art_target_or_host := $(1)
396 art_ndebug_or_debug := $(2)
Calin Juravle65e069d2015-06-08 10:35:24 +0100397 art_static_or_shared := $(3)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700398
Ian Rogersafd9acc2014-06-17 08:21:54 -0700399 include $$(CLEAR_VARS)
400 LOCAL_CPP_EXTENSION := $$(ART_CPP_EXTENSION)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700401 ifeq ($$(art_ndebug_or_debug),ndebug)
402 LOCAL_MODULE := libart
Dehao Chen6c36a8b2014-11-13 14:13:58 -0800403 ifeq ($$(art_target_or_host),target)
404 LOCAL_FDO_SUPPORT := true
405 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700406 else # debug
407 LOCAL_MODULE := libartd
408 endif
409
410 LOCAL_MODULE_TAGS := optional
Calin Juravle65e069d2015-06-08 10:35:24 +0100411
412 ifeq ($$(art_static_or_shared),static)
413 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
414 else
415 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
416 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700417
418 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700419 LOCAL_SRC_FILES := $$(LIBART_TARGET_SRC_FILES)
420 $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \
421 $$(eval LOCAL_SRC_FILES_$$(arch) := $$$$(LIBART_TARGET_SRC_FILES_$$(arch))))
Brian Carlstrom7940e442013-07-12 13:46:57 -0700422 else # host
Ian Rogersafd9acc2014-06-17 08:21:54 -0700423 LOCAL_SRC_FILES := $$(LIBART_HOST_SRC_FILES)
424 LOCAL_SRC_FILES_32 := $$(LIBART_HOST_SRC_FILES_32)
425 LOCAL_SRC_FILES_64 := $$(LIBART_HOST_SRC_FILES_64)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700426 LOCAL_IS_HOST_MODULE := true
427 endif
428
Colin Crossdc781a12014-02-04 16:22:03 -0800429 GENERATED_SRC_DIR := $$(call local-generated-sources-dir)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700430 ENUM_OPERATOR_OUT_CC_FILES := $$(patsubst %.h,%_operator_out.cc,$$(LIBART_ENUM_OPERATOR_OUT_HEADER_FILES))
431 ENUM_OPERATOR_OUT_GEN := $$(addprefix $$(GENERATED_SRC_DIR)/,$$(ENUM_OPERATOR_OUT_CC_FILES))
432
433$$(ENUM_OPERATOR_OUT_GEN): art/tools/generate-operator-out.py
434$$(ENUM_OPERATOR_OUT_GEN): PRIVATE_CUSTOM_TOOL = art/tools/generate-operator-out.py $(LOCAL_PATH) $$< > $$@
435$$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PATH)/%.h
436 $$(transform-generated-source)
437
438 LOCAL_GENERATED_SOURCES += $$(ENUM_OPERATOR_OUT_GEN)
439
Ian Rogersafd9acc2014-06-17 08:21:54 -0700440 LOCAL_CFLAGS := $$(LIBART_CFLAGS)
Dan Albert58bea4a2014-08-09 18:08:07 -0700441 LOCAL_LDFLAGS := $$(LIBART_LDFLAGS)
Ian Rogersc5f17732014-06-05 20:48:42 -0700442 ifeq ($$(art_target_or_host),target)
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900443 LOCAL_CFLAGS += $$(LIBART_TARGET_CFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700444 LOCAL_LDFLAGS += $$(LIBART_TARGET_LDFLAGS)
Calin Juravle65e069d2015-06-08 10:35:24 +0100445 else #host
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900446 LOCAL_CFLAGS += $$(LIBART_HOST_CFLAGS)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700447 LOCAL_LDFLAGS += $$(LIBART_HOST_LDFLAGS)
Calin Juravle65e069d2015-06-08 10:35:24 +0100448 ifeq ($$(art_static_or_shared),static)
449 LOCAL_LDFLAGS += -static
450 endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700451 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700452 $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \
453 $$(eval LOCAL_LDFLAGS_$$(arch) := $$(LIBART_TARGET_LDFLAGS_$$(arch))))
Colin Crossdc781a12014-02-04 16:22:03 -0800454
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700455 # Clang usage
Brian Carlstrom7940e442013-07-12 13:46:57 -0700456 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700457 $$(eval $$(call set-target-local-clang-vars))
458 $$(eval $$(call set-target-local-cflags-vars,$(2)))
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700459 LOCAL_CFLAGS_$(DEX2OAT_TARGET_ARCH) += -DART_DEFAULT_INSTRUCTION_SET_FEATURES="$(LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES)"
460 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 -0700461 else # host
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700462 LOCAL_CLANG := $$(ART_HOST_CLANG)
463 LOCAL_LDLIBS := $$(ART_HOST_LDLIBS)
464 LOCAL_LDLIBS += -ldl -lpthread
465 ifeq ($$(HOST_OS),linux)
466 LOCAL_LDLIBS += -lrt
467 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700468 LOCAL_CFLAGS += $$(ART_HOST_CFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700469 LOCAL_CFLAGS += -DART_DEFAULT_INSTRUCTION_SET_FEATURES="$(LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES)"
Roland Levillain12bd7212015-06-04 17:50:27 +0100470 LOCAL_ASFLAGS += $$(ART_HOST_ASFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700471
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700472 ifeq ($$(art_ndebug_or_debug),debug)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700473 LOCAL_CFLAGS += $$(ART_HOST_DEBUG_CFLAGS)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700474 else
Ian Rogersafd9acc2014-06-17 08:21:54 -0700475 LOCAL_CFLAGS += $$(ART_HOST_NON_DEBUG_CFLAGS)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700476 endif
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700477 LOCAL_MULTILIB := both
Brian Carlstrom7940e442013-07-12 13:46:57 -0700478 endif
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700479
Ian Rogersafd9acc2014-06-17 08:21:54 -0700480 LOCAL_C_INCLUDES += $$(ART_C_INCLUDES)
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800481 LOCAL_C_INCLUDES += art/cmdline
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700482 LOCAL_C_INCLUDES += art/sigchainlib
Igor Murashkinaaebaa02015-01-26 10:55:53 -0800483 LOCAL_C_INCLUDES += art
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700484
Calin Juravle65e069d2015-06-08 10:35:24 +0100485 ifeq ($$(art_static_or_shared),static)
486 LOCAL_STATIC_LIBRARIES := libnativehelper libnativebridge libsigchain_dummy libbacktrace
487 else
488 LOCAL_SHARED_LIBRARIES := libnativehelper libnativebridge libsigchain libbacktrace
489 endif
490
Brian Carlstrom7940e442013-07-12 13:46:57 -0700491 ifeq ($$(art_target_or_host),target)
Ian Rogers872dd822014-10-30 11:19:14 -0700492 LOCAL_SHARED_LIBRARIES += libdl
493 # ZipArchive support, the order matters here to get all symbols.
Narayan Kamath657318c2015-04-28 09:56:28 +0100494 LOCAL_STATIC_LIBRARIES := libziparchive libz libbase
Ian Rogers872dd822014-10-30 11:19:14 -0700495 # For android::FileMap used by libziparchive.
496 LOCAL_SHARED_LIBRARIES += libutils
497 # For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted.
498 LOCAL_SHARED_LIBRARIES += libcutils
Brian Carlstrom7940e442013-07-12 13:46:57 -0700499 else # host
Calin Juravle65e069d2015-06-08 10:35:24 +0100500 ifeq ($$(art_static_or_shared),static)
Alex Light4cd27d62015-08-18 23:03:42 +0000501 LOCAL_STATIC_LIBRARIES += libziparchive-host libz
Calin Juravle65e069d2015-06-08 10:35:24 +0100502 # For ashmem_create_region.
503 LOCAL_STATIC_LIBRARIES += libcutils
504 else
Alex Light4cd27d62015-08-18 23:03:42 +0000505 LOCAL_SHARED_LIBRARIES += libziparchive-host libz-host
Calin Juravle65e069d2015-06-08 10:35:24 +0100506 # For ashmem_create_region.
507 LOCAL_SHARED_LIBRARIES += libcutils
508 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700509 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700510 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
Ian Rogersc7dd2952014-10-21 23:31:19 -0700511 LOCAL_ADDITIONAL_DEPENDENCIES += $$(LOCAL_PATH)/Android.mk
Colin Crossdc781a12014-02-04 16:22:03 -0800512
513 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700514 LOCAL_MODULE_TARGET_ARCH := $$(ART_TARGET_SUPPORTED_ARCH)
Colin Crossdc781a12014-02-04 16:22:03 -0800515 endif
516
Dan Albert31fb2602014-09-30 22:10:10 -0700517 LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE)
518
Brian Carlstrom7940e442013-07-12 13:46:57 -0700519 ifeq ($$(art_target_or_host),target)
Christopher Ferrisd59b7b12014-04-01 12:29:09 -0700520 ifneq ($$(art_ndebug_or_debug),debug)
521 # Leave the symbols in the shared library so that stack unwinders can
522 # produce meaningful name resolution.
523 LOCAL_STRIP_MODULE := keep_symbols
524 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700525 include $$(BUILD_SHARED_LIBRARY)
Brian Carlstrom7940e442013-07-12 13:46:57 -0700526 else # host
Calin Juravle65e069d2015-06-08 10:35:24 +0100527 ifeq ($$(art_static_or_shared),static)
528 include $$(BUILD_HOST_STATIC_LIBRARY)
529 else
530 include $$(BUILD_HOST_SHARED_LIBRARY)
531 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700532 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700533
534 # Clear locally defined variables.
535 GENERATED_SRC_DIR :=
536 ENUM_OPERATOR_OUT_CC_FILES :=
537 ENUM_OPERATOR_OUT_GEN :=
538 art_target_or_host :=
539 art_ndebug_or_debug :=
Calin Juravle65e069d2015-06-08 10:35:24 +0100540 art_static_or_shared :=
Brian Carlstrom7940e442013-07-12 13:46:57 -0700541endef
542
Ian Rogers719d1a32014-03-06 12:13:39 -0800543# We always build dex2oat and dependencies, even if the host build is otherwise disabled, since
544# they are used to cross compile for the target.
Junmo Park76ab3472014-08-11 21:28:16 +0900545ifeq ($(ART_BUILD_HOST_NDEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700546 $(eval $(call build-libart,host,ndebug))
Calin Juravle65e069d2015-06-08 10:35:24 +0100547 ifeq ($(ART_BUILD_HOST_STATIC),true)
548 $(eval $(call build-libart,host,ndebug,static))
549 endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700550endif
Junmo Park76ab3472014-08-11 21:28:16 +0900551ifeq ($(ART_BUILD_HOST_DEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700552 $(eval $(call build-libart,host,debug))
Calin Juravle65e069d2015-06-08 10:35:24 +0100553 ifeq ($(ART_BUILD_HOST_STATIC),true)
554 $(eval $(call build-libart,host,debug,static))
555 endif
Brian Carlstrom7940e442013-07-12 13:46:57 -0700556endif
Ian Rogers719d1a32014-03-06 12:13:39 -0800557
558ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
Ian Rogersafd9acc2014-06-17 08:21:54 -0700559# $(error $(call build-libart,target,ndebug))
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700560 $(eval $(call build-libart,target,ndebug))
Ian Rogers719d1a32014-03-06 12:13:39 -0800561endif
562ifeq ($(ART_BUILD_TARGET_DEBUG),true)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -0700563 $(eval $(call build-libart,target,debug))
Ian Rogers719d1a32014-03-06 12:13:39 -0800564endif
Dave Allisonf4b80bc2014-05-14 15:41:25 -0700565
Ian Rogersafd9acc2014-06-17 08:21:54 -0700566# Clear locally defined variables.
567LOCAL_PATH :=
568LIBART_COMMON_SRC_FILES :=
Ian Rogers6f3dbba2014-10-14 17:41:57 -0700569LIBART_HOST_DEFAULT_INSTRUCTION_SET_FEATURES :=
570LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES :=
5712ND_LIBART_TARGET_DEFAULT_INSTRUCTION_SET_FEATURES :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700572LIBART_TARGET_LDFLAGS :=
573LIBART_HOST_LDFLAGS :=
574LIBART_TARGET_SRC_FILES :=
575LIBART_TARGET_SRC_FILES_arm :=
576LIBART_TARGET_SRC_FILES_arm64 :=
577LIBART_TARGET_SRC_FILES_x86 :=
578LIBART_TARGET_SRC_FILES_x86_64 :=
579LIBART_TARGET_SRC_FILES_mips :=
Andreas Gampe1a5c4062015-01-15 12:10:47 -0800580LIBART_TARGET_SRC_FILES_mips64 :=
Ian Rogersafd9acc2014-06-17 08:21:54 -0700581LIBART_HOST_SRC_FILES :=
582LIBART_HOST_SRC_FILES_32 :=
583LIBART_HOST_SRC_FILES_64 :=
584LIBART_ENUM_OPERATOR_OUT_HEADER_FILES :=
585LIBART_CFLAGS :=
Shinichiro Hamaji028aec22015-07-29 16:30:29 +0900586LIBART_TARGET_CFLAGS :=
587LIBART_HOST_CFLAGS :=
Elliott Hughes7ac7e322014-06-27 17:20:59 -0700588build-libart :=