Android.build.mk revision 11ea08c5cbc47db16f6c024338fbe9f6f456ce80
1#
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)
18LOCAL_ADDITIONAL_DEPENDENCIES := $(common_additional_dependencies)
19
20LOCAL_MODULE := $(module)
21LOCAL_MODULE_TAGS := $(module_tag)
22ifeq ($(build_type),host)
23# Always make host multilib
24LOCAL_MULTILIB := both
25endif
26
27ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
28    LOCAL_MODULE_STEM_32 := $(module)32
29    LOCAL_MODULE_STEM_64 := $(module)64
30else
31ifeq ($($(module)_install_to_out_data),true)
32    LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
33    LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
34endif
35endif
36
37LOCAL_CLANG := $($(module)_clang_$(build_type))
38
39ifneq ($($(module)_allow_asan),true)
40LOCAL_SANITIZE := never
41endif
42
43LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable)
44
45LOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols)
46
47ifneq ($($(module)_multilib),)
48    LOCAL_MULTILIB := $($(module)_multilib)
49endif
50
51ifneq ($($(module)_relative_path),)
52    LOCAL_MODULE_RELATIVE_PATH := $($(module)_relative_path)
53endif
54
55LOCAL_CFLAGS := \
56    $(common_cflags) \
57    $($(module)_cflags) \
58    $($(module)_cflags_$(build_type)) \
59
60LOCAL_CONLYFLAGS += \
61    $(common_conlyflags) \
62    $($(module)_conlyflags) \
63    $($(module)_conlyflags_$(build_type)) \
64
65LOCAL_CPPFLAGS += \
66    $(common_cppflags) \
67    $($(module)_cppflags) \
68    $($(module)_cppflags_$(build_type)) \
69
70LOCAL_C_INCLUDES := \
71    $(common_c_includes) \
72    $($(module)_c_includes) \
73    $($(module)_c_includes_$(build_type)) \
74
75LOCAL_SRC_FILES := \
76    $($(module)_src_files) \
77    $($(module)_src_files_$(build_type)) \
78
79LOCAL_STATIC_LIBRARIES := \
80    $($(module)_static_libraries) \
81    $($(module)_static_libraries_$(build_type)) \
82
83LOCAL_SHARED_LIBRARIES := \
84    $($(module)_shared_libraries) \
85    $($(module)_shared_libraries_$(build_type)) \
86
87LOCAL_WHOLE_STATIC_LIBRARIES := \
88    $($(module)_whole_static_libraries) \
89    $($(module)_whole_static_libraries_$(build_type)) \
90
91LOCAL_LDFLAGS := \
92    $($(module)_ldflags) \
93    $($(module)_ldflags_$(build_type)) \
94
95LOCAL_LDLIBS := \
96    $($(module)_ldlibs) \
97    $($(module)_ldlibs_$(build_type)) \
98
99ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true)
100LOCAL_CXX_STL := libc++_static
101else
102LOCAL_CXX_STL := libc++
103endif
104
105ifeq ($(build_type),target)
106  include $(BUILD_$(build_target))
107endif
108
109ifeq ($(build_type),host)
110  # Only build if host builds are supported.
111  ifeq ($(build_host),true)
112    include $(BUILD_HOST_$(build_target))
113  endif
114endif
115