Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 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 Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 17 | LIBART_COMPILER_SRC_FILES := \ |
buzbee | 311ca16 | 2013-02-28 15:56:43 -0800 | [diff] [blame] | 18 | src/compiler/dex/local_value_numbering.cc \ |
buzbee | 862a760 | 2013-04-05 10:58:54 -0700 | [diff] [blame] | 19 | src/compiler/dex/arena_allocator.cc \ |
| 20 | src/compiler/dex/arena_bit_vector.cc \ |
buzbee | 395116c | 2013-02-27 14:30:25 -0800 | [diff] [blame] | 21 | src/compiler/dex/quick/arm/assemble_arm.cc \ |
| 22 | src/compiler/dex/quick/arm/call_arm.cc \ |
| 23 | src/compiler/dex/quick/arm/fp_arm.cc \ |
| 24 | src/compiler/dex/quick/arm/int_arm.cc \ |
| 25 | src/compiler/dex/quick/arm/target_arm.cc \ |
| 26 | src/compiler/dex/quick/arm/utility_arm.cc \ |
| 27 | src/compiler/dex/quick/codegen_util.cc \ |
| 28 | src/compiler/dex/quick/gen_common.cc \ |
| 29 | src/compiler/dex/quick/gen_invoke.cc \ |
| 30 | src/compiler/dex/quick/gen_loadstore.cc \ |
| 31 | src/compiler/dex/quick/local_optimizations.cc \ |
| 32 | src/compiler/dex/quick/mips/assemble_mips.cc \ |
| 33 | src/compiler/dex/quick/mips/call_mips.cc \ |
| 34 | src/compiler/dex/quick/mips/fp_mips.cc \ |
| 35 | src/compiler/dex/quick/mips/int_mips.cc \ |
| 36 | src/compiler/dex/quick/mips/target_mips.cc \ |
| 37 | src/compiler/dex/quick/mips/utility_mips.cc \ |
| 38 | src/compiler/dex/quick/mir_to_lir.cc \ |
| 39 | src/compiler/dex/quick/ralloc_util.cc \ |
| 40 | src/compiler/dex/quick/x86/assemble_x86.cc \ |
| 41 | src/compiler/dex/quick/x86/call_x86.cc \ |
| 42 | src/compiler/dex/quick/x86/fp_x86.cc \ |
| 43 | src/compiler/dex/quick/x86/int_x86.cc \ |
| 44 | src/compiler/dex/quick/x86/target_x86.cc \ |
| 45 | src/compiler/dex/quick/x86/utility_x86.cc \ |
| 46 | src/compiler/dex/portable/mir_to_gbc.cc \ |
buzbee | 311ca16 | 2013-02-28 15:56:43 -0800 | [diff] [blame] | 47 | src/compiler/dex/mir_dataflow.cc \ |
| 48 | src/compiler/dex/dataflow_iterator.cc \ |
| 49 | src/compiler/dex/mir_optimization.cc \ |
buzbee | 395116c | 2013-02-27 14:30:25 -0800 | [diff] [blame] | 50 | src/compiler/dex/frontend.cc \ |
buzbee | 311ca16 | 2013-02-28 15:56:43 -0800 | [diff] [blame] | 51 | src/compiler/dex/mir_graph.cc \ |
| 52 | src/compiler/dex/vreg_analysis.cc \ |
buzbee | 395116c | 2013-02-27 14:30:25 -0800 | [diff] [blame] | 53 | src/compiler/dex/ssa_transformation.cc \ |
| 54 | src/compiler/dex/write_elf.cc \ |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 55 | src/compiler/driver/dex_compilation_unit.cc \ |
Ian Rogers | 0211378 | 2013-03-04 12:12:48 -0800 | [diff] [blame] | 56 | src/compiler/jni/portable/jni_compiler.cc \ |
| 57 | src/compiler/jni/quick/arm/calling_convention_arm.cc \ |
| 58 | src/compiler/jni/quick/mips/calling_convention_mips.cc \ |
| 59 | src/compiler/jni/quick/x86/calling_convention_x86.cc \ |
| 60 | src/compiler/jni/quick/calling_convention.cc \ |
| 61 | src/compiler/jni/quick/jni_compiler.cc \ |
Ian Rogers | 4c1c283 | 2013-03-04 18:30:13 -0800 | [diff] [blame] | 62 | src/compiler/llvm/compiler_llvm.cc \ |
| 63 | src/compiler/llvm/gbc_expander.cc \ |
| 64 | src/compiler/llvm/generated/art_module.cc \ |
| 65 | src/compiler/llvm/intrinsic_helper.cc \ |
| 66 | src/compiler/llvm/ir_builder.cc \ |
| 67 | src/compiler/llvm/llvm_compilation_unit.cc \ |
| 68 | src/compiler/llvm/md_builder.cc \ |
| 69 | src/compiler/llvm/runtime_support_builder.cc \ |
| 70 | src/compiler/llvm/runtime_support_builder_arm.cc \ |
| 71 | src/compiler/llvm/runtime_support_builder_thumb2.cc \ |
| 72 | src/compiler/llvm/runtime_support_builder_x86.cc \ |
| 73 | src/compiler/llvm/runtime_support_llvm.cc \ |
Brian Carlstrom | 6a47b9d | 2013-05-17 10:58:25 -0700 | [diff] [blame] | 74 | src/elf_fixup.cc \ |
| 75 | src/elf_stripper.cc \ |
| 76 | src/elf_writer.cc \ |
Brian Carlstrom | 6a47b9d | 2013-05-17 10:58:25 -0700 | [diff] [blame] | 77 | src/elf_writer_quick.cc |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 78 | |
| 79 | LIBART_COMPILER_CFLAGS := |
| 80 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
Brian Carlstrom | 1e8c505 | 2013-05-21 20:25:19 -0700 | [diff] [blame] | 81 | LIBART_COMPILER_SRC_FILES += src/elf_writer_mclinker.cc |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 82 | LIBART_COMPILER_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 83 | endif |
| 84 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 85 | # $(1): target or host |
| 86 | # $(2): ndebug or debug |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 87 | define build-libart-compiler |
| 88 | ifneq ($(1),target) |
| 89 | ifneq ($(1),host) |
| 90 | $$(error expected target or host for argument 1, received $(1)) |
| 91 | endif |
| 92 | endif |
| 93 | ifneq ($(2),ndebug) |
| 94 | ifneq ($(2),debug) |
| 95 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 96 | endif |
| 97 | endif |
| 98 | |
| 99 | art_target_or_host := $(1) |
| 100 | art_ndebug_or_debug := $(2) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 101 | |
| 102 | include $(CLEAR_VARS) |
| 103 | ifeq ($$(art_target_or_host),target) |
| 104 | include external/stlport/libstlport.mk |
| 105 | endif |
| 106 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 107 | ifeq ($$(art_ndebug_or_debug),ndebug) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 108 | LOCAL_MODULE := libart-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 109 | else # debug |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 110 | LOCAL_MODULE := libartd-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 111 | endif |
| 112 | |
| 113 | LOCAL_MODULE_TAGS := optional |
| 114 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 115 | |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 116 | LOCAL_SRC_FILES := $$(LIBART_COMPILER_SRC_FILES) |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 117 | |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 118 | LOCAL_CFLAGS := $$(LIBART_COMPILER_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 119 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 120 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 121 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 122 | else # host |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 123 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 124 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 125 | endif |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 126 | |
| 127 | # TODO: clean up the compilers and remove this. |
| 128 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 129 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 130 | LOCAL_SHARED_LIBRARIES := liblog |
| 131 | ifeq ($$(art_ndebug_or_debug),debug) |
| 132 | ifeq ($$(art_target_or_host),target) |
| 133 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 134 | else # host |
| 135 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 136 | endif |
| 137 | LOCAL_SHARED_LIBRARIES += libartd |
| 138 | else |
| 139 | ifeq ($$(art_target_or_host),target) |
| 140 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 141 | else # host |
| 142 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 143 | endif |
| 144 | LOCAL_SHARED_LIBRARIES += libart |
| 145 | endif |
Brian Carlstrom | 37d4879 | 2013-03-22 14:14:45 -0700 | [diff] [blame] | 146 | LOCAL_SHARED_LIBRARIES += libbcc libLLVM |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 147 | |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 148 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
Brian Carlstrom | 641ce03 | 2013-01-31 15:21:37 -0800 | [diff] [blame] | 149 | LOCAL_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 150 | endif |
| 151 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 152 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 153 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 154 | ifeq ($$(art_target_or_host),target) |
| 155 | LOCAL_SHARED_LIBRARIES += libstlport |
| 156 | else # host |
| 157 | LOCAL_LDLIBS := -ldl -lpthread |
| 158 | endif |
| 159 | ifeq ($$(art_target_or_host),target) |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 160 | LOCAL_SHARED_LIBRARIES += libcutils |
| 161 | include $(LLVM_GEN_INTRINSICS_MK) |
| 162 | include $(LLVM_DEVICE_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 163 | include $(BUILD_SHARED_LIBRARY) |
| 164 | else # host |
| 165 | LOCAL_IS_HOST_MODULE := true |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 166 | LOCAL_STATIC_LIBRARIES += libcutils |
| 167 | include $(LLVM_GEN_INTRINSICS_MK) |
| 168 | include $(LLVM_HOST_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 169 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 170 | endif |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 171 | |
| 172 | ifeq ($$(art_target_or_host),target) |
| 173 | ifeq ($$(art_ndebug_or_debug),debug) |
| 174 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 175 | else |
| 176 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 177 | endif |
| 178 | else # host |
| 179 | ifeq ($$(art_ndebug_or_debug),debug) |
| 180 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 181 | else |
| 182 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 183 | endif |
| 184 | endif |
| 185 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 186 | endef |
| 187 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 188 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 189 | $(eval $(call build-libart-compiler,target,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 190 | endif |
| 191 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 192 | $(eval $(call build-libart-compiler,target,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 193 | endif |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 194 | # We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target. |
| 195 | ifeq ($(ART_BUILD_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 196 | $(eval $(call build-libart-compiler,host,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 197 | endif |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 198 | ifeq ($(ART_BUILD_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 199 | $(eval $(call build-libart-compiler,host,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 200 | endif |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 201 | |
Brian Carlstrom | ecc6682 | 2013-03-29 16:58:30 -0700 | [diff] [blame] | 202 | # Rule to build /system/lib/libcompiler_rt.a |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 203 | # Usually static libraries are not installed on the device. |
| 204 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
| 205 | ifeq ($(ART_BUILD_TARGET),true) |
Brian Carlstrom | ecc6682 | 2013-03-29 16:58:30 -0700 | [diff] [blame] | 206 | # TODO: Move to external/compiler_rt |
| 207 | $(eval $(call copy-one-file, $(call intermediates-dir-for,STATIC_LIBRARIES,libcompiler_rt,,)/libcompiler_rt.a, $(TARGET_OUT_SHARED_LIBRARIES)/libcompiler_rt.a)) |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 208 | |
Brian Carlstrom | ecc6682 | 2013-03-29 16:58:30 -0700 | [diff] [blame] | 209 | $(DEX2OAT): $(TARGET_OUT_SHARED_LIBRARIES)/libcompiler_rt.a |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 210 | |
| 211 | endif |
| 212 | endif |