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