blob: 17828fd2e8893693b451a50d0c15a29596ec69cf [file] [log] [blame]
Ian Rogers02ed4c02013-09-06 13:10:04 -07001#
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
17LOCAL_PATH := $(call my-dir)
18
19include art/build/Android.common.mk
20
21LIBART_DISASSEMBLER_SRC_FILES := \
22 disassembler.cc \
23 disassembler_arm.cc \
Serban Constantinescue6622be2014-02-27 15:36:47 +000024 disassembler_arm64.cc \
Ian Rogers02ed4c02013-09-06 13:10:04 -070025 disassembler_mips.cc \
26 disassembler_x86.cc
27
28# $(1): target or host
29# $(2): ndebug or debug
30define 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)
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070046 ifeq ($$(art_target_or_host),host)
47 LOCAL_IS_HOST_MODULE := true
Ian Rogers02ed4c02013-09-06 13:10:04 -070048 endif
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070049 include art/build/Android.libcxx.mk
Ian Rogers02ed4c02013-09-06 13:10:04 -070050 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 Rogers02ed4c02013-09-06 13:10:04 -070062 ifeq ($$(art_target_or_host),target)
63 LOCAL_CLANG := $(ART_TARGET_CLANG)
64 LOCAL_CFLAGS += $(ART_TARGET_CFLAGS)
65 else # host
66 LOCAL_CLANG := $(ART_HOST_CLANG)
67 LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
68 endif
69
70 LOCAL_SHARED_LIBRARIES += liblog
71 ifeq ($$(art_ndebug_or_debug),debug)
72 ifeq ($$(art_target_or_host),target)
73 LOCAL_CFLAGS += $(ART_TARGET_DEBUG_CFLAGS)
74 else # host
75 LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS)
76 endif
77 LOCAL_SHARED_LIBRARIES += libartd
78 else
79 ifeq ($$(art_target_or_host),target)
80 LOCAL_CFLAGS += $(ART_TARGET_NON_DEBUG_CFLAGS)
81 else # host
82 LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS)
83 endif
84 LOCAL_SHARED_LIBRARIES += libart
85 endif
86
87 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
88
89 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common.mk
90 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
91 ifeq ($$(art_target_or_host),target)
Serban Constantinescue6622be2014-02-27 15:36:47 +000092 LOCAL_SHARED_LIBRARIES += libcutils libvixl
Ian Rogers02ed4c02013-09-06 13:10:04 -070093 include $(BUILD_SHARED_LIBRARY)
94 else # host
Serban Constantinescue6622be2014-02-27 15:36:47 +000095 LOCAL_STATIC_LIBRARIES += libcutils libvixl
Ian Rogers02ed4c02013-09-06 13:10:04 -070096 include $(BUILD_HOST_SHARED_LIBRARY)
97 endif
98endef
99
100ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
101 $(eval $(call build-libart-disassembler,target,ndebug))
102endif
103ifeq ($(ART_BUILD_TARGET_DEBUG),true)
104 $(eval $(call build-libart-disassembler,target,debug))
105endif
106ifeq ($(WITH_HOST_DALVIK),true)
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.
108 ifeq ($(ART_BUILD_NDEBUG),true)
109 $(eval $(call build-libart-disassembler,host,ndebug))
110 endif
111 ifeq ($(ART_BUILD_DEBUG),true)
112 $(eval $(call build-libart-disassembler,host,debug))
113 endif
114endif