Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [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_GREENLAND_CFLAGS := -DART_USE_GREENLAND_COMPILER=1 |
| 19 | |
| 20 | LIBART_COMPILER_GREENLAND_SRC_FILES += \ |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 21 | src/compiler_llvm/inferred_reg_category_map.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 22 | src/greenland/dalvik_reg.cc \ |
| 23 | src/greenland/dex_lang.cc \ |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 24 | src/greenland/gbc_context.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 25 | src/greenland/greenland.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 26 | src/greenland/intrinsic_helper.cc \ |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 27 | src/greenland/register_allocator.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 28 | src/greenland/target_codegen_machine.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 29 | src/greenland/target_registry.cc \ |
| 30 | src/oat/jni/calling_convention.cc \ |
| 31 | src/oat/jni/jni_compiler.cc \ |
| 32 | src/oat/jni/arm/calling_convention_arm.cc \ |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 33 | src/oat/jni/mips/calling_convention_mips.cc \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 34 | src/oat/jni/x86/calling_convention_x86.cc |
| 35 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 36 | LIBART_COMPILER_GREENLAND_arm_SRC_FILES += \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 37 | src/greenland/arm/arm_codegen_machine.cc \ |
| 38 | src/greenland/arm/arm_invoke_stub_compiler.cc |
| 39 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 40 | LIBART_COMPILER_GREENLAND_mips_SRC_FILES += \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 41 | src/greenland/mips/mips_codegen_machine.cc \ |
| 42 | src/greenland/mips/mips_invoke_stub_compiler.cc |
| 43 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 44 | LIBART_COMPILER_GREENLAND_x86_SRC_FILES += \ |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 45 | src/greenland/x86/x86_codegen_machine.cc \ |
| 46 | src/greenland/x86/x86_lir_emitter.cc \ |
| 47 | src/greenland/x86/x86_lir_info.cc \ |
| 48 | src/greenland/x86/x86_invoke_stub_compiler.cc |
| 49 | |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 50 | ######################################################################## |
| 51 | |
| 52 | include $(CLEAR_VARS) |
| 53 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 54 | LOCAL_MODULE := target_lir_builder_generator |
| 55 | LOCAL_MODULE_TAGS := optional |
| 56 | LOCAL_IS_HOST_MODULE := true |
| 57 | LOCAL_SRC_FILES := src/greenland/tools/target_lir_builder_generator.cc |
| 58 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
| 59 | LOCAL_C_INCLUDES := $(ART_C_INCLUDES) |
| 60 | include $(BUILD_HOST_EXECUTABLE) |
| 61 | TARGET_LIR_BUILDER_GENERATOR := $(LOCAL_BUILT_MODULE) |
| 62 | |
| 63 | ######################################################################## |
| 64 | |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 65 | # $(1): target or host |
| 66 | # $(2): ndebug or debug |
| 67 | define build-libart-compiler-greenland |
| 68 | ifneq ($(1),target) |
| 69 | ifneq ($(1),host) |
| 70 | $$(error expected target or host for argument 1, received $(1)) |
| 71 | endif |
| 72 | endif |
| 73 | ifneq ($(2),ndebug) |
| 74 | ifneq ($(2),debug) |
| 75 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 76 | endif |
| 77 | endif |
| 78 | |
| 79 | art_target_or_host := $(1) |
| 80 | art_ndebug_or_debug := $(2) |
| 81 | |
| 82 | include $(CLEAR_VARS) |
| 83 | ifeq ($$(art_target_or_host),target) |
| 84 | include external/stlport/libstlport.mk |
| 85 | endif |
| 86 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 87 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 88 | LOCAL_MODULE := libart-compiler-greenland |
| 89 | else # debug |
| 90 | LOCAL_MODULE := libartd-compiler-greenland |
| 91 | endif |
| 92 | |
| 93 | LOCAL_MODULE_TAGS := optional |
| 94 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 95 | |
| 96 | LOCAL_SRC_FILES := $(LIBART_COMPILER_GREENLAND_SRC_FILES) |
| 97 | LOCAL_CFLAGS := $(LIBART_COMPILER_GREENLAND_CFLAGS) |
| 98 | ifeq ($$(art_target_or_host),target) |
| 99 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 100 | else # host |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 101 | LOCAL_IS_HOST_MODULE := true |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 102 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
| 103 | endif |
| 104 | |
| 105 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
| 106 | |
| 107 | ifeq ($$(art_target_or_host),target) |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 108 | ENUM_INCLUDE_LIR_TARGETS := arm |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 109 | LOCAL_SRC_FILES += \ |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 110 | $(LIBART_COMPILER_GREENLAND_$(TARGET_ARCH)_SRC_FILES) |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 111 | else |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 112 | ENUM_INCLUDE_LIR_TARGETS := arm mips x86 |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 113 | LOCAL_SRC_FILES += \ |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 114 | $(LIBART_COMPILER_GREENLAND_arm_SRC_FILES) \ |
| 115 | $(LIBART_COMPILER_GREENLAND_mips_SRC_FILES) \ |
| 116 | $(LIBART_COMPILER_GREENLAND_x86_SRC_FILES) |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 117 | endif |
| 118 | |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 119 | GENERATED_SRC_DIR := $$(call intermediates-dir-for,$$(LOCAL_MODULE_CLASS),$$(LOCAL_MODULE),$$(LOCAL_IS_HOST_MODULE),) |
| 120 | ENUM_TARGEET_LIR_BUILDER_INC_FILES := $$(foreach lir_target, $$(ENUM_INCLUDE_LIR_TARGETS), $$(lir_target)_lir_builder_base.inc) |
| 121 | ENUM_TARGET_LIR_BUILDER_OUT_GEN := $$(addprefix $$(GENERATED_SRC_DIR)/, $$(ENUM_TARGEET_LIR_BUILDER_INC_FILES)) |
| 122 | |
| 123 | $$(ENUM_TARGET_LIR_BUILDER_OUT_GEN): PRIVATE_LIR_TARGET = $$(subst _lir_builder_base.inc,,$$(notdir $$@)) |
| 124 | $$(ENUM_TARGET_LIR_BUILDER_OUT_GEN): %.inc : $$(TARGET_LIR_BUILDER_GENERATOR) |
| 125 | @echo "target Generated: $$@" |
| 126 | $$(hide) $$(TARGET_LIR_BUILDER_GENERATOR) $$(PRIVATE_LIR_TARGET) > $$@ |
| 127 | |
| 128 | LOCAL_GENERATED_SOURCES += $$(ENUM_TARGET_LIR_BUILDER_OUT_GEN) |
| 129 | |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 130 | LOCAL_STATIC_LIBRARIES += \ |
| 131 | libLLVMBitWriter \ |
| 132 | libLLVMBitReader \ |
| 133 | libLLVMScalarOpts \ |
| 134 | libLLVMInstCombine \ |
| 135 | libLLVMTransformUtils \ |
| 136 | libLLVMAnalysis \ |
| 137 | libLLVMTarget \ |
| 138 | libLLVMCore \ |
| 139 | libLLVMSupport |
| 140 | LOCAL_SHARED_LIBRARIES := liblog libnativehelper |
| 141 | ifeq ($$(art_target_or_host),target) |
| 142 | LOCAL_SHARED_LIBRARIES += libcutils libstlport libz libdl |
| 143 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations # tsan support |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 144 | LOCAL_SHARED_LIBRARIES += libcorkscrew # native stack trace support |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 145 | else # host |
| 146 | LOCAL_STATIC_LIBRARIES += libcutils |
| 147 | LOCAL_SHARED_LIBRARIES += libz-host |
| 148 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations-host # tsan support |
| 149 | LOCAL_LDLIBS := -ldl -lpthread |
| 150 | ifeq ($(HOST_OS),linux) |
| 151 | LOCAL_LDLIBS += -lrt |
| 152 | endif |
| 153 | endif |
| 154 | ifeq ($$(art_ndebug_or_debug),debug) |
| 155 | ifeq ($$(art_target_or_host),target) |
| 156 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 157 | else # host |
| 158 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 159 | endif |
| 160 | LOCAL_SHARED_LIBRARIES += libartd |
| 161 | else |
| 162 | ifeq ($$(art_target_or_host),target) |
| 163 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 164 | else # host |
| 165 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 166 | endif |
| 167 | LOCAL_SHARED_LIBRARIES += libart |
| 168 | endif |
| 169 | ifeq ($$(art_target_or_host),target) |
| 170 | include $(LLVM_GEN_INTRINSICS_MK) |
| 171 | include $(LLVM_DEVICE_BUILD_MK) |
| 172 | include $(BUILD_SHARED_LIBRARY) |
| 173 | else # host |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 174 | include $(LLVM_GEN_INTRINSICS_MK) |
| 175 | include $(LLVM_HOST_BUILD_MK) |
| 176 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 177 | endif |
| 178 | |
| 179 | ifeq ($$(art_target_or_host),target) |
| 180 | ifeq ($$(art_ndebug_or_debug),debug) |
| 181 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 182 | else |
| 183 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 184 | endif |
| 185 | else # host |
| 186 | ifeq ($$(art_ndebug_or_debug),debug) |
| 187 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 188 | else |
| 189 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 190 | endif |
| 191 | endif |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 192 | endef |
| 193 | |
Shih-wei Liao | 21d28f5 | 2012-06-12 05:55:00 -0700 | [diff] [blame^] | 194 | |
Shih-wei Liao | e94d9b2 | 2012-05-22 09:01:24 -0700 | [diff] [blame] | 195 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 196 | $(eval $(call build-libart-compiler-greenland,target,ndebug)) |
| 197 | endif |
| 198 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 199 | $(eval $(call build-libart-compiler-greenland,target,debug)) |
| 200 | endif |
| 201 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
| 202 | $(eval $(call build-libart-compiler-greenland,host,ndebug)) |
| 203 | endif |
| 204 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
| 205 | $(eval $(call build-libart-compiler-greenland,host,debug)) |
| 206 | endif |