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 | 395116c | 2013-02-27 14:30:25 -0800 | [diff] [blame] | 18 | src/compiler/dex/bb_opt.cc \ |
| 19 | src/compiler/dex/quick/arm/assemble_arm.cc \ |
| 20 | src/compiler/dex/quick/arm/call_arm.cc \ |
| 21 | src/compiler/dex/quick/arm/fp_arm.cc \ |
| 22 | src/compiler/dex/quick/arm/int_arm.cc \ |
| 23 | src/compiler/dex/quick/arm/target_arm.cc \ |
| 24 | src/compiler/dex/quick/arm/utility_arm.cc \ |
| 25 | src/compiler/dex/quick/codegen_util.cc \ |
| 26 | src/compiler/dex/quick/gen_common.cc \ |
| 27 | src/compiler/dex/quick/gen_invoke.cc \ |
| 28 | src/compiler/dex/quick/gen_loadstore.cc \ |
| 29 | src/compiler/dex/quick/local_optimizations.cc \ |
| 30 | src/compiler/dex/quick/mips/assemble_mips.cc \ |
| 31 | src/compiler/dex/quick/mips/call_mips.cc \ |
| 32 | src/compiler/dex/quick/mips/fp_mips.cc \ |
| 33 | src/compiler/dex/quick/mips/int_mips.cc \ |
| 34 | src/compiler/dex/quick/mips/target_mips.cc \ |
| 35 | src/compiler/dex/quick/mips/utility_mips.cc \ |
| 36 | src/compiler/dex/quick/mir_to_lir.cc \ |
| 37 | src/compiler/dex/quick/ralloc_util.cc \ |
| 38 | src/compiler/dex/quick/x86/assemble_x86.cc \ |
| 39 | src/compiler/dex/quick/x86/call_x86.cc \ |
| 40 | src/compiler/dex/quick/x86/fp_x86.cc \ |
| 41 | src/compiler/dex/quick/x86/int_x86.cc \ |
| 42 | src/compiler/dex/quick/x86/target_x86.cc \ |
| 43 | src/compiler/dex/quick/x86/utility_x86.cc \ |
| 44 | src/compiler/dex/portable/mir_to_gbc.cc \ |
| 45 | src/compiler/dex/compiler_utility.cc \ |
| 46 | src/compiler/dex/dataflow.cc \ |
| 47 | src/compiler/dex/frontend.cc \ |
| 48 | src/compiler/dex/ralloc.cc \ |
| 49 | src/compiler/dex/ssa_transformation.cc \ |
| 50 | src/compiler/dex/write_elf.cc \ |
Ian Rogers | 0211378 | 2013-03-04 12:12:48 -0800 | [diff] [blame^] | 51 | src/compiler/jni/portable/jni_compiler.cc \ |
| 52 | src/compiler/jni/quick/arm/calling_convention_arm.cc \ |
| 53 | src/compiler/jni/quick/mips/calling_convention_mips.cc \ |
| 54 | src/compiler/jni/quick/x86/calling_convention_x86.cc \ |
| 55 | src/compiler/jni/quick/calling_convention.cc \ |
| 56 | src/compiler/jni/quick/jni_compiler.cc \ |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 57 | src/compiler_llvm/compiler_llvm.cc \ |
Ian Rogers | c928de9 | 2013-02-27 14:30:44 -0800 | [diff] [blame] | 58 | src/compiler_llvm/gbc_expander.cc \ |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 59 | src/compiler_llvm/generated/art_module.cc \ |
Ian Rogers | 76ae4fe | 2013-02-27 16:03:41 -0800 | [diff] [blame] | 60 | src/compiler_llvm/intrinsic_helper.cc \ |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 61 | src/compiler_llvm/ir_builder.cc \ |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 62 | src/compiler_llvm/llvm_compilation_unit.cc \ |
| 63 | src/compiler_llvm/md_builder.cc \ |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 64 | src/compiler_llvm/runtime_support_builder.cc \ |
| 65 | src/compiler_llvm/runtime_support_builder_arm.cc \ |
| 66 | src/compiler_llvm/runtime_support_builder_thumb2.cc \ |
| 67 | src/compiler_llvm/runtime_support_builder_x86.cc \ |
| 68 | src/compiler_llvm/runtime_support_llvm.cc \ |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 69 | src/compiler_llvm/stub_compiler.cc \ |
| 70 | src/elf_writer.cc \ |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 71 | src/oat/jni/arm/jni_internal_arm.cc \ |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 72 | src/oat/jni/mips/jni_internal_mips.cc \ |
Ian Rogers | 01d1134 | 2013-02-28 00:15:33 -0800 | [diff] [blame] | 73 | src/oat/jni/x86/jni_internal_x86.cc |
| 74 | |
| 75 | LIBART_COMPILER_CFLAGS := |
| 76 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
| 77 | LIBART_COMPILER_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 78 | endif |
| 79 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 80 | # $(1): target or host |
| 81 | # $(2): ndebug or debug |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 82 | define build-libart-compiler |
| 83 | ifneq ($(1),target) |
| 84 | ifneq ($(1),host) |
| 85 | $$(error expected target or host for argument 1, received $(1)) |
| 86 | endif |
| 87 | endif |
| 88 | ifneq ($(2),ndebug) |
| 89 | ifneq ($(2),debug) |
| 90 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 91 | endif |
| 92 | endif |
| 93 | |
| 94 | art_target_or_host := $(1) |
| 95 | art_ndebug_or_debug := $(2) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 96 | |
| 97 | include $(CLEAR_VARS) |
| 98 | ifeq ($$(art_target_or_host),target) |
| 99 | include external/stlport/libstlport.mk |
| 100 | endif |
| 101 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 102 | ifeq ($$(art_ndebug_or_debug),ndebug) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 103 | LOCAL_MODULE := libart-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 104 | else # debug |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 105 | LOCAL_MODULE := libartd-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 106 | endif |
| 107 | |
| 108 | LOCAL_MODULE_TAGS := optional |
| 109 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 110 | |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 111 | LOCAL_SRC_FILES := $$(LIBART_COMPILER_SRC_FILES) |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 112 | |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 113 | LOCAL_CFLAGS := $$(LIBART_COMPILER_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 114 | ifeq ($$(art_target_or_host),target) |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 115 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 116 | else # host |
Brian Carlstrom | 00bc1dc | 2013-02-01 15:56:27 -0800 | [diff] [blame] | 117 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 118 | endif |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 119 | |
| 120 | # TODO: clean up the compilers and remove this. |
| 121 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 122 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 123 | LOCAL_SHARED_LIBRARIES := liblog |
| 124 | ifeq ($$(art_ndebug_or_debug),debug) |
| 125 | ifeq ($$(art_target_or_host),target) |
| 126 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 127 | else # host |
| 128 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 129 | endif |
| 130 | LOCAL_SHARED_LIBRARIES += libartd |
| 131 | else |
| 132 | ifeq ($$(art_target_or_host),target) |
| 133 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 134 | else # host |
| 135 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 136 | endif |
| 137 | LOCAL_SHARED_LIBRARIES += libart |
| 138 | endif |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 139 | LOCAL_SHARED_LIBRARIES += libbcc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 140 | |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 141 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
Brian Carlstrom | 641ce03 | 2013-01-31 15:21:37 -0800 | [diff] [blame] | 142 | LOCAL_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 143 | endif |
| 144 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 145 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 146 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 147 | ifeq ($$(art_target_or_host),target) |
| 148 | LOCAL_SHARED_LIBRARIES += libstlport |
| 149 | else # host |
| 150 | LOCAL_LDLIBS := -ldl -lpthread |
| 151 | endif |
| 152 | ifeq ($$(art_target_or_host),target) |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 153 | LOCAL_SHARED_LIBRARIES += libcutils |
| 154 | include $(LLVM_GEN_INTRINSICS_MK) |
| 155 | include $(LLVM_DEVICE_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 156 | include $(BUILD_SHARED_LIBRARY) |
| 157 | else # host |
| 158 | LOCAL_IS_HOST_MODULE := true |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 159 | LOCAL_STATIC_LIBRARIES += libcutils |
| 160 | include $(LLVM_GEN_INTRINSICS_MK) |
| 161 | include $(LLVM_HOST_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 162 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 163 | endif |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 164 | |
| 165 | ifeq ($$(art_target_or_host),target) |
| 166 | ifeq ($$(art_ndebug_or_debug),debug) |
| 167 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 168 | else |
| 169 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 170 | endif |
| 171 | else # host |
| 172 | ifeq ($$(art_ndebug_or_debug),debug) |
| 173 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 174 | else |
| 175 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 176 | endif |
| 177 | endif |
| 178 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 179 | endef |
| 180 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 181 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 182 | $(eval $(call build-libart-compiler,target,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 183 | endif |
| 184 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 185 | $(eval $(call build-libart-compiler,target,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 186 | endif |
| 187 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 188 | $(eval $(call build-libart-compiler,host,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 189 | endif |
| 190 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 191 | $(eval $(call build-libart-compiler,host,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 192 | endif |