blob: 3254be60e019c283e76a2823674cab6646b468fd [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)
Ian Rogersaf7a2972014-06-05 10:35:29 -070022ifeq ($(build_type),target)
Christopher Ferris7c042422014-04-25 13:21:40 -070023ifeq ($(LOCAL_MULTILIB),both)
24 LOCAL_MODULE_STEM_32 := $(module)32
25 LOCAL_MODULE_STEM_64 := $(module)64
26endif
Ian Rogersaf7a2972014-06-05 10:35:29 -070027endif
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080028
29LOCAL_ADDITIONAL_DEPENDENCIES := \
30 $(LOCAL_PATH)/Android.mk \
31 $(LOCAL_PATH)/Android.build.mk \
32
33LOCAL_CFLAGS := \
34 $(common_cflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070035 $(common_cflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080036 $($(module)_cflags) \
37 $($(module)_cflags_$(build_type)) \
38
39LOCAL_CONLYFLAGS += \
40 $(common_conlyflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070041 $(common_conlyflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080042 $($(module)_conlyflags) \
43 $($(module)_conlyflags_$(build_type)) \
44
45LOCAL_CPPFLAGS += \
46 $(common_cppflags) \
47 $($(module)_cppflags) \
48 $($(module)_cppflags_$(build_type)) \
49
50LOCAL_C_INCLUDES := \
51 $(common_c_includes) \
52 $($(module)_c_includes) \
53 $($(module)_c_includes_$(build_type)) \
54
Ying Wangeb25b732014-05-20 15:51:06 -070055$(foreach arch,$(libunwind_arches), \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080056 $(eval LOCAL_C_INCLUDES_$(arch) := $(common_c_includes_$(arch))))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080057
58LOCAL_SRC_FILES := \
59 $($(module)_src_files) \
60 $($(module)_src_files_$(build_type)) \
61
Ying Wangeb25b732014-05-20 15:51:06 -070062$(foreach arch,$(libunwind_arches), \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080063 $(eval LOCAL_SRC_FILES_$(arch) := $($(module)_src_files_$(arch))))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080064
65LOCAL_STATIC_LIBRARIES := \
66 $($(module)_static_libraries) \
67 $($(module)_static_libraries_$(build_type)) \
68
69LOCAL_SHARED_LIBRARIES := \
70 $($(module)_shared_libraries) \
71 $($(module)_shared_libraries_$(build_type)) \
72
73LOCAL_LDLIBS := \
74 $($(module)_ldlibs) \
75 $($(module)_ldlibs_$(build_type)) \
76
Dan Albert162c8cb2014-05-09 10:19:20 -070077LOCAL_LDFLAGS := \
78 $($(module)_ldflags) \
79 $($(module)_ldflags_$(build_type)) \
80
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080081# Translate arm64 to aarch64 in c includes and src files.
82LOCAL_C_INCLUDES_arm64 := \
83 $(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64))
84
85LOCAL_SRC_FILES_arm64 := \
86 $(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64))
87
88ifeq ($(build_type),target)
89 include $(BUILD_$(build_target))
90endif
91
92ifeq ($(build_type),host)
93 # Only build if host builds are supported.
94 ifeq ($(build_host),true)
95 include $(BUILD_HOST_$(build_target))
96 endif
97endif