blob: 740c2f4cb0229bbb5eb89c83961ca21f37fb8593 [file] [log] [blame]
Christopher Ferrisf04935c2013-12-20 18:43:21 -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)
Dmitriy Ivanov4a9e1932014-10-17 11:47:18 -070018LOCAL_ADDITIONAL_DEPENDENCIES := $(common_additional_dependencies)
Christopher Ferrisf04935c2013-12-20 18:43:21 -080019
20LOCAL_MODULE := $(module)
21LOCAL_MODULE_TAGS := $(module_tag)
Christopher Ferrise9f7a9c2014-06-10 19:46:07 -070022ifeq ($(build_type),host)
23# Always make host multilib
24LOCAL_MULTILIB := both
Christopher Ferrise9f7a9c2014-06-10 19:46:07 -070025endif
26
27ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
Christopher Ferris345b49a2014-04-22 10:42:12 -070028 LOCAL_MODULE_STEM_32 := $(module)32
29 LOCAL_MODULE_STEM_64 := $(module)64
Dmitriy Ivanov04dc91a2014-07-01 14:10:16 -070030else
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070031
32ifneq ($($(module)_install_to_out_data_dir),)
33 $(module)_install_to_out_data := true
34endif
35
Dmitriy Ivanov04dc91a2014-07-01 14:10:16 -070036ifeq ($($(module)_install_to_out_data),true)
Dmitriy Ivanov42d5fcb2015-10-29 17:01:24 -070037 ifeq ($($(module)_install_to_out_data_dir),)
38 $(module)_install_to_out_data_dir := $(module)
39 endif
40 LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$($(module)_install_to_out_data_dir)
41 LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$($(module)_install_to_out_data_dir)
Dmitriy Ivanov04dc91a2014-07-01 14:10:16 -070042endif
Christopher Ferris345b49a2014-04-22 10:42:12 -070043endif
Christopher Ferrisf04935c2013-12-20 18:43:21 -080044
45LOCAL_CLANG := $($(module)_clang_$(build_type))
Dan Albert01f1ff22014-11-14 19:58:26 -080046
47ifneq ($($(module)_allow_asan),true)
Dan Albert11ea08c2015-06-16 13:57:54 -070048LOCAL_SANITIZE := never
Dan Albert01f1ff22014-11-14 19:58:26 -080049endif
Christopher Ferrisf04935c2013-12-20 18:43:21 -080050
51LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable)
52
Dmitriy Ivanov7699d132014-11-18 17:26:31 -080053LOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols)
54
Dmitriy Ivanov9aea1642014-09-11 15:16:03 -070055ifneq ($($(module)_multilib),)
56 LOCAL_MULTILIB := $($(module)_multilib)
57endif
58
Evgenii Stepanov68650822015-06-10 13:38:39 -070059ifneq ($($(module)_relative_path),)
60 LOCAL_MODULE_RELATIVE_PATH := $($(module)_relative_path)
61endif
62
Christopher Ferrisf04935c2013-12-20 18:43:21 -080063LOCAL_CFLAGS := \
64 $(common_cflags) \
65 $($(module)_cflags) \
66 $($(module)_cflags_$(build_type)) \
67
68LOCAL_CONLYFLAGS += \
69 $(common_conlyflags) \
70 $($(module)_conlyflags) \
71 $($(module)_conlyflags_$(build_type)) \
72
73LOCAL_CPPFLAGS += \
74 $(common_cppflags) \
75 $($(module)_cppflags) \
76 $($(module)_cppflags_$(build_type)) \
77
78LOCAL_C_INCLUDES := \
79 $(common_c_includes) \
80 $($(module)_c_includes) \
81 $($(module)_c_includes_$(build_type)) \
82
83LOCAL_SRC_FILES := \
84 $($(module)_src_files) \
85 $($(module)_src_files_$(build_type)) \
86
87LOCAL_STATIC_LIBRARIES := \
88 $($(module)_static_libraries) \
89 $($(module)_static_libraries_$(build_type)) \
90
91LOCAL_SHARED_LIBRARIES := \
92 $($(module)_shared_libraries) \
93 $($(module)_shared_libraries_$(build_type)) \
94
95LOCAL_WHOLE_STATIC_LIBRARIES := \
96 $($(module)_whole_static_libraries) \
97 $($(module)_whole_static_libraries_$(build_type)) \
98
99LOCAL_LDFLAGS := \
100 $($(module)_ldflags) \
101 $($(module)_ldflags_$(build_type)) \
102
103LOCAL_LDLIBS := \
104 $($(module)_ldlibs) \
105 $($(module)_ldlibs_$(build_type)) \
106
Dan Albert3a5aeba2014-09-26 15:37:52 -0700107ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
108LOCAL_CXX_STL := libc++_static
109else
110LOCAL_CXX_STL := libc++
111endif
Christopher Ferrisf04935c2013-12-20 18:43:21 -0800112
Dan Albert3a5aeba2014-09-26 15:37:52 -0700113ifeq ($(build_type),target)
Christopher Ferrisf04935c2013-12-20 18:43:21 -0800114 include $(BUILD_$(build_target))
115endif
116
117ifeq ($(build_type),host)
118 # Only build if host builds are supported.
119 ifeq ($(build_host),true)
120 include $(BUILD_HOST_$(build_target))
121 endif
122endif