blob: 54bee7a23b0b964b26bae7d88906c5eb96543f7d [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 Ferris31ec2c62014-06-13 16:27:34 -070021ifeq ($(build_type),host)
22# Always make host multilib
23LOCAL_MULTILIB := both
24else
Christopher Ferris7c042422014-04-25 13:21:40 -070025LOCAL_MULTILIB := $($(module)_multilib)
Christopher Ferris31ec2c62014-06-13 16:27:34 -070026endif
27
28ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
Christopher Ferris7c042422014-04-25 13:21:40 -070029ifeq ($(LOCAL_MULTILIB),both)
30 LOCAL_MODULE_STEM_32 := $(module)32
31 LOCAL_MODULE_STEM_64 := $(module)64
32endif
Ian Rogersaf7a2972014-06-05 10:35:29 -070033endif
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080034
35LOCAL_ADDITIONAL_DEPENDENCIES := \
36 $(LOCAL_PATH)/Android.mk \
37 $(LOCAL_PATH)/Android.build.mk \
38
39LOCAL_CFLAGS := \
40 $(common_cflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070041 $(common_cflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080042 $($(module)_cflags) \
43 $($(module)_cflags_$(build_type)) \
44
45LOCAL_CONLYFLAGS += \
46 $(common_conlyflags) \
Christopher Ferrisd1c383c2014-04-09 16:48:26 -070047 $(common_conlyflags_$(build_type)) \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080048 $($(module)_conlyflags) \
49 $($(module)_conlyflags_$(build_type)) \
50
51LOCAL_CPPFLAGS += \
52 $(common_cppflags) \
53 $($(module)_cppflags) \
54 $($(module)_cppflags_$(build_type)) \
55
56LOCAL_C_INCLUDES := \
57 $(common_c_includes) \
58 $($(module)_c_includes) \
59 $($(module)_c_includes_$(build_type)) \
60
Ying Wangeb25b732014-05-20 15:51:06 -070061$(foreach arch,$(libunwind_arches), \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080062 $(eval LOCAL_C_INCLUDES_$(arch) := $(common_c_includes_$(arch))))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080063
64LOCAL_SRC_FILES := \
65 $($(module)_src_files) \
66 $($(module)_src_files_$(build_type)) \
67
Ying Wangeb25b732014-05-20 15:51:06 -070068$(foreach arch,$(libunwind_arches), \
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080069 $(eval LOCAL_SRC_FILES_$(arch) := $($(module)_src_files_$(arch))))
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080070
71LOCAL_STATIC_LIBRARIES := \
72 $($(module)_static_libraries) \
73 $($(module)_static_libraries_$(build_type)) \
74
Christopher Ferrisaa946482014-06-19 11:04:34 -070075LOCAL_WHOLE_STATIC_LIBRARIES := \
76 $($(module)_whole_static_libraries) \
77 $($(module)_whole_static_libraries_$(build_type)) \
78
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080079LOCAL_SHARED_LIBRARIES := \
80 $($(module)_shared_libraries) \
81 $($(module)_shared_libraries_$(build_type)) \
82
83LOCAL_LDLIBS := \
84 $($(module)_ldlibs) \
85 $($(module)_ldlibs_$(build_type)) \
86
Dan Albert162c8cb2014-05-09 10:19:20 -070087LOCAL_LDFLAGS := \
88 $($(module)_ldflags) \
89 $($(module)_ldflags_$(build_type)) \
90
Christopher Ferrisfe6ff002014-01-30 01:04:29 -080091# Translate arm64 to aarch64 in c includes and src files.
92LOCAL_C_INCLUDES_arm64 := \
93 $(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64))
94
95LOCAL_SRC_FILES_arm64 := \
96 $(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64))
97
98ifeq ($(build_type),target)
99 include $(BUILD_$(build_target))
100endif
101
102ifeq ($(build_type),host)
103 # Only build if host builds are supported.
104 ifeq ($(build_host),true)
105 include $(BUILD_HOST_$(build_target))
106 endif
107endif