blob: 1a77ee833a2dab838caabcc7e15b0f87f5796c48 [file] [log] [blame]
Christopher Ferrisfe6ff002014-01-30 01:04:29 -08001#
2# Copyright (C) 2014 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
17include $(CLEAR_VARS)
18
19LOCAL_MODULE := $(module)
20LOCAL_MODULE_TAGS := $(module_tag)
Christopher Ferris7c042422014-04-25 13:21:40 -070021LOCAL_MULTILIB := $($(module)_multilib)
22ifeq ($(LOCAL_MULTILIB),both)
23 LOCAL_MODULE_STEM_32 := $(module)32
24 LOCAL_MODULE_STEM_64 := $(module)64
25endif
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080026
27LOCAL_ADDITIONAL_DEPENDENCIES := \
28 $(LOCAL_PATH)/Android.mk \
29 $(LOCAL_PATH)/Android.build.mk \
30
31LOCAL_CFLAGS := \
32 $(common_cflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070033 $(common_cflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080034 $($(module)_cflags) \
35 $($(module)_cflags_$(build_type)) \
36
37LOCAL_CONLYFLAGS += \
38 $(common_conlyflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070039 $(common_conlyflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080040 $($(module)_conlyflags) \
41 $($(module)_conlyflags_$(build_type)) \
42
43LOCAL_CPPFLAGS += \
44 $(common_cppflags) \
45 $($(module)_cppflags) \
46 $($(module)_cppflags_$(build_type)) \
47
48LOCAL_C_INCLUDES := \
49 $(common_c_includes) \
50 $($(module)_c_includes) \
51 $($(module)_c_includes_$(build_type)) \
52
53ifneq ($(build_type),host)
54 $(foreach arch,$(libunwind_arches), \
55 $(eval LOCAL_C_INCLUDES_$(arch) := $(common_c_includes_$(arch))))
56else
Ying Wang57c68a32014-02-21 15:53:33 -080057 $(eval LOCAL_C_INCLUDES += $(common_c_includes_$(my_host_arch)))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080058endif
59
60LOCAL_SRC_FILES := \
61 $($(module)_src_files) \
62 $($(module)_src_files_$(build_type)) \
63
64ifneq ($(build_type),host)
65 $(foreach arch,$(libunwind_arches), \
66 $(eval LOCAL_SRC_FILES_$(arch) := $($(module)_src_files_$(arch))))
67else
Ying Wang57c68a32014-02-21 15:53:33 -080068 $(eval LOCAL_SRC_FILES += $($(module)_src_files_$(my_host_arch)))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080069endif
70
71LOCAL_STATIC_LIBRARIES := \
72 $($(module)_static_libraries) \
73 $($(module)_static_libraries_$(build_type)) \
74
75LOCAL_SHARED_LIBRARIES := \
76 $($(module)_shared_libraries) \
77 $($(module)_shared_libraries_$(build_type)) \
78
79LOCAL_LDLIBS := \
80 $($(module)_ldlibs) \
81 $($(module)_ldlibs_$(build_type)) \
82
83# Translate arm64 to aarch64 in c includes and src files.
84LOCAL_C_INCLUDES_arm64 := \
85 $(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64))
86
87LOCAL_SRC_FILES_arm64 := \
88 $(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64))
89
90ifeq ($(build_type),target)
91 include $(BUILD_$(build_target))
92endif
93
94ifeq ($(build_type),host)
95 # Only build if host builds are supported.
96 ifeq ($(build_host),true)
97 include $(BUILD_HOST_$(build_target))
98 endif
99endif