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 24 LOCAL_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 31ifneq ($($(module)_install_to_native_tests_dir),) 32 ifeq ($(build_type),host) 33 native_tests_var := HOST_OUT_NATIVE_TESTS 34 else 35 native_tests_var := TARGET_OUT_DATA_NATIVE_TESTS 36 endif 37 38 ifneq ($($(module)_install_to_native_tests_dir_32),) 39 tests_dir_32 := $($(module)_install_to_native_tests_dir_32) 40 else 41 tests_dir_32 := $($(module)_install_to_native_tests_dir) 42 endif 43 44 ifneq ($($(module)_install_to_native_tests_dir_64),) 45 tests_dir_64 := $($(module)_install_to_native_tests_dir_64) 46 else 47 tests_dir_64 := $($(module)_install_to_native_tests_dir) 48 endif 49 50 LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)$(native_tests_var))/$(tests_dir_32) 51 LOCAL_MODULE_PATH_64 := $($(native_tests_var))/$(tests_dir_64) 52endif 53endif 54 55LOCAL_CLANG := $($(module)_clang_$(build_type)) 56 57ifneq ($($(module)_allow_asan),true) 58 LOCAL_SANITIZE := never 59endif 60 61LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable) 62 63LOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols) 64 65ifneq ($($(module)_multilib),) 66 LOCAL_MULTILIB := $($(module)_multilib) 67endif 68 69ifneq ($($(module)_relative_path),) 70 LOCAL_MODULE_RELATIVE_PATH := $($(module)_relative_path) 71endif 72 73LOCAL_CFLAGS := \ 74 $(common_cflags) \ 75 $($(module)_cflags) \ 76 $($(module)_cflags_$(build_type)) \ 77 78LOCAL_CONLYFLAGS += \ 79 $(common_conlyflags) \ 80 $($(module)_conlyflags) \ 81 $($(module)_conlyflags_$(build_type)) \ 82 83LOCAL_CPPFLAGS += \ 84 $(common_cppflags) \ 85 $($(module)_cppflags) \ 86 $($(module)_cppflags_$(build_type)) \ 87 88LOCAL_C_INCLUDES := \ 89 $(common_c_includes) \ 90 $($(module)_c_includes) \ 91 $($(module)_c_includes_$(build_type)) \ 92 93LOCAL_SRC_FILES := \ 94 $($(module)_src_files) \ 95 $($(module)_src_files_$(build_type)) \ 96 97LOCAL_STATIC_LIBRARIES := \ 98 $($(module)_static_libraries) \ 99 $($(module)_static_libraries_$(build_type)) \ 100 101LOCAL_SHARED_LIBRARIES := \ 102 $($(module)_shared_libraries) \ 103 $($(module)_shared_libraries_$(build_type)) \ 104 105LOCAL_WHOLE_STATIC_LIBRARIES := \ 106 $($(module)_whole_static_libraries) \ 107 $($(module)_whole_static_libraries_$(build_type)) \ 108 109LOCAL_LDFLAGS := \ 110 $($(module)_ldflags) \ 111 $($(module)_ldflags_$(build_type)) \ 112 113LOCAL_LDLIBS := \ 114 $($(module)_ldlibs) \ 115 $($(module)_ldlibs_$(build_type)) \ 116 117LOCAL_CXX_STL := libc++_static 118 119ifeq ($(build_type),target) 120 include $(BUILD_$(build_target)) 121endif 122 123ifeq ($(build_type),host) 124 # Only build if host builds are supported. 125 ifeq ($(build_host),true) 126 include $(BUILD_HOST_$(build_target)) 127 endif 128endif 129