Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 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 | |
| 17 | include $(CLEAR_VARS) |
Dmitriy Ivanov | 4a9e193 | 2014-10-17 11:47:18 -0700 | [diff] [blame] | 18 | LOCAL_ADDITIONAL_DEPENDENCIES := $(common_additional_dependencies) |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 19 | |
| 20 | LOCAL_MODULE := $(module) |
| 21 | LOCAL_MODULE_TAGS := $(module_tag) |
Christopher Ferris | e9f7a9c | 2014-06-10 19:46:07 -0700 | [diff] [blame] | 22 | ifeq ($(build_type),host) |
| 23 | # Always make host multilib |
| 24 | LOCAL_MULTILIB := both |
Christopher Ferris | e9f7a9c | 2014-06-10 19:46:07 -0700 | [diff] [blame] | 25 | endif |
| 26 | |
| 27 | ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY) |
Christopher Ferris | 345b49a | 2014-04-22 10:42:12 -0700 | [diff] [blame] | 28 | LOCAL_MODULE_STEM_32 := $(module)32 |
| 29 | LOCAL_MODULE_STEM_64 := $(module)64 |
Dmitriy Ivanov | 04dc91a | 2014-07-01 14:10:16 -0700 | [diff] [blame] | 30 | else |
| 31 | ifeq ($($(module)_install_to_out_data),true) |
Ying Wang | dc42e20 | 2014-07-08 18:54:42 -0700 | [diff] [blame] | 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) |
Dmitriy Ivanov | 04dc91a | 2014-07-01 14:10:16 -0700 | [diff] [blame] | 34 | endif |
Christopher Ferris | 345b49a | 2014-04-22 10:42:12 -0700 | [diff] [blame] | 35 | endif |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 36 | |
| 37 | LOCAL_CLANG := $($(module)_clang_$(build_type)) |
Dan Albert | 01f1ff2 | 2014-11-14 19:58:26 -0800 | [diff] [blame] | 38 | |
| 39 | ifneq ($($(module)_allow_asan),true) |
Dan Albert | 5ba672e | 2014-10-17 10:33:25 -0700 | [diff] [blame] | 40 | LOCAL_ADDRESS_SANITIZER := false |
Dan Albert | 01f1ff2 | 2014-11-14 19:58:26 -0800 | [diff] [blame] | 41 | endif |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 42 | |
| 43 | LOCAL_FORCE_STATIC_EXECUTABLE := $($(module)_force_static_executable) |
| 44 | |
Dmitriy Ivanov | 7699d13 | 2014-11-18 17:26:31 -0800 | [diff] [blame] | 45 | LOCAL_ALLOW_UNDEFINED_SYMBOLS := $($(module)_allow_undefined_symbols) |
| 46 | |
Dmitriy Ivanov | 9aea164 | 2014-09-11 15:16:03 -0700 | [diff] [blame] | 47 | ifneq ($($(module)_multilib),) |
| 48 | LOCAL_MULTILIB := $($(module)_multilib) |
| 49 | endif |
| 50 | |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 51 | LOCAL_CFLAGS := \ |
| 52 | $(common_cflags) \ |
| 53 | $($(module)_cflags) \ |
| 54 | $($(module)_cflags_$(build_type)) \ |
| 55 | |
| 56 | LOCAL_CONLYFLAGS += \ |
| 57 | $(common_conlyflags) \ |
| 58 | $($(module)_conlyflags) \ |
| 59 | $($(module)_conlyflags_$(build_type)) \ |
| 60 | |
| 61 | LOCAL_CPPFLAGS += \ |
| 62 | $(common_cppflags) \ |
| 63 | $($(module)_cppflags) \ |
| 64 | $($(module)_cppflags_$(build_type)) \ |
| 65 | |
| 66 | LOCAL_C_INCLUDES := \ |
| 67 | $(common_c_includes) \ |
| 68 | $($(module)_c_includes) \ |
| 69 | $($(module)_c_includes_$(build_type)) \ |
| 70 | |
| 71 | LOCAL_SRC_FILES := \ |
| 72 | $($(module)_src_files) \ |
| 73 | $($(module)_src_files_$(build_type)) \ |
| 74 | |
| 75 | LOCAL_STATIC_LIBRARIES := \ |
| 76 | $($(module)_static_libraries) \ |
| 77 | $($(module)_static_libraries_$(build_type)) \ |
| 78 | |
| 79 | LOCAL_SHARED_LIBRARIES := \ |
| 80 | $($(module)_shared_libraries) \ |
| 81 | $($(module)_shared_libraries_$(build_type)) \ |
| 82 | |
| 83 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 84 | $($(module)_whole_static_libraries) \ |
| 85 | $($(module)_whole_static_libraries_$(build_type)) \ |
| 86 | |
| 87 | LOCAL_LDFLAGS := \ |
| 88 | $($(module)_ldflags) \ |
| 89 | $($(module)_ldflags_$(build_type)) \ |
| 90 | |
| 91 | LOCAL_LDLIBS := \ |
| 92 | $($(module)_ldlibs) \ |
| 93 | $($(module)_ldlibs_$(build_type)) \ |
| 94 | |
Dan Albert | 3a5aeba | 2014-09-26 15:37:52 -0700 | [diff] [blame] | 95 | ifeq ($(LOCAL_FORCE_STATIC_EXECUTABLE),true) |
| 96 | LOCAL_CXX_STL := libc++_static |
| 97 | else |
| 98 | LOCAL_CXX_STL := libc++ |
| 99 | endif |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 100 | |
Dan Albert | 3a5aeba | 2014-09-26 15:37:52 -0700 | [diff] [blame] | 101 | ifeq ($(build_type),target) |
Christopher Ferris | f04935c | 2013-12-20 18:43:21 -0800 | [diff] [blame] | 102 | include $(BUILD_$(build_target)) |
| 103 | endif |
| 104 | |
| 105 | ifeq ($(build_type),host) |
| 106 | # Only build if host builds are supported. |
| 107 | ifeq ($(build_host),true) |
| 108 | include $(BUILD_HOST_$(build_target)) |
| 109 | endif |
| 110 | endif |