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 | |
Shih-wei Liao | bb33f2f | 2012-08-23 13:20:00 -0700 | [diff] [blame] | 18 | LIBART_COMPILER_LLVM_CFLAGS := -DART_USE_LLVM_COMPILER |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 19 | ifeq ($(ART_USE_DEXLANG_FRONTEND),true) |
Shih-wei Liao | bb33f2f | 2012-08-23 13:20:00 -0700 | [diff] [blame] | 20 | LIBART_COMPILER_LLVM_CFLAGS += -DART_USE_DEXLANG_FRONTEND |
| 21 | endif |
| 22 | ifeq ($(ART_USE_QUICK_COMPILER),true) |
| 23 | LIBART_COMPILER_LLVM_CFLAGS += -DART_USE_QUICK_COMPILER |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 24 | endif |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 25 | |
| 26 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 27 | src/compiler_llvm/compilation_unit.cc \ |
| 28 | src/compiler_llvm/compiler_llvm.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 29 | src/compiler_llvm/generated/art_module.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 30 | src/compiler_llvm/ir_builder.cc \ |
| 31 | src/compiler_llvm/jni_compiler.cc \ |
TDYa127 | 1f196f1 | 2012-07-11 20:50:22 -0700 | [diff] [blame] | 32 | src/compiler_llvm/md_builder.cc \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 33 | src/compiler_llvm/runtime_support_builder.cc \ |
| 34 | src/compiler_llvm/runtime_support_builder_arm.cc \ |
TDYa127 | b08ed12 | 2012-06-05 23:51:19 -0700 | [diff] [blame] | 35 | src/compiler_llvm/runtime_support_builder_thumb2.cc \ |
TDYa127 | d668a06 | 2012-04-13 12:36:57 -0700 | [diff] [blame] | 36 | src/compiler_llvm/runtime_support_builder_x86.cc \ |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 37 | src/compiler_llvm/runtime_support_llvm.cc \ |
TDYa127 | 89f9605 | 2012-07-12 20:49:53 -0700 | [diff] [blame] | 38 | src/compiler_llvm/stub_compiler.cc \ |
| 39 | src/greenland/inferred_reg_category_map.cc |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 40 | |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 41 | ifeq ($(ART_USE_DEXLANG_FRONTEND),true) |
| 42 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 43 | src/compiler_llvm/gbc_expander.cc \ |
| 44 | src/greenland/dalvik_reg.cc \ |
| 45 | src/greenland/dex_lang.cc \ |
| 46 | src/greenland/intrinsic_helper.cc \ |
| 47 | src/greenland/ir_builder.cc |
| 48 | else |
Shih-wei Liao | bb33f2f | 2012-08-23 13:20:00 -0700 | [diff] [blame] | 49 | ifeq ($(ART_USE_QUICK_COMPILER),true) |
| 50 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 51 | src/compiler/Dataflow.cc \ |
| 52 | src/compiler/Frontend.cc \ |
| 53 | src/compiler/IntermediateRep.cc \ |
| 54 | src/compiler/Ralloc.cc \ |
| 55 | src/compiler/SSATransformation.cc \ |
| 56 | src/compiler/Utility.cc \ |
| 57 | src/compiler/codegen/RallocUtil.cc \ |
| 58 | src/compiler/codegen/arm/ArchUtility.cc \ |
| 59 | src/compiler/codegen/arm/ArmRallocUtil.cc \ |
| 60 | src/compiler/codegen/arm/Assemble.cc \ |
| 61 | src/compiler/codegen/arm/armv7-a/Codegen.cc \ |
| 62 | src/compiler_llvm/dalvik_reg.cc \ |
| 63 | src/compiler_llvm/gbc_expander.cc \ |
| 64 | src/compiler_llvm/method_compiler.cc \ |
Shih-wei Liao | bb33f2f | 2012-08-23 13:20:00 -0700 | [diff] [blame] | 65 | src/greenland/intrinsic_helper.cc \ |
| 66 | src/greenland/ir_builder.cc |
| 67 | else |
| 68 | LIBART_COMPILER_LLVM_SRC_FILES += \ |
| 69 | src/compiler_llvm/dalvik_reg.cc \ |
| 70 | src/compiler_llvm/method_compiler.cc |
| 71 | endif |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame] | 72 | endif |
| 73 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 74 | # $(1): target or host |
| 75 | # $(2): ndebug or debug |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 76 | define build-libart-compiler-llvm |
| 77 | ifneq ($(1),target) |
| 78 | ifneq ($(1),host) |
| 79 | $$(error expected target or host for argument 1, received $(1)) |
| 80 | endif |
| 81 | endif |
| 82 | ifneq ($(2),ndebug) |
| 83 | ifneq ($(2),debug) |
| 84 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 85 | endif |
| 86 | endif |
| 87 | |
| 88 | art_target_or_host := $(1) |
| 89 | art_ndebug_or_debug := $(2) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 90 | |
| 91 | include $(CLEAR_VARS) |
| 92 | ifeq ($$(art_target_or_host),target) |
| 93 | include external/stlport/libstlport.mk |
| 94 | endif |
| 95 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 96 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 97 | LOCAL_MODULE := libart-compiler-llvm |
| 98 | else # debug |
| 99 | LOCAL_MODULE := libartd-compiler-llvm |
| 100 | endif |
| 101 | |
| 102 | LOCAL_MODULE_TAGS := optional |
| 103 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 104 | |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 105 | LOCAL_SRC_FILES := $(LIBART_COMPILER_LLVM_SRC_FILES) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 106 | LOCAL_CFLAGS := $(LIBART_COMPILER_LLVM_CFLAGS) |
| 107 | ifeq ($$(art_target_or_host),target) |
| 108 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 109 | else # host |
| 110 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
| 111 | endif |
| 112 | |
| 113 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
Logan Chien | 971bf3f | 2012-05-01 15:47:55 +0800 | [diff] [blame] | 114 | |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 115 | LOCAL_SHARED_LIBRARIES := liblog libnativehelper |
Elliott Hughes | 46e251b | 2012-05-22 15:10:45 -0700 | [diff] [blame] | 116 | LOCAL_SHARED_LIBRARIES += libcorkscrew # native stack trace support |
Shih-wei Liao | cdc6690 | 2012-07-22 16:45:37 -0700 | [diff] [blame] | 117 | LOCAL_SHARED_LIBRARIES += libbcc |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 118 | ifeq ($$(art_target_or_host),target) |
| 119 | LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl |
| 120 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations # tsan support |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 121 | else # host |
| 122 | LOCAL_STATIC_LIBRARIES += libcutils |
| 123 | LOCAL_SHARED_LIBRARIES += libz-host |
| 124 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations-host # tsan support |
| 125 | LOCAL_LDLIBS := -ldl -lpthread |
| 126 | ifeq ($(HOST_OS),linux) |
| 127 | LOCAL_LDLIBS += -lrt |
| 128 | endif |
| 129 | endif |
| 130 | ifeq ($$(art_ndebug_or_debug),debug) |
| 131 | ifeq ($$(art_target_or_host),target) |
| 132 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 133 | else # host |
| 134 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 135 | endif |
| 136 | LOCAL_SHARED_LIBRARIES += libartd |
| 137 | else |
| 138 | ifeq ($$(art_target_or_host),target) |
| 139 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 140 | else # host |
| 141 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 142 | endif |
| 143 | LOCAL_SHARED_LIBRARIES += libart |
| 144 | endif |
| 145 | ifeq ($$(art_target_or_host),target) |
| 146 | include $(LLVM_GEN_INTRINSICS_MK) |
| 147 | include $(LLVM_DEVICE_BUILD_MK) |
| 148 | include $(BUILD_SHARED_LIBRARY) |
| 149 | else # host |
| 150 | LOCAL_IS_HOST_MODULE := true |
| 151 | include $(LLVM_GEN_INTRINSICS_MK) |
| 152 | include $(LLVM_HOST_BUILD_MK) |
| 153 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 154 | endif |
| 155 | |
| 156 | ifeq ($$(art_target_or_host),target) |
| 157 | ifeq ($$(art_ndebug_or_debug),debug) |
| 158 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 159 | else |
| 160 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 161 | endif |
| 162 | else # host |
| 163 | ifeq ($$(art_ndebug_or_debug),debug) |
| 164 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 165 | else |
| 166 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 167 | endif |
| 168 | endif |
| 169 | |
| 170 | endef |
| 171 | |
| 172 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 173 | $(eval $(call build-libart-compiler-llvm,target,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 174 | endif |
| 175 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 176 | $(eval $(call build-libart-compiler-llvm,target,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 177 | endif |
| 178 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 179 | $(eval $(call build-libart-compiler-llvm,host,ndebug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 180 | endif |
| 181 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Shih-wei Liao | fa3c10c | 2012-04-11 13:44:35 -0700 | [diff] [blame] | 182 | $(eval $(call build-libart-compiler-llvm,host,debug)) |
Shih-wei Liao | c4c9881 | 2012-03-10 21:55:51 -0800 | [diff] [blame] | 183 | endif |