Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -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 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | include art/build/Android.common.mk |
| 20 | |
| 21 | LIBART_DISASSEMBLER_SRC_FILES := \ |
| 22 | disassembler.cc \ |
| 23 | disassembler_arm.cc \ |
Serban Constantinescu | e6622be | 2014-02-27 15:36:47 +0000 | [diff] [blame] | 24 | disassembler_arm64.cc \ |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 25 | disassembler_mips.cc \ |
| 26 | disassembler_x86.cc |
| 27 | |
| 28 | # $(1): target or host |
| 29 | # $(2): ndebug or debug |
| 30 | define build-libart-disassembler |
| 31 | ifneq ($(1),target) |
| 32 | ifneq ($(1),host) |
| 33 | $$(error expected target or host for argument 1, received $(1)) |
| 34 | endif |
| 35 | endif |
| 36 | ifneq ($(2),ndebug) |
| 37 | ifneq ($(2),debug) |
| 38 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 39 | endif |
| 40 | endif |
| 41 | |
| 42 | art_target_or_host := $(1) |
| 43 | art_ndebug_or_debug := $(2) |
| 44 | |
| 45 | include $(CLEAR_VARS) |
| 46 | ifeq ($$(art_target_or_host),target) |
| 47 | include external/stlport/libstlport.mk |
| 48 | else |
| 49 | LOCAL_IS_HOST_MODULE := true |
| 50 | endif |
| 51 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 52 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 53 | LOCAL_MODULE := libart-disassembler |
| 54 | else # debug |
| 55 | LOCAL_MODULE := libartd-disassembler |
| 56 | endif |
| 57 | |
| 58 | LOCAL_MODULE_TAGS := optional |
| 59 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 60 | |
| 61 | LOCAL_SRC_FILES := $$(LIBART_DISASSEMBLER_SRC_FILES) |
| 62 | |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 63 | ifeq ($$(art_target_or_host),target) |
| 64 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
| 65 | LOCAL_CFLAGS += $(ART_TARGET_CFLAGS) |
| 66 | else # host |
| 67 | LOCAL_CLANG := $(ART_HOST_CLANG) |
| 68 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
| 69 | endif |
| 70 | |
| 71 | LOCAL_SHARED_LIBRARIES += liblog |
| 72 | ifeq ($$(art_ndebug_or_debug),debug) |
| 73 | ifeq ($$(art_target_or_host),target) |
| 74 | LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS) |
| 75 | else # host |
| 76 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 77 | endif |
| 78 | LOCAL_SHARED_LIBRARIES += libartd |
| 79 | else |
| 80 | ifeq ($$(art_target_or_host),target) |
| 81 | LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS) |
| 82 | else # host |
| 83 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 84 | endif |
| 85 | LOCAL_SHARED_LIBRARIES += libart |
| 86 | endif |
| 87 | |
| 88 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
| 89 | |
| 90 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common.mk |
| 91 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk |
| 92 | ifeq ($$(art_target_or_host),target) |
Serban Constantinescu | e6622be | 2014-02-27 15:36:47 +0000 | [diff] [blame] | 93 | LOCAL_SHARED_LIBRARIES += libcutils libvixl |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 94 | include $(BUILD_SHARED_LIBRARY) |
| 95 | else # host |
Serban Constantinescu | e6622be | 2014-02-27 15:36:47 +0000 | [diff] [blame] | 96 | LOCAL_STATIC_LIBRARIES += libcutils libvixl |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 97 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 98 | endif |
| 99 | endef |
| 100 | |
| 101 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
| 102 | $(eval $(call build-libart-disassembler,target,ndebug)) |
| 103 | endif |
| 104 | ifeq ($(ART_BUILD_TARGET_DEBUG),true) |
| 105 | $(eval $(call build-libart-disassembler,target,debug)) |
| 106 | endif |
| 107 | ifeq ($(WITH_HOST_DALVIK),true) |
| 108 | # We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target. |
| 109 | ifeq ($(ART_BUILD_NDEBUG),true) |
| 110 | $(eval $(call build-libart-disassembler,host,ndebug)) |
| 111 | endif |
| 112 | ifeq ($(ART_BUILD_DEBUG),true) |
| 113 | $(eval $(call build-libart-disassembler,host,debug)) |
| 114 | endif |
| 115 | endif |