blob: 691c43f7a6058ad677f1bddc5b990ad70250caaa [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
Ian Rogersafd9acc2014-06-17 08:21:54 -070019include art/build/Android.common_build.mk
Ian Rogers02ed4c02013-09-06 13:10:04 -070020
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
49 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
50 ifeq ($$(art_ndebug_or_debug),ndebug)
51 LOCAL_MODULE := libart-disassembler
52 else # debug
53 LOCAL_MODULE := libartd-disassembler
54 endif
55
56 LOCAL_MODULE_TAGS := optional
57 LOCAL_MODULE_CLASS := SHARED_LIBRARIES
58
59 LOCAL_SRC_FILES := $$(LIBART_DISASSEMBLER_SRC_FILES)
60
Ian Rogers02ed4c02013-09-06 13:10:04 -070061 ifeq ($$(art_target_or_host),target)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -070062 $(call set-target-local-clang-vars)
63 $(call set-target-local-cflags-vars,$(2))
Ian Rogers02ed4c02013-09-06 13:10:04 -070064 else # host
65 LOCAL_CLANG := $(ART_HOST_CLANG)
Ian Rogers6f3dbba2014-10-14 17:41:57 -070066 LOCAL_LDLIBS := $(ART_HOST_LDLIBS)
Ian Rogers02ed4c02013-09-06 13:10:04 -070067 LOCAL_CFLAGS += $(ART_HOST_CFLAGS)
Andreas Gampe5ca4eaa2014-05-29 02:09:33 -070068 ifeq ($$(art_ndebug_or_debug),debug)
69 LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS)
70 else
71 LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS)
72 endif
Ian Rogers02ed4c02013-09-06 13:10:04 -070073 endif
74
75 LOCAL_SHARED_LIBRARIES += liblog
76 ifeq ($$(art_ndebug_or_debug),debug)
Ian Rogers02ed4c02013-09-06 13:10:04 -070077 LOCAL_SHARED_LIBRARIES += libartd
78 else
Ian Rogers02ed4c02013-09-06 13:10:04 -070079 LOCAL_SHARED_LIBRARIES += libart
80 endif
81
82 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
David Srbecky588e8e12015-04-06 18:36:59 +010083 LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
84 LOCAL_MULTILIB := both
Ian Rogers02ed4c02013-09-06 13:10:04 -070085
Ian Rogersafd9acc2014-06-17 08:21:54 -070086 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
Ian Rogers02ed4c02013-09-06 13:10:04 -070087 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk
Dan Albert31fb2602014-09-30 22:10:10 -070088 LOCAL_NATIVE_COVERAGE := $(ART_COVERAGE)
Ian Rogers872dd822014-10-30 11:19:14 -070089 # For disassembler_arm64.
Serban Constantinescu32f5b4d2014-11-25 20:05:46 +000090 ifeq ($$(art_ndebug_or_debug),debug)
91 LOCAL_SHARED_LIBRARIES += libvixld
92 else
93 LOCAL_SHARED_LIBRARIES += libvixl
94 endif
Ian Rogers02ed4c02013-09-06 13:10:04 -070095 ifeq ($$(art_target_or_host),target)
Ian Rogers02ed4c02013-09-06 13:10:04 -070096 include $(BUILD_SHARED_LIBRARY)
97 else # host
Ian Rogers02ed4c02013-09-06 13:10:04 -070098 include $(BUILD_HOST_SHARED_LIBRARY)
99 endif
100endef
101
102ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
103 $(eval $(call build-libart-disassembler,target,ndebug))
104endif
105ifeq ($(ART_BUILD_TARGET_DEBUG),true)
106 $(eval $(call build-libart-disassembler,target,debug))
107endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700108# 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 Park76ab3472014-08-11 21:28:16 +0900109ifeq ($(ART_BUILD_HOST_NDEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700110 $(eval $(call build-libart-disassembler,host,ndebug))
111endif
Junmo Park76ab3472014-08-11 21:28:16 +0900112ifeq ($(ART_BUILD_HOST_DEBUG),true)
Ian Rogersc5f17732014-06-05 20:48:42 -0700113 $(eval $(call build-libart-disassembler,host,debug))
Ian Rogers02ed4c02013-09-06 13:10:04 -0700114endif