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) 184a9e1937c56511aef579312bf39ab345f9179230Dmitriy IvanovLOCAL_ADDITIONAL_DEPENDENCIES := $(common_additional_dependencies) 19f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 20f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_MODULE := $(module) 21f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_MODULE_TAGS := $(module_tag) 22e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisifeq ($(build_type),host) 23ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky # Always make host multilib 24ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MULTILIB := both 25e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisendif 26e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferris 27e9f7a9c340a3af11de720042fdc5061b65dc9b78Christopher Ferrisifneq ($(findstring LIBRARY, $(build_target)),LIBRARY) 28ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MODULE_STEM_32 := $(module)32 29ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MODULE_STEM_64 := $(module)64 3004dc91ae763adc403a14c88b4c46f77b3d2d71a3Dmitriy Ivanovelse 31ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodskyifneq ($($(module)_install_to_native_tests_dir),) 32ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky ifeq ($(build_type),host) 33ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky native_tests_var := HOST_OUT_NATIVE_TESTS 34ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky else 35ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky native_tests_var := TARGET_OUT_DATA_NATIVE_TESTS 36ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky endif 37ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky 38ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)$(native_tests_var))/$($(module)_install_to_native_tests_dir) 39ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MODULE_PATH_64 := $($(native_tests_var))/$($(module)_install_to_native_tests_dir) 4004dc91ae763adc403a14c88b4c46f77b3d2d71a3Dmitriy Ivanovendif 41345b49a7c07fde18e9397ffba9079ff81a4c3d74Christopher Ferrisendif 42f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 43f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CLANG := $($(module)_clang_$(build_type)) 4401f1ff2440759e34197f741a7b380a71c607f513Dan Albert 4501f1ff2440759e34197f741a7b380a71c607f513Dan Albertifneq ($($(module)_allow_asan),true) 46ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_SANITIZE := never 4701f1ff2440759e34197f741a7b380a71c607f513Dan Albertendif 48f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 49f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable) 50f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 517699d13a74769fe8063fcca95588c87c571226c0Dmitriy IvanovLOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols) 527699d13a74769fe8063fcca95588c87c571226c0Dmitriy Ivanov 539aea164457c269c475592da36b4655d45f55c7bcDmitriy Ivanovifneq ($($(module)_multilib),) 54ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MULTILIB := $($(module)_multilib) 559aea164457c269c475592da36b4655d45f55c7bcDmitriy Ivanovendif 569aea164457c269c475592da36b4655d45f55c7bcDmitriy Ivanov 576865082ca6d887766c6651ed2d079dca56a99d32Evgenii Stepanovifneq ($($(module)_relative_path),) 58ee2952e84ff991ff7adcf55fb604fa100a379ef7Kevin Brodsky LOCAL_MODULE_RELATIVE_PATH := $($(module)_relative_path) 596865082ca6d887766c6651ed2d079dca56a99d32Evgenii Stepanovendif 606865082ca6d887766c6651ed2d079dca56a99d32Evgenii Stepanov 61f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CFLAGS := \ 62f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $(common_cflags) \ 63f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_cflags) \ 64f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_cflags_$(build_type)) \ 65f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 66f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CONLYFLAGS += \ 67f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $(common_conlyflags) \ 68f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_conlyflags) \ 69f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_conlyflags_$(build_type)) \ 70f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 71f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_CPPFLAGS += \ 72f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $(common_cppflags) \ 73f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_cppflags) \ 74f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_cppflags_$(build_type)) \ 75f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 76f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_C_INCLUDES := \ 77f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $(common_c_includes) \ 78f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_c_includes) \ 79f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_c_includes_$(build_type)) \ 80f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 81f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_SRC_FILES := \ 82f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_src_files) \ 83f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_src_files_$(build_type)) \ 84f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 85f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_STATIC_LIBRARIES := \ 86f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_static_libraries) \ 87f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_static_libraries_$(build_type)) \ 88f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 89f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_SHARED_LIBRARIES := \ 90f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_shared_libraries) \ 91f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_shared_libraries_$(build_type)) \ 92f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 93f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_WHOLE_STATIC_LIBRARIES := \ 94f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_whole_static_libraries) \ 95f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_whole_static_libraries_$(build_type)) \ 96f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 97f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_LDFLAGS := \ 98f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_ldflags) \ 99f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_ldflags_$(build_type)) \ 100f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 101f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher FerrisLOCAL_LDLIBS := \ 102f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_ldlibs) \ 103f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris $($(module)_ldlibs_$(build_type)) \ 104f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 1051f553ea5da3a7d501f028ecc3a19c615b94c2766Yabin CuiLOCAL_CXX_STL := libc++_static 106f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 1073a5aeba4bda8b0977678021deed7aebeaa63ded1Dan Albertifeq ($(build_type),target) 108f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris include $(BUILD_$(build_target)) 109f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisendif 110f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris 111f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisifeq ($(build_type),host) 112f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris # Only build if host builds are supported. 113f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris ifeq ($(build_host),true) 114f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris include $(BUILD_HOST_$(build_target)) 115f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferris endif 116f04935c85e0b466f0d30d2cd4c0fa2fff62e7d6dChristopher Ferrisendif 117