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 | |
| 18 | LIBART_COMPILER_LLVM_CFLAGS := -DART_USE_LLVM_COMPILER=1 |
| 19 | |
| 20 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 21 | src/compiler_llvm/compilation_unit.cc \ |
| 22 | src/compiler_llvm/compiler_llvm.cc \ |
| 23 | src/compiler_llvm/dalvik_reg.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 24 | src/compiler_llvm/generated/art_module.cc \ |
| 25 | src/compiler_llvm/inferred_reg_category_map.cc \ |
| 26 | src/compiler_llvm/ir_builder.cc \ |
| 27 | src/compiler_llvm/jni_compiler.cc \ |
| 28 | src/compiler_llvm/method_compiler.cc \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 29 | src/compiler_llvm/runtime_support_builder.cc \ |
| 30 | src/compiler_llvm/runtime_support_builder_arm.cc \ |
| 31 | src/compiler_llvm/runtime_support_builder_x86.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 32 | src/compiler_llvm/runtime_support_llvm.cc \ |
TDYa127 | aba6112 | 2012-05-04 18:28:36 -0700 | [diff] [blame] | 33 | src/compiler_llvm/tbaa_info.cc \ |
Logan Chien | 937105a | 2012-04-02 02:37:37 +0800 | [diff] [blame] | 34 | src/compiler_llvm/upcall_compiler.cc |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 35 | |
| 36 | # $(1): target or host |
| 37 | # $(2): ndebug or debug |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 38 | define build-libart-compiler-llvm |
| 39 | ifneq ($(1),target) |
| 40 | ifneq ($(1),host) |
| 41 | $$(error expected target or host for argument 1, received $(1)) |
| 42 | endif |
| 43 | endif |
| 44 | ifneq ($(2),ndebug) |
| 45 | ifneq ($(2),debug) |
| 46 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 47 | endif |
| 48 | endif |
| 49 | |
| 50 | art_target_or_host := $(1) |
| 51 | art_ndebug_or_debug := $(2) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 52 | |
| 53 | include $(CLEAR_VARS) |
| 54 | ifeq ($$(art_target_or_host),target) |
| 55 | include external/stlport/libstlport.mk |
| 56 | endif |
| 57 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 58 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 59 | LOCAL_MODULE := libart-compiler-llvm |
| 60 | else # debug |
| 61 | LOCAL_MODULE := libartd-compiler-llvm |
| 62 | endif |
| 63 | |
| 64 | LOCAL_MODULE_TAGS := optional |
| 65 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 66 | |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 67 | LOCAL_SRC_FILES := $(LIBART_COMPILER_LLVM_SRC_FILES) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 68 | LOCAL_CFLAGS := $(LIBART_COMPILER_LLVM_CFLAGS) |
| 69 | ifeq ($$(art_target_or_host),target) |
| 70 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 71 | else # host |
| 72 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
| 73 | endif |
| 74 | |
| 75 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
| 76 | LOCAL_C_INCLUDES += frameworks/compile/linkloader |
| 77 | libart_compiler_llvm_arm_STATIC_LIBRARIES := \ |
| 78 | libLLVMARMInfo \ |
| 79 | libLLVMARMDisassembler \ |
| 80 | libLLVMARMAsmParser \ |
| 81 | libLLVMARMAsmPrinter \ |
| 82 | libLLVMARMCodeGen \ |
| 83 | libLLVMARMDesc |
| 84 | |
Shih-wei Liao | 6e41d42 | 2012-03-26 23:43:02 -0700 | [diff] [blame] | 85 | libart_compiler_llvm_mips_STATIC_LIBRARIES := \ |
| 86 | libLLVMMipsInfo \ |
Shih-wei Liao | 71e85b7 | 2012-05-11 01:36:53 -0700 | [diff] [blame] | 87 | libLLVMMipsDisassembler \ |
Shih-wei Liao | 6e41d42 | 2012-03-26 23:43:02 -0700 | [diff] [blame] | 88 | libLLVMMipsCodeGen \ |
| 89 | libLLVMMipsDesc \ |
Shih-wei Liao | 71e85b7 | 2012-05-11 01:36:53 -0700 | [diff] [blame] | 90 | libLLVMMipsAsmParser \ |
Logan Chien | 0faf82f | 2012-03-27 15:12:48 +0800 | [diff] [blame] | 91 | libLLVMMipsAsmPrinter |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 92 | |
| 93 | libart_compiler_llvm_x86_STATIC_LIBRARIES := \ |
| 94 | libLLVMX86Info \ |
| 95 | libLLVMX86AsmParser \ |
| 96 | libLLVMX86CodeGen \ |
| 97 | libLLVMX86Disassembler \ |
| 98 | libLLVMX86Desc \ |
| 99 | libLLVMX86AsmPrinter \ |
| 100 | libLLVMX86Utils |
| 101 | |
| 102 | ifeq ($$(art_target_or_host),target) |
| 103 | LOCAL_STATIC_LIBRARIES += \ |
Shih-wei Liao | 024cf66 | 2012-05-28 15:01:28 -0700 | [diff] [blame] | 104 | $$(libart_compiler_llvm_$(TARGET_ARCH)_STATIC_LIBRARIES) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 105 | else |
| 106 | LOCAL_STATIC_LIBRARIES += \ |
| 107 | $$(libart_compiler_llvm_arm_STATIC_LIBRARIES) \ |
| 108 | $$(libart_compiler_llvm_mips_STATIC_LIBRARIES) \ |
| 109 | $$(libart_compiler_llvm_x86_STATIC_LIBRARIES) |
| 110 | endif |
| 111 | |
| 112 | LOCAL_STATIC_LIBRARIES += \ |
| 113 | libLLVMLinker \ |
| 114 | libLLVMipo \ |
| 115 | libLLVMBitWriter \ |
| 116 | libLLVMBitReader \ |
| 117 | libLLVMAsmPrinter \ |
| 118 | libLLVMSelectionDAG \ |
| 119 | libLLVMCodeGen \ |
Logan Chien | 0faf82f | 2012-03-27 15:12:48 +0800 | [diff] [blame] | 120 | libLLVMVectorize \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 121 | libLLVMScalarOpts \ |
| 122 | libLLVMInstCombine \ |
| 123 | libLLVMInstrumentation \ |
| 124 | libLLVMTransformUtils \ |
| 125 | libLLVMipa \ |
| 126 | libLLVMAnalysis \ |
| 127 | libLLVMTarget \ |
| 128 | libLLVMMC \ |
| 129 | libLLVMMCParser \ |
| 130 | libLLVMCore \ |
| 131 | libLLVMSupport \ |
| 132 | librsloader |
| 133 | LOCAL_SHARED_LIBRARIES := liblog libnativehelper |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame^] | 134 | LOCAL_SHARED_LIBRARIES += libcorkscrew # native stack trace support |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 135 | ifeq ($$(art_target_or_host),target) |
| 136 | LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl |
| 137 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations # tsan support |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 138 | else # host |
| 139 | LOCAL_STATIC_LIBRARIES += libcutils |
| 140 | LOCAL_SHARED_LIBRARIES += libz-host |
| 141 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations-host # tsan support |
| 142 | LOCAL_LDLIBS := -ldl -lpthread |
| 143 | ifeq ($(HOST_OS),linux) |
| 144 | LOCAL_LDLIBS += -lrt |
| 145 | endif |
| 146 | endif |
| 147 | ifeq ($$(art_ndebug_or_debug),debug) |
| 148 | ifeq ($$(art_target_or_host),target) |
| 149 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 150 | else # host |
| 151 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 152 | endif |
| 153 | LOCAL_SHARED_LIBRARIES += libartd |
| 154 | else |
| 155 | ifeq ($$(art_target_or_host),target) |
| 156 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 157 | else # host |
| 158 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 159 | endif |
| 160 | LOCAL_SHARED_LIBRARIES += libart |
| 161 | endif |
| 162 | ifeq ($$(art_target_or_host),target) |
| 163 | include $(LLVM_GEN_INTRINSICS_MK) |
| 164 | include $(LLVM_DEVICE_BUILD_MK) |
| 165 | include $(BUILD_SHARED_LIBRARY) |
| 166 | else # host |
| 167 | LOCAL_IS_HOST_MODULE := true |
| 168 | include $(LLVM_GEN_INTRINSICS_MK) |
| 169 | include $(LLVM_HOST_BUILD_MK) |
| 170 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 171 | endif |
| 172 | |
| 173 | ifeq ($$(art_target_or_host),target) |
| 174 | ifeq ($$(art_ndebug_or_debug),debug) |
| 175 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 176 | else |
| 177 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 178 | endif |
| 179 | else # host |
| 180 | ifeq ($$(art_ndebug_or_debug),debug) |
| 181 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 182 | else |
| 183 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 184 | endif |
| 185 | endif |
| 186 | |
| 187 | endef |
| 188 | |
| 189 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 190 | $(eval $(call build-libart-compiler-llvm,target,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 191 | endif |
| 192 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 193 | $(eval $(call build-libart-compiler-llvm,target,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 194 | endif |
| 195 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 196 | $(eval $(call build-libart-compiler-llvm,host,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 197 | endif |
| 198 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 199 | $(eval $(call build-libart-compiler-llvm,host,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 200 | endif |