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 | |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 17 | LIBART_COMPILER_SRC_FILES += \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 18 | src/compiler/dataflow.cc \ |
| 19 | src/compiler/frontend.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 20 | src/compiler/ralloc.cc \ |
buzbee | 2502e00 | 2012-12-31 16:05:53 -0800 | [diff] [blame^] | 21 | src/compiler/bb_opt.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 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 \ |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 29 | src/compiler/codegen/mir_to_gbc.cc \ |
| 30 | src/compiler/codegen/mir_to_lir.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 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 \ |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 38 | src/greenland/intrinsic_helper.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 39 | src/compiler/codegen/arm/target_arm.cc \ |
| 40 | src/compiler/codegen/arm/assemble_arm.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 41 | src/compiler/codegen/arm/utility_arm.cc \ |
| 42 | src/compiler/codegen/arm/call_arm.cc \ |
| 43 | src/compiler/codegen/arm/fp_arm.cc \ |
| 44 | src/compiler/codegen/arm/int_arm.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 45 | src/compiler/codegen/mips/target_mips.cc \ |
| 46 | src/compiler/codegen/mips/assemble_mips.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 47 | src/compiler/codegen/mips/utility_mips.cc \ |
| 48 | src/compiler/codegen/mips/call_mips.cc \ |
| 49 | src/compiler/codegen/mips/fp_mips.cc \ |
| 50 | src/compiler/codegen/mips/int_mips.cc \ |
buzbee | efc6369 | 2012-11-14 16:31:52 -0800 | [diff] [blame] | 51 | src/compiler/codegen/x86/target_x86.cc \ |
| 52 | src/compiler/codegen/x86/assemble_x86.cc \ |
buzbee | 1bc37c6 | 2012-11-20 13:35:41 -0800 | [diff] [blame] | 53 | src/compiler/codegen/x86/utility_x86.cc \ |
| 54 | src/compiler/codegen/x86/call_x86.cc \ |
| 55 | src/compiler/codegen/x86/fp_x86.cc \ |
| 56 | src/compiler/codegen/x86/int_x86.cc \ |
buzbee | 02031b1 | 2012-11-23 09:41:35 -0800 | [diff] [blame] | 57 | src/oat/jni/arm/jni_internal_arm.cc \ |
| 58 | src/oat/jni/mips/jni_internal_mips.cc \ |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 59 | src/oat/jni/x86/jni_internal_x86.cc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 60 | |
| 61 | # $(1): target or host |
| 62 | # $(2): ndebug or debug |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 63 | define build-libart-compiler |
| 64 | ifneq ($(1),target) |
| 65 | ifneq ($(1),host) |
| 66 | $$(error expected target or host for argument 1, received $(1)) |
| 67 | endif |
| 68 | endif |
| 69 | ifneq ($(2),ndebug) |
| 70 | ifneq ($(2),debug) |
| 71 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 72 | endif |
| 73 | endif |
| 74 | |
| 75 | art_target_or_host := $(1) |
| 76 | art_ndebug_or_debug := $(2) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 77 | |
| 78 | include $(CLEAR_VARS) |
| 79 | ifeq ($$(art_target_or_host),target) |
| 80 | include external/stlport/libstlport.mk |
| 81 | endif |
| 82 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 83 | ifeq ($$(art_ndebug_or_debug),ndebug) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 84 | LOCAL_MODULE := libart-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 85 | else # debug |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 86 | LOCAL_MODULE := libartd-compiler |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 87 | endif |
| 88 | |
| 89 | LOCAL_MODULE_TAGS := optional |
| 90 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 91 | |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 92 | LOCAL_SRC_FILES := $$(LIBART_COMPILER_SRC_FILES) |
Brian Carlstrom | 5644f00 | 2012-06-27 23:05:17 -0700 | [diff] [blame] | 93 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 94 | ifeq ($$(art_target_or_host),target) |
| 95 | LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) |
| 96 | else # host |
| 97 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) |
| 98 | endif |
Elliott Hughes | 1bac54f | 2012-03-16 12:48:31 -0700 | [diff] [blame] | 99 | |
| 100 | # TODO: clean up the compilers and remove this. |
| 101 | LOCAL_CFLAGS += -Wno-unused-parameter |
| 102 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 103 | LOCAL_SHARED_LIBRARIES := liblog |
| 104 | ifeq ($$(art_ndebug_or_debug),debug) |
| 105 | ifeq ($$(art_target_or_host),target) |
| 106 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 107 | else # host |
| 108 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 109 | endif |
| 110 | LOCAL_SHARED_LIBRARIES += libartd |
| 111 | else |
| 112 | ifeq ($$(art_target_or_host),target) |
| 113 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 114 | else # host |
| 115 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 116 | endif |
| 117 | LOCAL_SHARED_LIBRARIES += libart |
| 118 | endif |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 119 | LOCAL_SHARED_LIBRARIES += libbcc |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 120 | |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 121 | ifeq ($(ART_USE_PORTABLE_COMPILER),true) |
| 122 | ART_TEST_CFLAGS += -DART_USE_PORTABLE_COMPILER=1 |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 123 | endif |
| 124 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 125 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
buzbee | 2cfc639 | 2012-05-07 14:51:40 -0700 | [diff] [blame] | 126 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 127 | ifeq ($$(art_target_or_host),target) |
| 128 | LOCAL_SHARED_LIBRARIES += libstlport |
| 129 | else # host |
| 130 | LOCAL_LDLIBS := -ldl -lpthread |
| 131 | endif |
| 132 | ifeq ($$(art_target_or_host),target) |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 133 | LOCAL_SHARED_LIBRARIES += libcutils |
| 134 | include $(LLVM_GEN_INTRINSICS_MK) |
| 135 | include $(LLVM_DEVICE_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 136 | include $(BUILD_SHARED_LIBRARY) |
| 137 | else # host |
| 138 | LOCAL_IS_HOST_MODULE := true |
buzbee | c531cef | 2012-10-18 07:09:20 -0700 | [diff] [blame] | 139 | LOCAL_STATIC_LIBRARIES += libcutils |
| 140 | include $(LLVM_GEN_INTRINSICS_MK) |
| 141 | include $(LLVM_HOST_BUILD_MK) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 142 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 143 | endif |
Brian Carlstrom | 73666be | 2012-03-10 20:25:10 -0800 | [diff] [blame] | 144 | |
| 145 | ifeq ($$(art_target_or_host),target) |
| 146 | ifeq ($$(art_ndebug_or_debug),debug) |
| 147 | $(TARGET_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 148 | else |
| 149 | $(TARGET_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 150 | endif |
| 151 | else # host |
| 152 | ifeq ($$(art_ndebug_or_debug),debug) |
| 153 | $(HOST_OUT_EXECUTABLES)/dex2oatd: $$(LOCAL_INSTALLED_MODULE) |
| 154 | else |
| 155 | $(HOST_OUT_EXECUTABLES)/dex2oat: $$(LOCAL_INSTALLED_MODULE) |
| 156 | endif |
| 157 | endif |
| 158 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 159 | endef |
| 160 | |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 161 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 162 | $(eval $(call build-libart-compiler,target,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 163 | endif |
| 164 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 165 | $(eval $(call build-libart-compiler,target,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 166 | endif |
| 167 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 168 | $(eval $(call build-libart-compiler,host,ndebug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 169 | endif |
| 170 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
buzbee | 8c4bbb5 | 2012-11-26 14:00:58 -0800 | [diff] [blame] | 171 | $(eval $(call build-libart-compiler,host,debug)) |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 172 | endif |