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