| Colin Cross | 316417e | 2016-08-25 01:03:42 +0000 | [diff] [blame^] | 1 | # |
| 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | include art/build/Android.common_build.mk |
| 20 | |
| 21 | LIBART_COMMON_SRC_FILES := \ |
| 22 | art_field.cc \ |
| 23 | art_method.cc \ |
| 24 | atomic.cc.arm \ |
| 25 | barrier.cc \ |
| 26 | base/allocator.cc \ |
| 27 | base/arena_allocator.cc \ |
| 28 | base/arena_bit_vector.cc \ |
| 29 | base/bit_vector.cc \ |
| 30 | base/file_magic.cc \ |
| 31 | base/hex_dump.cc \ |
| 32 | base/logging.cc \ |
| 33 | base/mutex.cc \ |
| 34 | base/scoped_arena_allocator.cc \ |
| 35 | base/scoped_flock.cc \ |
| 36 | base/stringpiece.cc \ |
| 37 | base/stringprintf.cc \ |
| 38 | base/time_utils.cc \ |
| 39 | base/timing_logger.cc \ |
| 40 | base/unix_file/fd_file.cc \ |
| 41 | base/unix_file/random_access_file_utils.cc \ |
| 42 | check_jni.cc \ |
| 43 | class_linker.cc \ |
| 44 | class_table.cc \ |
| 45 | code_simulator_container.cc \ |
| 46 | common_throws.cc \ |
| 47 | compiler_filter.cc \ |
| 48 | debugger.cc \ |
| 49 | dex_file.cc \ |
| 50 | dex_file_verifier.cc \ |
| 51 | dex_instruction.cc \ |
| 52 | elf_file.cc \ |
| 53 | fault_handler.cc \ |
| 54 | gc/allocation_record.cc \ |
| 55 | gc/allocator/dlmalloc.cc \ |
| 56 | gc/allocator/rosalloc.cc \ |
| 57 | gc/accounting/bitmap.cc \ |
| 58 | gc/accounting/card_table.cc \ |
| 59 | gc/accounting/heap_bitmap.cc \ |
| 60 | gc/accounting/mod_union_table.cc \ |
| 61 | gc/accounting/remembered_set.cc \ |
| 62 | gc/accounting/space_bitmap.cc \ |
| 63 | gc/collector/concurrent_copying.cc \ |
| 64 | gc/collector/garbage_collector.cc \ |
| 65 | gc/collector/immune_region.cc \ |
| 66 | gc/collector/immune_spaces.cc \ |
| 67 | gc/collector/mark_compact.cc \ |
| 68 | gc/collector/mark_sweep.cc \ |
| 69 | gc/collector/partial_mark_sweep.cc \ |
| 70 | gc/collector/semi_space.cc \ |
| 71 | gc/collector/sticky_mark_sweep.cc \ |
| 72 | gc/gc_cause.cc \ |
| 73 | gc/heap.cc \ |
| 74 | gc/reference_processor.cc \ |
| 75 | gc/reference_queue.cc \ |
| 76 | gc/scoped_gc_critical_section.cc \ |
| 77 | gc/space/bump_pointer_space.cc \ |
| 78 | gc/space/dlmalloc_space.cc \ |
| 79 | gc/space/image_space.cc \ |
| 80 | gc/space/large_object_space.cc \ |
| 81 | gc/space/malloc_space.cc \ |
| 82 | gc/space/region_space.cc \ |
| 83 | gc/space/rosalloc_space.cc \ |
| 84 | gc/space/space.cc \ |
| 85 | gc/space/zygote_space.cc \ |
| 86 | gc/task_processor.cc \ |
| 87 | hprof/hprof.cc \ |
| 88 | image.cc \ |
| 89 | indirect_reference_table.cc \ |
| 90 | instrumentation.cc \ |
| 91 | intern_table.cc \ |
| 92 | interpreter/interpreter.cc \ |
| 93 | interpreter/interpreter_common.cc \ |
| 94 | interpreter/interpreter_goto_table_impl.cc \ |
| 95 | interpreter/interpreter_switch_impl.cc \ |
| 96 | interpreter/unstarted_runtime.cc \ |
| 97 | java_vm_ext.cc \ |
| 98 | jdwp/jdwp_event.cc \ |
| 99 | jdwp/jdwp_expand_buf.cc \ |
| 100 | jdwp/jdwp_handler.cc \ |
| 101 | jdwp/jdwp_main.cc \ |
| 102 | jdwp/jdwp_request.cc \ |
| 103 | jdwp/jdwp_socket.cc \ |
| 104 | jdwp/object_registry.cc \ |
| 105 | jni_env_ext.cc \ |
| 106 | jit/debugger_interface.cc \ |
| 107 | jit/jit.cc \ |
| 108 | jit/jit_code_cache.cc \ |
| 109 | jit/offline_profiling_info.cc \ |
| 110 | jit/profiling_info.cc \ |
| 111 | jit/profile_saver.cc \ |
| 112 | jni_internal.cc \ |
| 113 | jobject_comparator.cc \ |
| 114 | linear_alloc.cc \ |
| 115 | mem_map.cc \ |
| 116 | memory_region.cc \ |
| 117 | mirror/abstract_method.cc \ |
| 118 | mirror/array.cc \ |
| 119 | mirror/class.cc \ |
| 120 | mirror/dex_cache.cc \ |
| 121 | mirror/field.cc \ |
| 122 | mirror/method.cc \ |
| 123 | mirror/object.cc \ |
| 124 | mirror/reference.cc \ |
| 125 | mirror/stack_trace_element.cc \ |
| 126 | mirror/string.cc \ |
| 127 | mirror/throwable.cc \ |
| 128 | monitor.cc \ |
| 129 | native_bridge_art_interface.cc \ |
| 130 | native_stack_dump.cc \ |
| 131 | native/dalvik_system_DexFile.cc \ |
| 132 | native/dalvik_system_VMDebug.cc \ |
| 133 | native/dalvik_system_VMRuntime.cc \ |
| 134 | native/dalvik_system_VMStack.cc \ |
| 135 | native/dalvik_system_ZygoteHooks.cc \ |
| 136 | native/java_lang_Class.cc \ |
| 137 | native/java_lang_DexCache.cc \ |
| 138 | native/java_lang_Object.cc \ |
| 139 | native/java_lang_String.cc \ |
| 140 | native/java_lang_StringFactory.cc \ |
| 141 | native/java_lang_System.cc \ |
| 142 | native/java_lang_Thread.cc \ |
| 143 | native/java_lang_Throwable.cc \ |
| 144 | native/java_lang_VMClassLoader.cc \ |
| 145 | native/java_lang_ref_FinalizerReference.cc \ |
| 146 | native/java_lang_ref_Reference.cc \ |
| 147 | native/java_lang_reflect_AbstractMethod.cc \ |
| 148 | native/java_lang_reflect_Array.cc \ |
| 149 | native/java_lang_reflect_Constructor.cc \ |
| 150 | native/java_lang_reflect_Field.cc \ |
| 151 | native/java_lang_reflect_Method.cc \ |
| 152 | native/java_lang_reflect_Proxy.cc \ |
| 153 | native/java_util_concurrent_atomic_AtomicLong.cc \ |
| 154 | native/libcore_util_CharsetUtils.cc \ |
| 155 | native/org_apache_harmony_dalvik_ddmc_DdmServer.cc \ |
| 156 | native/org_apache_harmony_dalvik_ddmc_DdmVmInternal.cc \ |
| 157 | native/sun_misc_Unsafe.cc \ |
| 158 | oat.cc \ |
| 159 | oat_file.cc \ |
| 160 | oat_file_assistant.cc \ |
| 161 | oat_file_manager.cc \ |
| 162 | oat_quick_method_header.cc \ |
| 163 | object_lock.cc \ |
| 164 | offsets.cc \ |
| 165 | os_linux.cc \ |
| 166 | parsed_options.cc \ |
| 167 | plugin.cc \ |
| 168 | primitive.cc \ |
| 169 | quick_exception_handler.cc \ |
| 170 | quick/inline_method_analyser.cc \ |
| 171 | reference_table.cc \ |
| 172 | reflection.cc \ |
| 173 | runtime.cc \ |
| 174 | runtime_options.cc \ |
| 175 | signal_catcher.cc \ |
| 176 | stack.cc \ |
| 177 | stack_map.cc \ |
| 178 | thread.cc \ |
| 179 | thread_list.cc \ |
| 180 | thread_pool.cc \ |
| 181 | ti/agent.cc \ |
| 182 | trace.cc \ |
| 183 | transaction.cc \ |
| 184 | type_lookup_table.cc \ |
| 185 | utf.cc \ |
| 186 | utils.cc \ |
| 187 | verifier/instruction_flags.cc \ |
| 188 | verifier/method_verifier.cc \ |
| 189 | verifier/reg_type.cc \ |
| 190 | verifier/reg_type_cache.cc \ |
| 191 | verifier/register_line.cc \ |
| 192 | well_known_classes.cc \ |
| 193 | zip_archive.cc |
| 194 | |
| 195 | LIBART_COMMON_SRC_FILES += \ |
| 196 | arch/context.cc \ |
| 197 | arch/instruction_set.cc \ |
| 198 | arch/instruction_set_features.cc \ |
| 199 | arch/memcmp16.cc \ |
| 200 | arch/arm/instruction_set_features_arm.cc \ |
| 201 | arch/arm/registers_arm.cc \ |
| 202 | arch/arm64/instruction_set_features_arm64.cc \ |
| 203 | arch/arm64/registers_arm64.cc \ |
| 204 | arch/mips/instruction_set_features_mips.cc \ |
| 205 | arch/mips/registers_mips.cc \ |
| 206 | arch/mips64/instruction_set_features_mips64.cc \ |
| 207 | arch/mips64/registers_mips64.cc \ |
| 208 | arch/x86/instruction_set_features_x86.cc \ |
| 209 | arch/x86/registers_x86.cc \ |
| 210 | arch/x86_64/registers_x86_64.cc \ |
| 211 | entrypoints/entrypoint_utils.cc \ |
| 212 | entrypoints/jni/jni_entrypoints.cc \ |
| 213 | entrypoints/math_entrypoints.cc \ |
| 214 | entrypoints/quick/quick_alloc_entrypoints.cc \ |
| 215 | entrypoints/quick/quick_cast_entrypoints.cc \ |
| 216 | entrypoints/quick/quick_deoptimization_entrypoints.cc \ |
| 217 | entrypoints/quick/quick_dexcache_entrypoints.cc \ |
| 218 | entrypoints/quick/quick_field_entrypoints.cc \ |
| 219 | entrypoints/quick/quick_fillarray_entrypoints.cc \ |
| 220 | entrypoints/quick/quick_instrumentation_entrypoints.cc \ |
| 221 | entrypoints/quick/quick_jni_entrypoints.cc \ |
| 222 | entrypoints/quick/quick_lock_entrypoints.cc \ |
| 223 | entrypoints/quick/quick_math_entrypoints.cc \ |
| 224 | entrypoints/quick/quick_thread_entrypoints.cc \ |
| 225 | entrypoints/quick/quick_throw_entrypoints.cc \ |
| 226 | entrypoints/quick/quick_trampoline_entrypoints.cc |
| 227 | |
| 228 | LIBART_TARGET_LDFLAGS := |
| 229 | LIBART_HOST_LDFLAGS := |
| 230 | |
| 231 | # Keep the __jit_debug_register_code symbol as a unique symbol during ICF for architectures where |
| 232 | # we use gold as the linker (arm, x86, x86_64). The symbol is used by the debuggers to detect when |
| 233 | # new jit code is generated. We don't want it to be called when a different function with the same |
| 234 | # (empty) body is called. |
| 235 | JIT_DEBUG_REGISTER_CODE_LDFLAGS := -Wl,--keep-unique,__jit_debug_register_code |
| 236 | LIBART_TARGET_LDFLAGS_arm := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS) |
| 237 | LIBART_TARGET_LDFLAGS_arm64 := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS) |
| 238 | LIBART_TARGET_LDFLAGS_x86 := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS) |
| 239 | LIBART_TARGET_LDFLAGS_x86_64 := $(JIT_DEBUG_REGISTER_CODE_LDFLAGS) |
| 240 | JIT_DEBUG_REGISTER_CODE_LDFLAGS := |
| 241 | |
| 242 | LIBART_TARGET_SRC_FILES := \ |
| 243 | $(LIBART_COMMON_SRC_FILES) \ |
| 244 | jdwp/jdwp_adb.cc \ |
| 245 | monitor_android.cc \ |
| 246 | runtime_android.cc \ |
| 247 | thread_android.cc |
| 248 | |
| 249 | LIBART_TARGET_SRC_FILES_arm := \ |
| 250 | interpreter/mterp/mterp.cc \ |
| 251 | interpreter/mterp/out/mterp_arm.S \ |
| 252 | arch/arm/context_arm.cc.arm \ |
| 253 | arch/arm/entrypoints_init_arm.cc \ |
| 254 | arch/arm/instruction_set_features_assembly_tests.S \ |
| 255 | arch/arm/jni_entrypoints_arm.S \ |
| 256 | arch/arm/memcmp16_arm.S \ |
| 257 | arch/arm/quick_entrypoints_arm.S \ |
| 258 | arch/arm/quick_entrypoints_cc_arm.cc \ |
| 259 | arch/arm/thread_arm.cc \ |
| 260 | arch/arm/fault_handler_arm.cc |
| 261 | |
| 262 | LIBART_TARGET_SRC_FILES_arm64 := \ |
| 263 | interpreter/mterp/mterp.cc \ |
| 264 | interpreter/mterp/out/mterp_arm64.S \ |
| 265 | arch/arm64/context_arm64.cc \ |
| 266 | arch/arm64/entrypoints_init_arm64.cc \ |
| 267 | arch/arm64/jni_entrypoints_arm64.S \ |
| 268 | arch/arm64/memcmp16_arm64.S \ |
| 269 | arch/arm64/quick_entrypoints_arm64.S \ |
| 270 | arch/arm64/thread_arm64.cc \ |
| 271 | monitor_pool.cc \ |
| 272 | arch/arm64/fault_handler_arm64.cc |
| 273 | |
| 274 | LIBART_SRC_FILES_x86 := \ |
| 275 | interpreter/mterp/mterp.cc \ |
| 276 | interpreter/mterp/out/mterp_x86.S \ |
| 277 | arch/x86/context_x86.cc \ |
| 278 | arch/x86/entrypoints_init_x86.cc \ |
| 279 | arch/x86/jni_entrypoints_x86.S \ |
| 280 | arch/x86/memcmp16_x86.S \ |
| 281 | arch/x86/quick_entrypoints_x86.S \ |
| 282 | arch/x86/thread_x86.cc \ |
| 283 | arch/x86/fault_handler_x86.cc |
| 284 | |
| 285 | LIBART_TARGET_SRC_FILES_x86 := \ |
| 286 | $(LIBART_SRC_FILES_x86) |
| 287 | |
| 288 | # Note that the fault_handler_x86.cc is not a mistake. This file is |
| 289 | # shared between the x86 and x86_64 architectures. |
| 290 | LIBART_SRC_FILES_x86_64 := \ |
| 291 | interpreter/mterp/mterp.cc \ |
| 292 | interpreter/mterp/out/mterp_x86_64.S \ |
| 293 | arch/x86_64/context_x86_64.cc \ |
| 294 | arch/x86_64/entrypoints_init_x86_64.cc \ |
| 295 | arch/x86_64/jni_entrypoints_x86_64.S \ |
| 296 | arch/x86_64/memcmp16_x86_64.S \ |
| 297 | arch/x86_64/quick_entrypoints_x86_64.S \ |
| 298 | arch/x86_64/thread_x86_64.cc \ |
| 299 | monitor_pool.cc \ |
| 300 | arch/x86/fault_handler_x86.cc |
| 301 | |
| 302 | LIBART_TARGET_SRC_FILES_x86_64 := \ |
| 303 | $(LIBART_SRC_FILES_x86_64) \ |
| 304 | |
| 305 | LIBART_TARGET_SRC_FILES_mips := \ |
| 306 | interpreter/mterp/mterp.cc \ |
| 307 | interpreter/mterp/out/mterp_mips.S \ |
| 308 | arch/mips/context_mips.cc \ |
| 309 | arch/mips/entrypoints_init_mips.cc \ |
| 310 | arch/mips/jni_entrypoints_mips.S \ |
| 311 | arch/mips/memcmp16_mips.S \ |
| 312 | arch/mips/quick_entrypoints_mips.S \ |
| 313 | arch/mips/thread_mips.cc \ |
| 314 | arch/mips/fault_handler_mips.cc |
| 315 | |
| 316 | LIBART_TARGET_SRC_FILES_mips64 := \ |
| 317 | interpreter/mterp/mterp.cc \ |
| 318 | interpreter/mterp/out/mterp_mips64.S \ |
| 319 | arch/mips64/context_mips64.cc \ |
| 320 | arch/mips64/entrypoints_init_mips64.cc \ |
| 321 | arch/mips64/jni_entrypoints_mips64.S \ |
| 322 | arch/mips64/memcmp16_mips64.S \ |
| 323 | arch/mips64/quick_entrypoints_mips64.S \ |
| 324 | arch/mips64/thread_mips64.cc \ |
| 325 | monitor_pool.cc \ |
| 326 | arch/mips64/fault_handler_mips64.cc |
| 327 | |
| 328 | LIBART_HOST_SRC_FILES := \ |
| 329 | $(LIBART_COMMON_SRC_FILES) \ |
| 330 | monitor_linux.cc \ |
| 331 | runtime_linux.cc \ |
| 332 | thread_linux.cc |
| 333 | |
| 334 | LIBART_HOST_SRC_FILES_32 := \ |
| 335 | $(LIBART_SRC_FILES_x86) |
| 336 | |
| 337 | LIBART_HOST_SRC_FILES_64 := \ |
| 338 | $(LIBART_SRC_FILES_x86_64) |
| 339 | |
| 340 | LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := \ |
| 341 | arch/instruction_set.h \ |
| 342 | base/allocator.h \ |
| 343 | base/enums.h \ |
| 344 | base/mutex.h \ |
| 345 | debugger.h \ |
| 346 | base/unix_file/fd_file.h \ |
| 347 | dex_file.h \ |
| 348 | dex_instruction.h \ |
| 349 | dex_instruction_utils.h \ |
| 350 | gc_root.h \ |
| 351 | gc/allocator_type.h \ |
| 352 | gc/allocator/rosalloc.h \ |
| 353 | gc/collector_type.h \ |
| 354 | gc/collector/gc_type.h \ |
| 355 | gc/heap.h \ |
| 356 | gc/space/region_space.h \ |
| 357 | gc/space/space.h \ |
| 358 | gc/weak_root_state.h \ |
| 359 | image.h \ |
| 360 | instrumentation.h \ |
| 361 | indirect_reference_table.h \ |
| 362 | invoke_type.h \ |
| 363 | jdwp/jdwp.h \ |
| 364 | jdwp/jdwp_constants.h \ |
| 365 | lock_word.h \ |
| 366 | mirror/class.h \ |
| 367 | oat.h \ |
| 368 | object_callbacks.h \ |
| 369 | process_state.h \ |
| 370 | quick/inline_method_analyser.h \ |
| 371 | runtime.h \ |
| 372 | stack.h \ |
| 373 | thread.h \ |
| 374 | thread_state.h \ |
| 375 | ti/agent.h \ |
| 376 | verifier/method_verifier.h |
| 377 | |
| 378 | LIBOPENJDKJVM_SRC_FILES := openjdkjvm/OpenjdkJvm.cc |
| 379 | LIBOPENJDKJVMTI_SRC_FILES := openjdkjvmti/OpenjdkJvmTi.cc |
| 380 | |
| 381 | LIBART_CFLAGS := -DBUILDING_LIBART=1 |
| 382 | |
| 383 | LIBART_TARGET_CFLAGS := |
| 384 | LIBART_HOST_CFLAGS := |
| 385 | |
| 386 | # $(1): target or host |
| 387 | # $(2): ndebug or debug |
| 388 | # $(3): static or shared (note that static only applies for host) |
| 389 | # $(4): module name : either libart, libopenjdkjvm, or libopenjdkjvmti |
| 390 | define build-runtime-library |
| 391 | ifneq ($(1),target) |
| 392 | ifneq ($(1),host) |
| 393 | $$(error expected target or host for argument 1, received $(1)) |
| 394 | endif |
| 395 | endif |
| 396 | ifneq ($(2),ndebug) |
| 397 | ifneq ($(2),debug) |
| 398 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 399 | endif |
| 400 | endif |
| 401 | ifneq ($(4),libart) |
| 402 | ifneq ($(4),libopenjdkjvm) |
| 403 | ifneq ($(4),libopenjdkjvmti) |
| 404 | $$(error expected libart, libopenjdkjvmti, or libopenjdkjvm for argument 4, received $(4)) |
| 405 | endif |
| 406 | endif |
| 407 | endif |
| 408 | |
| 409 | art_target_or_host := $(1) |
| 410 | art_ndebug_or_debug := $(2) |
| 411 | art_static_or_shared := $(3) |
| 412 | |
| 413 | include $$(CLEAR_VARS) |
| 414 | LOCAL_CPP_EXTENSION := $$(ART_CPP_EXTENSION) |
| 415 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 416 | LOCAL_MODULE := $(4) |
| 417 | ifeq ($$(art_target_or_host),target) |
| 418 | LOCAL_FDO_SUPPORT := true |
| 419 | endif |
| 420 | else # debug |
| 421 | LOCAL_MODULE := $(4)d |
| 422 | endif |
| 423 | |
| 424 | LOCAL_MODULE_TAGS := optional |
| 425 | |
| 426 | ifeq ($$(art_static_or_shared),static) |
| 427 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 428 | else |
| 429 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 430 | endif |
| 431 | |
| 432 | ifeq ($(4),libart) |
| 433 | ifeq ($$(art_target_or_host),target) |
| 434 | LOCAL_SRC_FILES := $$(LIBART_TARGET_SRC_FILES) |
| 435 | $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \ |
| 436 | $$(eval LOCAL_SRC_FILES_$$(arch) := $$$$(LIBART_TARGET_SRC_FILES_$$(arch)))) |
| 437 | else # host |
| 438 | LOCAL_SRC_FILES := $$(LIBART_HOST_SRC_FILES) |
| 439 | LOCAL_SRC_FILES_32 := $$(LIBART_HOST_SRC_FILES_32) |
| 440 | LOCAL_SRC_FILES_64 := $$(LIBART_HOST_SRC_FILES_64) |
| 441 | LOCAL_IS_HOST_MODULE := true |
| 442 | endif |
| 443 | else |
| 444 | ifeq ($(4),libopenjdkjvmti) |
| 445 | LOCAL_SRC_FILES := $$(LIBOPENJDKJVMTI_SRC_FILES) |
| 446 | else # libopenjdkjvm |
| 447 | LOCAL_SRC_FILES := $$(LIBOPENJDKJVM_SRC_FILES) |
| 448 | endif |
| 449 | ifeq ($$(art_target_or_host),host) |
| 450 | LOCAL_IS_HOST_MODULE := true |
| 451 | endif |
| 452 | endif |
| 453 | |
| 454 | ifeq ($(4),libart) |
| 455 | GENERATED_SRC_DIR := $$(call local-generated-sources-dir) |
| 456 | ENUM_OPERATOR_OUT_CC_FILES := $$(patsubst %.h,%_operator_out.cc,$$(LIBART_ENUM_OPERATOR_OUT_HEADER_FILES)) |
| 457 | ENUM_OPERATOR_OUT_GEN := $$(addprefix $$(GENERATED_SRC_DIR)/,$$(ENUM_OPERATOR_OUT_CC_FILES)) |
| 458 | |
| 459 | $$(ENUM_OPERATOR_OUT_GEN): art/tools/generate-operator-out.py |
| 460 | $$(ENUM_OPERATOR_OUT_GEN): PRIVATE_CUSTOM_TOOL = art/tools/generate-operator-out.py $(LOCAL_PATH) $$< > $$@ |
| 461 | $$(ENUM_OPERATOR_OUT_GEN): $$(GENERATED_SRC_DIR)/%_operator_out.cc : $(LOCAL_PATH)/%.h |
| 462 | $$(transform-generated-source) |
| 463 | |
| 464 | LOCAL_GENERATED_SOURCES += $$(ENUM_OPERATOR_OUT_GEN) |
| 465 | endif |
| 466 | |
| 467 | LOCAL_CFLAGS := $$(LIBART_CFLAGS) |
| 468 | LOCAL_LDFLAGS := $$(LIBART_LDFLAGS) |
| 469 | ifeq ($$(art_target_or_host),target) |
| 470 | LOCAL_CFLAGS += $$(LIBART_TARGET_CFLAGS) |
| 471 | LOCAL_LDFLAGS += $$(LIBART_TARGET_LDFLAGS) |
| 472 | $$(foreach arch,$$(ART_TARGET_SUPPORTED_ARCH), \ |
| 473 | $$(eval LOCAL_LDFLAGS_$$(arch) := $$(LIBART_TARGET_LDFLAGS_$$(arch)))) |
| 474 | else #host |
| 475 | LOCAL_CFLAGS += $$(LIBART_HOST_CFLAGS) |
| 476 | LOCAL_LDFLAGS += $$(LIBART_HOST_LDFLAGS) |
| 477 | ifeq ($$(art_static_or_shared),static) |
| 478 | LOCAL_LDFLAGS += -static |
| 479 | endif |
| 480 | endif |
| 481 | |
| 482 | # Clang usage |
| 483 | ifeq ($$(art_target_or_host),target) |
| 484 | $$(eval LOCAL_CLANG := $$(ART_TARGET_CLANG)) |
| 485 | $$(eval $$(call set-target-local-cflags-vars,$(2))) |
| 486 | LOCAL_ASFLAGS_arm += -no-integrated-as |
| 487 | else # host |
| 488 | LOCAL_CLANG := $$(ART_HOST_CLANG) |
| 489 | LOCAL_LDLIBS += -ldl -lpthread |
| 490 | ifeq ($$(HOST_OS),linux) |
| 491 | LOCAL_LDLIBS += -lrt |
| 492 | endif |
| 493 | LOCAL_CFLAGS += $$(ART_HOST_CFLAGS) |
| 494 | LOCAL_ASFLAGS += $$(ART_HOST_ASFLAGS) |
| 495 | |
| 496 | ifeq ($$(art_ndebug_or_debug),debug) |
| 497 | LOCAL_CFLAGS += $$(ART_HOST_DEBUG_CFLAGS) |
| 498 | LOCAL_ASFLAGS += $$(ART_HOST_DEBUG_ASFLAGS) |
| 499 | else |
| 500 | LOCAL_CFLAGS += $$(ART_HOST_NON_DEBUG_CFLAGS) |
| 501 | LOCAL_ASFLAGS += $$(ART_HOST_NON_DEBUG_ASFLAGS) |
| 502 | endif |
| 503 | LOCAL_MULTILIB := both |
| 504 | endif |
| 505 | |
| 506 | LOCAL_C_INCLUDES += $$(ART_C_INCLUDES) |
| 507 | LOCAL_C_INCLUDES += art/cmdline |
| 508 | LOCAL_C_INCLUDES += art/sigchainlib |
| 509 | LOCAL_C_INCLUDES += art |
| 510 | |
| 511 | ifeq ($$(art_static_or_shared),static) |
| 512 | LOCAL_STATIC_LIBRARIES := libnativehelper |
| 513 | LOCAL_STATIC_LIBRARIES += libnativebridge |
| 514 | LOCAL_STATIC_LIBRARIES += libnativeloader |
| 515 | LOCAL_STATIC_LIBRARIES += libsigchain_dummy |
| 516 | LOCAL_STATIC_LIBRARIES += libbacktrace |
| 517 | LOCAL_STATIC_LIBRARIES += liblz4 |
| 518 | else |
| 519 | LOCAL_SHARED_LIBRARIES := libnativehelper |
| 520 | LOCAL_SHARED_LIBRARIES += libnativebridge |
| 521 | LOCAL_SHARED_LIBRARIES += libnativeloader |
| 522 | LOCAL_SHARED_LIBRARIES += libsigchain |
| 523 | LOCAL_SHARED_LIBRARIES += libbacktrace |
| 524 | LOCAL_SHARED_LIBRARIES += liblz4 |
| 525 | endif |
| 526 | |
| 527 | ifeq ($$(art_target_or_host),target) |
| 528 | LOCAL_SHARED_LIBRARIES += libdl |
| 529 | # ZipArchive support, the order matters here to get all symbols. |
| 530 | LOCAL_STATIC_LIBRARIES := libziparchive libz libbase |
| 531 | # For android::FileMap used by libziparchive. |
| 532 | LOCAL_SHARED_LIBRARIES += libutils |
| 533 | # For liblog, atrace, properties, ashmem, set_sched_policy and socket_peer_is_trusted. |
| 534 | LOCAL_SHARED_LIBRARIES += libcutils |
| 535 | else # host |
| 536 | ifeq ($$(art_static_or_shared),static) |
| 537 | LOCAL_STATIC_LIBRARIES += libziparchive-host libz |
| 538 | # For ashmem_create_region. |
| 539 | LOCAL_STATIC_LIBRARIES += libcutils |
| 540 | else |
| 541 | LOCAL_SHARED_LIBRARIES += libziparchive-host libz-host |
| 542 | # For ashmem_create_region. |
| 543 | LOCAL_SHARED_LIBRARIES += libcutils |
| 544 | endif |
| 545 | endif |
| 546 | |
| 547 | ifeq ($(4),libopenjdkjvm) |
| 548 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 549 | LOCAL_SHARED_LIBRARIES += libart |
| 550 | else |
| 551 | LOCAL_SHARED_LIBRARIES += libartd |
| 552 | endif |
| 553 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/openjdkjvm/NOTICE |
| 554 | else |
| 555 | ifeq ($(4),libopenjdkjvmti) |
| 556 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 557 | LOCAL_SHARED_LIBRARIES += libart |
| 558 | else |
| 559 | LOCAL_SHARED_LIBRARIES += libartd |
| 560 | endif |
| 561 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/openjdkjvmti/NOTICE |
| 562 | endif |
| 563 | endif |
| 564 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 565 | LOCAL_ADDITIONAL_DEPENDENCIES += $$(LOCAL_PATH)/Android.mk |
| 566 | |
| 567 | ifeq ($$(art_target_or_host),target) |
| 568 | LOCAL_MODULE_TARGET_ARCH := $$(ART_TARGET_SUPPORTED_ARCH) |
| 569 | endif |
| 570 | |
| 571 | LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE) |
| 572 | |
| 573 | ifeq ($$(art_target_or_host),target) |
| 574 | ifneq ($$(art_ndebug_or_debug),debug) |
| 575 | # Leave the symbols in the shared library so that stack unwinders can |
| 576 | # produce meaningful name resolution. |
| 577 | LOCAL_STRIP_MODULE := keep_symbols |
| 578 | endif |
| 579 | include $$(BUILD_SHARED_LIBRARY) |
| 580 | else # host |
| 581 | ifeq ($$(art_static_or_shared),static) |
| 582 | include $$(BUILD_HOST_STATIC_LIBRARY) |
| 583 | else |
| 584 | include $$(BUILD_HOST_SHARED_LIBRARY) |
| 585 | endif |
| 586 | endif |
| 587 | |
| 588 | # Clear locally defined variables. |
| 589 | GENERATED_SRC_DIR := |
| 590 | ENUM_OPERATOR_OUT_CC_FILES := |
| 591 | ENUM_OPERATOR_OUT_GEN := |
| 592 | art_target_or_host := |
| 593 | art_ndebug_or_debug := |
| 594 | art_static_or_shared := |
| 595 | endef |
| 596 | |
| 597 | # We always build dex2oat and dependencies, even if the host build is otherwise disabled, since |
| 598 | # they are used to cross compile for the target. |
| 599 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
| 600 | $(eval $(call build-runtime-library,host,ndebug,shared,libart)) |
| 601 | $(eval $(call build-runtime-library,host,ndebug,shared,libopenjdkjvm)) |
| 602 | $(eval $(call build-runtime-library,host,ndebug,shared,libopenjdkjvmti)) |
| 603 | ifeq ($(ART_BUILD_HOST_STATIC),true) |
| 604 | $(eval $(call build-runtime-library,host,ndebug,static,libart)) |
| 605 | $(eval $(call build-runtime-library,host,ndebug,static,libopenjdkjvm)) |
| 606 | $(eval $(call build-runtime-library,host,ndebug,static,libopenjdkjvmti)) |
| 607 | endif |
| 608 | endif |
| 609 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
| 610 | $(eval $(call build-runtime-library,host,debug,shared,libart)) |
| 611 | $(eval $(call build-runtime-library,host,debug,shared,libopenjdkjvm)) |
| 612 | $(eval $(call build-runtime-library,host,debug,shared,libopenjdkjvmti)) |
| 613 | ifeq ($(ART_BUILD_HOST_STATIC),true) |
| 614 | $(eval $(call build-runtime-library,host,debug,static,libart)) |
| 615 | $(eval $(call build-runtime-library,host,debug,static,libopenjdkjvm)) |
| 616 | $(eval $(call build-runtime-library,host,debug,static,libopenjdkjvmti)) |
| 617 | endif |
| 618 | endif |
| 619 | |
| 620 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 621 | # $(error $(call build-runtime-library,target,ndebug)) |
| 622 | $(eval $(call build-runtime-library,target,ndebug,shared,libart)) |
| 623 | $(eval $(call build-runtime-library,target,ndebug,shared,libopenjdkjvm)) |
| 624 | $(eval $(call build-runtime-library,target,ndebug,shared,libopenjdkjvmti)) |
| 625 | endif |
| 626 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 627 | $(eval $(call build-runtime-library,target,debug,shared,libart)) |
| 628 | $(eval $(call build-runtime-library,target,debug,shared,libopenjdkjvm)) |
| 629 | $(eval $(call build-runtime-library,target,debug,shared,libopenjdkjvmti)) |
| 630 | endif |
| 631 | |
| 632 | # Clear locally defined variables. |
| 633 | LOCAL_PATH := |
| 634 | LIBART_COMMON_SRC_FILES := |
| 635 | LIBART_HOST_LDFLAGS := |
| 636 | LIBART_TARGET_LDFLAGS := |
| 637 | LIBART_TARGET_LDFLAGS_arm := |
| 638 | LIBART_TARGET_LDFLAGS_arm64 := |
| 639 | LIBART_TARGET_LDFLAGS_x86 := |
| 640 | LIBART_TARGET_LDFLAGS_x86_64 := |
| 641 | LIBART_TARGET_LDFLAGS_mips := |
| 642 | LIBART_TARGET_LDFLAGS_mips64 := |
| 643 | LIBART_TARGET_SRC_FILES := |
| 644 | LIBART_TARGET_SRC_FILES_arm := |
| 645 | LIBART_TARGET_SRC_FILES_arm64 := |
| 646 | LIBART_TARGET_SRC_FILES_x86 := |
| 647 | LIBART_TARGET_SRC_FILES_x86_64 := |
| 648 | LIBART_TARGET_SRC_FILES_mips := |
| 649 | LIBART_TARGET_SRC_FILES_mips64 := |
| 650 | LIBART_HOST_SRC_FILES := |
| 651 | LIBART_HOST_SRC_FILES_32 := |
| 652 | LIBART_HOST_SRC_FILES_64 := |
| 653 | LIBART_ENUM_OPERATOR_OUT_HEADER_FILES := |
| 654 | LIBART_CFLAGS := |
| 655 | LIBART_TARGET_CFLAGS := |
| 656 | LIBART_HOST_CFLAGS := |
| 657 | build-runtime-library := |