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 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | include art/build/Android.common_build.mk |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 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 \ |
Andreas Gampe | 57b3429 | 2015-01-14 15:45:59 -0800 | [diff] [blame] | 26 | disassembler_mips64.cc \ |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 27 | disassembler_x86.cc |
| 28 | |
| 29 | # $(1): target or host |
| 30 | # $(2): ndebug or debug |
| 31 | define build-libart-disassembler |
| 32 | ifneq ($(1),target) |
| 33 | ifneq ($(1),host) |
| 34 | $$(error expected target or host for argument 1, received $(1)) |
| 35 | endif |
| 36 | endif |
| 37 | ifneq ($(2),ndebug) |
| 38 | ifneq ($(2),debug) |
| 39 | $$(error expected ndebug or debug for argument 2, received $(2)) |
| 40 | endif |
| 41 | endif |
| 42 | |
| 43 | art_target_or_host := $(1) |
| 44 | art_ndebug_or_debug := $(2) |
| 45 | |
| 46 | include $(CLEAR_VARS) |
Ian Rogers | bd5ea6a | 2014-04-16 16:34:44 -0700 | [diff] [blame] | 47 | ifeq ($$(art_target_or_host),host) |
| 48 | LOCAL_IS_HOST_MODULE := true |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 49 | endif |
| 50 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 51 | ifeq ($$(art_ndebug_or_debug),ndebug) |
| 52 | LOCAL_MODULE := libart-disassembler |
| 53 | else # debug |
| 54 | LOCAL_MODULE := libartd-disassembler |
| 55 | endif |
| 56 | |
| 57 | LOCAL_MODULE_TAGS := optional |
| 58 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 59 | |
| 60 | LOCAL_SRC_FILES := $$(LIBART_DISASSEMBLER_SRC_FILES) |
| 61 | |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 62 | ifeq ($$(art_target_or_host),target) |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 63 | $(call set-target-local-clang-vars) |
| 64 | $(call set-target-local-cflags-vars,$(2)) |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 65 | else # host |
| 66 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 67 | LOCAL_LDLIBS := $(ART_HOST_LDLIBS) |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 68 | LOCAL_CFLAGS += $(ART_HOST_CFLAGS) |
Andreas Gampe | 5ca4eaa | 2014-05-29 02:09:33 -0700 | [diff] [blame] | 69 | ifeq ($$(art_ndebug_or_debug),debug) |
| 70 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 71 | else |
| 72 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 73 | endif |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 74 | endif |
| 75 | |
| 76 | LOCAL_SHARED_LIBRARIES += liblog |
| 77 | ifeq ($$(art_ndebug_or_debug),debug) |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 78 | LOCAL_SHARED_LIBRARIES += libartd |
| 79 | else |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 80 | LOCAL_SHARED_LIBRARIES += libart |
| 81 | endif |
| 82 | |
| 83 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
| 84 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 85 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 86 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk |
Dan Albert | 31fb260 | 2014-09-30 22:10:10 -0700 | [diff] [blame] | 87 | LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE) |
Ian Rogers | 872dd82 | 2014-10-30 11:19:14 -0700 | [diff] [blame] | 88 | # For disassembler_arm64. |
Serban Constantinescu | 32f5b4d | 2014-11-25 20:05:46 +0000 | [diff] [blame] | 89 | ifeq ($$(art_ndebug_or_debug),debug) |
| 90 | LOCAL_SHARED_LIBRARIES += libvixld |
| 91 | else |
| 92 | LOCAL_SHARED_LIBRARIES += libvixl |
| 93 | endif |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 94 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 95 | include $(BUILD_SHARED_LIBRARY) |
| 96 | else # host |
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 |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 107 | # We always build dex2oat and dependencies, even if the host build is otherwise disabled, since they are used to cross compile for the target. |
Junmo Park | 76ab347 | 2014-08-11 21:28:16 +0900 | [diff] [blame] | 108 | ifeq ($(ART_BUILD_HOST_NDEBUG),true) |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 109 | $(eval $(call build-libart-disassembler,host,ndebug)) |
| 110 | endif |
Junmo Park | 76ab347 | 2014-08-11 21:28:16 +0900 | [diff] [blame] | 111 | ifeq ($(ART_BUILD_HOST_DEBUG),true) |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 112 | $(eval $(call build-libart-disassembler,host,debug)) |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 113 | endif |