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) 18 19 LOCAL_MODULE := $(module) 20 LOCAL_MODULE_TAGS := $(module_tag) 21 ifeq ($(build_type),host) 22 # Always make host multilib 23 LOCAL_MULTILIB := both 24 else 25 LOCAL_MULTILIB := $($(module)_multilib) 26 endif 27 28 ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY) 29 ifeq ($(LOCAL_MULTILIB),both) 30 LOCAL_MODULE_STEM_32 := $(module)32 31 LOCAL_MODULE_STEM_64 := $(module)64 32 endif 33 endif 34 35 LOCAL_ADDITIONAL_DEPENDENCIES := \ 36 $(LOCAL_PATH)/Android.mk \ 37 $(LOCAL_PATH)/Android.build.mk \ 38 39 LOCAL_CFLAGS := \ 40 $(common_cflags) \ 41 $(common_cflags_$(build_type)) \ 42 $($(module)_cflags) \ 43 $($(module)_cflags_$(build_type)) \ 44 45 LOCAL_CONLYFLAGS += \ 46 $(common_conlyflags) \ 47 $(common_conlyflags_$(build_type)) \ 48 $($(module)_conlyflags) \ 49 $($(module)_conlyflags_$(build_type)) \ 50 51 LOCAL_CPPFLAGS += \ 52 $(common_cppflags) \ 53 $($(module)_cppflags) \ 54 $($(module)_cppflags_$(build_type)) \ 55 56 LOCAL_C_INCLUDES := \ 57 $(common_c_includes) \ 58 $($(module)_c_includes) \ 59 $($(module)_c_includes_$(build_type)) \ 60 61 $(foreach arch,$(libunwind_arches), \ 62 $(eval LOCAL_C_INCLUDES_$(arch) := $(common_c_includes_$(arch)))) 63 64 LOCAL_SRC_FILES := \ 65 $($(module)_src_files) \ 66 $($(module)_src_files_$(build_type)) \ 67 68 $(foreach arch,$(libunwind_arches), \ 69 $(eval LOCAL_SRC_FILES_$(arch) := $($(module)_src_files_$(arch)))) 70 71 LOCAL_STATIC_LIBRARIES := \ 72 $($(module)_static_libraries) \ 73 $($(module)_static_libraries_$(build_type)) \ 74 75 LOCAL_WHOLE_STATIC_LIBRARIES := \ 76 $($(module)_whole_static_libraries) \ 77 $($(module)_whole_static_libraries_$(build_type)) \ 78 79 LOCAL_SHARED_LIBRARIES := \ 80 $($(module)_shared_libraries) \ 81 $($(module)_shared_libraries_$(build_type)) \ 82 83 LOCAL_LDLIBS := \ 84 $($(module)_ldlibs) \ 85 $($(module)_ldlibs_$(build_type)) \ 86 87 LOCAL_LDFLAGS := \ 88 $($(module)_ldflags) \ 89 $($(module)_ldflags_$(build_type)) \ 90 91 # Translate arm64 to aarch64 in c includes and src files. 92 LOCAL_C_INCLUDES_arm64 := \ 93 $(subst tdep-arm64,tdep-aarch64,$(LOCAL_C_INCLUDES_arm64)) 94 95 LOCAL_SRC_FILES_arm64 := \ 96 $(subst src/arm64,src/aarch64,$(LOCAL_SRC_FILES_arm64)) 97 98 ifeq ($(build_type),target) 99 include $(BUILD_$(build_target)) 100 endif 101 102 ifeq ($(build_type),host) 103 # Only build if host builds are supported. 104 ifeq ($(build_host),true) 105 include $(BUILD_HOST_$(build_target)) 106 endif 107 endif 108