Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -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 | |
| 17 | |
buzbee | 26f10ee | 2012-12-21 11:16:29 -0800 | [diff] [blame] | 18 | LIBART_COMPILER_LLVM_CFLAGS := -DART_USE_LLVM_COMPILER=1 |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 19 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
buzbee | 26f10ee | 2012-12-21 11:16:29 -0800 | [diff] [blame] | 20 | LIBART_COMPILER_LLVM_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 21 | endif |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 22 | |
| 23 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 24 | src/compiler_llvm/compilation_unit.cc \ |
| 25 | src/compiler_llvm/compiler_llvm.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 26 | src/compiler_llvm/generated/art_module.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 27 | src/compiler_llvm/ir_builder.cc \ |
| 28 | src/compiler_llvm/jni_compiler.cc \ |
TDYa127 | 1f196f1 | 2012-07-11 20:50:22 -0700 | [diff] [blame] | 29 | src/compiler_llvm/md_builder.cc \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 30 | src/compiler_llvm/runtime_support_builder.cc \ |
| 31 | src/compiler_llvm/runtime_support_builder_arm.cc \ |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 32 | src/compiler_llvm/runtime_support_builder_thumb2.cc \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 33 | src/compiler_llvm/runtime_support_builder_x86.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 34 | src/compiler_llvm/runtime_support_llvm.cc \ |
TDYa127 | 89f9605 | 2012-07-12 20:49:53 -0700 | [diff] [blame] | 35 | src/compiler_llvm/stub_compiler.cc \ |
| 36 | src/greenland/inferred_reg_category_map.cc |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 37 | |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 38 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 39 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 40 | src/compiler/dataflow.cc \ |
| 41 | src/compiler/frontend.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 42 | src/compiler/ralloc.cc \ |
buzbee | 1d6df8e | 2013-01-03 09:19:18 -0800 | [diff] [blame] | 43 | src/compiler/bb_opt.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 44 | src/compiler/ssa_transformation.cc \ |
| 45 | src/compiler/compiler_utility.cc \ |
| 46 | src/compiler/codegen/ralloc_util.cc \ |
| 47 | src/compiler/codegen/codegen_util.cc \ |
| 48 | src/compiler/codegen/gen_loadstore.cc \ |
| 49 | src/compiler/codegen/gen_common.cc \ |
| 50 | src/compiler/codegen/gen_invoke.cc \ |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 51 | src/compiler/codegen/mir_to_gbc.cc \ |
| 52 | src/compiler/codegen/mir_to_lir.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 53 | src/compiler/codegen/local_optimizations.cc \ |
| 54 | src/compiler/codegen/arm/target_arm.cc \ |
| 55 | src/compiler/codegen/arm/assemble_arm.cc \ |
| 56 | src/compiler/codegen/arm/utility_arm.cc \ |
| 57 | src/compiler/codegen/arm/call_arm.cc \ |
| 58 | src/compiler/codegen/arm/fp_arm.cc \ |
| 59 | src/compiler/codegen/arm/int_arm.cc \ |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 60 | src/compiler/codegen/mips/target_mips.cc \ |
| 61 | src/compiler/codegen/mips/assemble_mips.cc \ |
| 62 | src/compiler/codegen/mips/utility_mips.cc \ |
| 63 | src/compiler/codegen/mips/call_mips.cc \ |
| 64 | src/compiler/codegen/mips/fp_mips.cc \ |
| 65 | src/compiler/codegen/mips/int_mips.cc \ |
| 66 | src/compiler/codegen/x86/target_x86.cc \ |
| 67 | src/compiler/codegen/x86/assemble_x86.cc \ |
| 68 | src/compiler/codegen/x86/utility_x86.cc \ |
| 69 | src/compiler/codegen/x86/call_x86.cc \ |
| 70 | src/compiler/codegen/x86/fp_x86.cc \ |
| 71 | src/compiler/codegen/x86/int_x86.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 72 | src/compiler_llvm/dalvik_reg.cc \ |
| 73 | src/compiler_llvm/gbc_expander.cc \ |
| 74 | src/compiler_llvm/method_compiler.cc \ |
| 75 | src/greenland/intrinsic_helper.cc \ |
| 76 | src/greenland/ir_builder.cc |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 77 | else |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 78 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 79 | src/compiler_llvm/dalvik_reg.cc \ |
| 80 | src/compiler_llvm/method_compiler.cc |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 81 | endif |
| 82 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 83 | # $(1): target or host |
| 84 | # $(2): ndebug or debug |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 85 | define build-libart-compiler-llvm |
| 86 | ifneq ($(1),target) |
| 87 | ifneq ($(1),host) |
| 88 | $$(error expected target or host for argument 1, received $(1)) |
| 89 | endif |
| 90 | endif |
| 91 | ifneq ($(2),ndebug) |
| 92 | ifneq ($(2),debug) |
| 93 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 94 | endif |
| 95 | endif |
| 96 | |
| 97 | art_target_or_host := $(1) |
| 98 | art_ndebug_or_debug := $(2) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 99 | |
| 100 | include $(CLEAR_VARS) |
| 101 | ifeq ($$(art_target_or_host),target) |
| 102 | include external/stlport/libstlport.mk |
| 103 | endif |
| 104 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 105 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 106 | LOCAL_MODULE := libart-compiler-llvm |
| 107 | else # debug |
| 108 | LOCAL_MODULE := libartd-compiler-llvm |
| 109 | endif |
| 110 | |
| 111 | LOCAL_MODULE_TAGS := optional |
| 112 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 113 | |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 114 | LOCAL_SRC_FILES := $(LIBART_COMPILER_LLVM_SRC_FILES) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 115 | LOCAL_CFLAGS := $(LIBART_COMPILER_LLVM_CFLAGS) |
| 116 | ifeq ($$(art_target_or_host),target) |
| 117 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 118 | else # host |
| 119 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
| 120 | endif |
| 121 | |
| 122 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
Logan Chien | 971bf3f | 2012-05-01 15:47:55 +0800 | [diff] [blame] | 123 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 124 | LOCAL_SHARED_LIBRARIES := liblog libnativehelper |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 125 | LOCAL_SHARED_LIBRARIES += libcorkscrew # native stack trace support |
Shih-wei Liao | cdc6690 | 2012-07-22 16:45:37 -0700 | [diff] [blame] | 126 | LOCAL_SHARED_LIBRARIES += libbcc |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 127 | ifeq ($$(art_target_or_host),target) |
| 128 | LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl |
| 129 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations # tsan support |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 130 | else # host |
| 131 | LOCAL_STATIC_LIBRARIES += libcutils |
| 132 | LOCAL_SHARED_LIBRARIES += libz-host |
| 133 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations-host # tsan support |
| 134 | LOCAL_LDLIBS := -ldl -lpthread |
| 135 | ifeq ($(HOST_OS),linux) |
| 136 | LOCAL_LDLIBS += -lrt |
| 137 | endif |
| 138 | endif |
| 139 | ifeq ($$(art_ndebug_or_debug),debug) |
| 140 | ifeq ($$(art_target_or_host),target) |
| 141 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 142 | else # host |
| 143 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 144 | endif |
| 145 | LOCAL_SHARED_LIBRARIES += libartd |
| 146 | else |
| 147 | ifeq ($$(art_target_or_host),target) |
| 148 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 149 | else # host |
| 150 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 151 | endif |
| 152 | LOCAL_SHARED_LIBRARIES += libart |
| 153 | endif |
| 154 | ifeq ($$(art_target_or_host),target) |
| 155 | include $(LLVM_GEN_INTRINSICS_MK) |
| 156 | include $(LLVM_DEVICE_BUILD_MK) |
| 157 | include $(BUILD_SHARED_LIBRARY) |
| 158 | else # host |
| 159 | LOCAL_IS_HOST_MODULE := true |
| 160 | include $(LLVM_GEN_INTRINSICS_MK) |
| 161 | include $(LLVM_HOST_BUILD_MK) |
| 162 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 163 | endif |
| 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 | |
| 179 | endef |
| 180 | |
| 181 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 182 | $(eval $(call build-libart-compiler-llvm,target,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 183 | endif |
| 184 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 185 | $(eval $(call build-libart-compiler-llvm,target,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 186 | endif |
| 187 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 188 | $(eval $(call build-libart-compiler-llvm,host,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 189 | endif |
| 190 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 191 | $(eval $(call build-libart-compiler-llvm,host,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 192 | endif |