Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -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 | LIBART_COMPILER_COMMON_SRC_FILES += \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 18 | src/compiler/dataflow.cc \ |
| 19 | src/compiler/frontend.cc \ |
| 20 | src/compiler/intermediate_rep.cc \ |
| 21 | src/compiler/ralloc.cc \ |
| 22 | src/compiler/ssa_transformation.cc \ |
buzbee | eaf09bc | 2012-11-15 14:51:41 -0800 | [diff] [blame] | 23 | src/compiler/compiler_utility.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 24 | src/compiler/codegen/ralloc_util.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 25 | src/compiler/codegen/codegen_util.cc \ |
| 26 | src/compiler/codegen/gen_loadstore.cc \ |
| 27 | src/compiler/codegen/gen_common.cc \ |
| 28 | src/compiler/codegen/gen_invoke.cc \ |
| 29 | src/compiler/codegen/method_bitcode.cc \ |
| 30 | src/compiler/codegen/method_codegen_driver.cc \ |
| 31 | src/compiler/codegen/local_optimizations.cc \ |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 32 | src/oat/jni/calling_convention.cc \ |
| 33 | src/oat/jni/jni_compiler.cc \ |
| 34 | src/oat/jni/arm/calling_convention_arm.cc \ |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 35 | src/oat/jni/mips/calling_convention_mips.cc \ |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 36 | src/oat/jni/x86/calling_convention_x86.cc \ |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 37 | src/greenland/ir_builder.cc \ |
| 38 | src/greenland/intrinsic_helper.cc |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 39 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 40 | LIBART_COMPILER_arm_SRC_FILES += \ |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 41 | $(LIBART_COMPILER_COMMON_SRC_FILES) \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 42 | src/compiler/codegen/arm/target_arm.cc \ |
| 43 | src/compiler/codegen/arm/assemble_arm.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 44 | src/compiler/codegen/arm/utility_arm.cc \ |
| 45 | src/compiler/codegen/arm/call_arm.cc \ |
| 46 | src/compiler/codegen/arm/fp_arm.cc \ |
| 47 | src/compiler/codegen/arm/int_arm.cc \ |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 48 | src/oat/jni/arm/jni_internal_arm.cc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 49 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 50 | LIBART_COMPILER_mips_SRC_FILES += \ |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 51 | $(LIBART_COMPILER_COMMON_SRC_FILES) \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 52 | src/compiler/codegen/mips/target_mips.cc \ |
| 53 | src/compiler/codegen/mips/assemble_mips.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 54 | src/compiler/codegen/mips/utility_mips.cc \ |
| 55 | src/compiler/codegen/mips/call_mips.cc \ |
| 56 | src/compiler/codegen/mips/fp_mips.cc \ |
| 57 | src/compiler/codegen/mips/int_mips.cc \ |
jeffhao | 7fbee07 | 2012-08-24 17:56:54 -0700 | [diff] [blame] | 58 | src/oat/jni/mips/jni_internal_mips.cc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 59 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 60 | LIBART_COMPILER_x86_SRC_FILES += \ |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 61 | $(LIBART_COMPILER_COMMON_SRC_FILES) \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 62 | src/compiler/codegen/x86/target_x86.cc \ |
| 63 | src/compiler/codegen/x86/assemble_x86.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 64 | src/compiler/codegen/x86/utility_x86.cc \ |
| 65 | src/compiler/codegen/x86/call_x86.cc \ |
| 66 | src/compiler/codegen/x86/fp_x86.cc \ |
| 67 | src/compiler/codegen/x86/int_x86.cc \ |
Ian Rogers | 57b86d4 | 2012-03-27 16:05:41 -0700 | [diff] [blame] | 68 | src/oat/jni/x86/jni_internal_x86.cc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 69 | |
| 70 | # $(1): target or host |
| 71 | # $(2): ndebug or debug |
| 72 | # $(3): architecture name |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 73 | define build-libart-compiler |
| 74 | ifneq ($(1),target) |
| 75 | ifneq ($(1),host) |
| 76 | $$(error expected target or host for argument 1, received $(1)) |
| 77 | endif |
| 78 | endif |
| 79 | ifneq ($(2),ndebug) |
| 80 | ifneq ($(2),debug) |
| 81 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 82 | endif |
| 83 | endif |
| 84 | |
| 85 | art_target_or_host := $(1) |
| 86 | art_ndebug_or_debug := $(2) |
| 87 | libart_compiler_arch := $(3) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 88 | |
| 89 | include $(CLEAR_VARS) |
| 90 | ifeq ($$(art_target_or_host),target) |
| 91 | include external/stlport/libstlport.mk |
| 92 | endif |
| 93 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 94 | ifeq ($$(art_ndebug_or_debug),ndebug) |
Elliott Hughes | ceeea7d | 2012-04-10 11:35:08 -0700 | [diff] [blame] | 95 | LOCAL_MODULE := libart-compiler-$$(libart_compiler_arch) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 96 | else # debug |
Elliott Hughes | ceeea7d | 2012-04-10 11:35:08 -0700 | [diff] [blame] | 97 | LOCAL_MODULE := libartd-compiler-$$(libart_compiler_arch) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 98 | endif |
| 99 | |
| 100 | LOCAL_MODULE_TAGS := optional |
| 101 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 102 | |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 103 | LOCAL_SRC_FILES := $$(LIBART_COMPILER_$$(libart_compiler_arch)_SRC_FILES) |
| 104 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 105 | ifeq ($$(art_target_or_host),target) |
| 106 | LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) |
| 107 | else # host |
| 108 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) |
| 109 | endif |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 110 | |
| 111 | # TODO: clean up the compilers and remove this. |
| 112 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 113 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 114 | LOCAL_SHARED_LIBRARIES := liblog |
| 115 | ifeq ($$(art_ndebug_or_debug),debug) |
| 116 | ifeq ($$(art_target_or_host),target) |
| 117 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 118 | else # host |
| 119 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 120 | endif |
| 121 | LOCAL_SHARED_LIBRARIES += libartd |
| 122 | else |
| 123 | ifeq ($$(art_target_or_host),target) |
| 124 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 125 | else # host |
| 126 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 127 | endif |
| 128 | LOCAL_SHARED_LIBRARIES += libart |
| 129 | endif |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 130 | LOCAL_SHARED_LIBRARIES += libbcc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 131 | |
| 132 | # TODO: temporary hack for testing. |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 133 | ifeq ($$(libart_compiler_arch),mips) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 134 | LOCAL_CFLAGS += -D__mips_hard_float |
| 135 | endif |
| 136 | |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 137 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
| 138 | ART_TEST_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 139 | endif |
| 140 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 141 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 142 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 143 | ifeq ($$(art_target_or_host),target) |
| 144 | LOCAL_SHARED_LIBRARIES += libstlport |
| 145 | else # host |
| 146 | LOCAL_LDLIBS := -ldl -lpthread |
| 147 | endif |
| 148 | ifeq ($$(art_target_or_host),target) |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 149 | LOCAL_SHARED_LIBRARIES += libcutils |
| 150 | include $(LLVM_GEN_INTRINSICS_MK) |
| 151 | include $(LLVM_DEVICE_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 152 | include $(BUILD_SHARED_LIBRARY) |
| 153 | else # host |
| 154 | LOCAL_IS_HOST_MODULE := true |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 155 | LOCAL_STATIC_LIBRARIES += libcutils |
| 156 | include $(LLVM_GEN_INTRINSICS_MK) |
| 157 | include $(LLVM_HOST_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 158 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 159 | endif |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 160 | |
| 161 | ifeq ($$(art_target_or_host),target) |
| 162 | ifeq ($$(art_ndebug_or_debug),debug) |
| 163 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 164 | else |
| 165 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 166 | endif |
| 167 | else # host |
| 168 | ifeq ($$(art_ndebug_or_debug),debug) |
| 169 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 170 | else |
| 171 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 172 | endif |
| 173 | endif |
| 174 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 175 | endef |
| 176 | |
| 177 | # $(1): target or host |
| 178 | # $(2): ndebug or debug |
| 179 | define build-libart-compilers |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 180 | $(foreach arch,arm mips x86,$(eval $(call build-libart-compiler,$(1),$(2),$(arch)))) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 181 | endef |
| 182 | |
| 183 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 184 | $(eval $(call build-libart-compiler,target,ndebug,$(TARGET_ARCH))) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 185 | endif |
| 186 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 187 | $(eval $(call build-libart-compiler,target,debug,$(TARGET_ARCH))) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 188 | endif |
| 189 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
| 190 | $(eval $(call build-libart-compilers,host,ndebug)) |
| 191 | endif |
| 192 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
| 193 | $(eval $(call build-libart-compilers,host,debug)) |
| 194 | endif |