1f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#
2f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# Copyright (C) 2014 The Android Open Source Project
3f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#
4f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# Licensed under the Apache License, Version 2.0 (the "License");
5f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# you may not use this file except in compliance with the License.
6f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# You may obtain a copy of the License at
7f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#
8f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#      http://www.apache.org/licenses/LICENSE-2.0
9f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#
10f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# Unless required by applicable law or agreed to in writing, software
11f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# distributed under the License is distributed on an "AS IS" BASIS,
12f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# See the License for the specific language governing permissions and
14f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris# limitations under the License.
15f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris#
16f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
17f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisinclude $(CLEAR_VARS)
18f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
19f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_MODULE := $(module)
20f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_MODULE_TAGS := $(module_tag)
21e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisifeq ($(build_type),host)
22e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferris# Always make host multilib
23e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher FerrisLOCAL_MULTILIB := both
24e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisendif
25e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferris
26e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
27345b49a7c07fde18e9397ffba9079ff81a4c3d74Christopher Ferris    LOCAL_MODULE_STEM_32 := $(module)32
28345b49a7c07fde18e9397ffba9079ff81a4c3d74Christopher Ferris    LOCAL_MODULE_STEM_64 := $(module)64
2904dc91ae763adc403a14c88b4c46f77b3d2d71a3Dmitriy Ivanovelse
3004dc91ae763adc403a14c88b4c46f77b3d2d71a3Dmitriy Ivanovifeq ($($(module)_install_to_out_data),true)
31dc42e20d54f17cbcabb2e8584398566eb66c47c3Ying Wang    LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
32dc42e20d54f17cbcabb2e8584398566eb66c47c3Ying Wang    LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/$(module)
3304dc91ae763adc403a14c88b4c46f77b3d2d71a3Dmitriy Ivanovendif
34345b49a7c07fde18e9397ffba9079ff81a4c3d74Christopher Ferrisendif
35f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
36f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CLANG := $($(module)_clang_$(build_type))
37f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
38f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable)
39f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
40f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CFLAGS := \
41f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $(common_cflags) \
42f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_cflags) \
43f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_cflags_$(build_type)) \
44f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
45f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CONLYFLAGS += \
46f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $(common_conlyflags) \
47f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_conlyflags) \
48f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_conlyflags_$(build_type)) \
49f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
50f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CPPFLAGS += \
51f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $(common_cppflags) \
52f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_cppflags) \
53f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_cppflags_$(build_type)) \
54f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
55f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_C_INCLUDES := \
56f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $(common_c_includes) \
57f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_c_includes) \
58f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_c_includes_$(build_type)) \
59f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
60f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_SRC_FILES := \
61f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_src_files) \
62f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_src_files_$(build_type)) \
63f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
64f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_STATIC_LIBRARIES := \
65f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_static_libraries) \
66f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_static_libraries_$(build_type)) \
67f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
68f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_SHARED_LIBRARIES := \
69f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_shared_libraries) \
70f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_shared_libraries_$(build_type)) \
71f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
72f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_WHOLE_STATIC_LIBRARIES := \
73f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_whole_static_libraries) \
74f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_whole_static_libraries_$(build_type)) \
75f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
76f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_LDFLAGS := \
77f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_ldflags) \
78f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_ldflags_$(build_type)) \
79f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
80f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_LDLIBS := \
81f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_ldlibs) \
82f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    $($(module)_ldlibs_$(build_type)) \
83f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
84f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisifeq ($(build_type),target)
857a39094465bbd01a22565fce1f1155c762f8d145Dan Albert  include external/stlport/libstlport.mk
86f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
87f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris  include $(BUILD_$(build_target))
88f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisendif
89f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris
90f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisifeq ($(build_type),host)
91f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris  # Only build if host builds are supported.
92f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris  ifeq ($(build_host),true)
93f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris    include $(BUILD_HOST_$(build_target))
94f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris  endif
95f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisendif
96