1########################################################### 2## Standard rules for copying files that are prebuilt 3## 4## Additional inputs from base_rules.make: 5## None. 6## 7########################################################### 8$(call record-module-type,PREBUILT) 9 10ifdef LOCAL_IS_HOST_MODULE 11 my_prefix := HOST_ 12 LOCAL_HOST_PREFIX := 13else 14 my_prefix := TARGET_ 15 16 ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) 17 # Only support prebuilt shared and static libraries for translated arch 18 ifeq ($(filter SHARED_LIBRARIES STATIC_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),) 19 LOCAL_MULTILIB := first 20 endif 21 endif 22endif 23 24include $(BUILD_SYSTEM)/multilib.mk 25 26my_skip_non_preferred_arch := 27 28# check if first arch is supported 29LOCAL_2ND_ARCH_VAR_PREFIX := 30include $(BUILD_SYSTEM)/module_arch_supported.mk 31ifeq ($(my_module_arch_supported),true) 32# first arch is supported 33include $(BUILD_SYSTEM)/prebuilt_internal.mk 34ifneq ($(my_module_multilib),both) 35my_skip_non_preferred_arch := true 36endif # $(my_module_multilib) 37# For apps, we don't want to set up the prebuilt apk rule twice even if "LOCAL_MULTILIB := both". 38ifeq (APPS,$(LOCAL_MODULE_CLASS)) 39my_skip_non_preferred_arch := true 40endif 41endif # $(my_module_arch_supported) 42 43ifndef my_skip_non_preferred_arch 44ifneq (,$($(my_prefix)2ND_ARCH)) 45# check if secondary arch is supported 46LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX) 47include $(BUILD_SYSTEM)/module_arch_supported.mk 48ifeq ($(my_module_arch_supported),true) 49# secondary arch is supported 50OVERRIDE_BUILT_MODULE_PATH := 51LOCAL_BUILT_MODULE := 52LOCAL_INSTALLED_MODULE := 53LOCAL_INTERMEDIATE_TARGETS := 54include $(BUILD_SYSTEM)/prebuilt_internal.mk 55endif # $(my_module_arch_supported) 56endif # $($(my_prefix)2ND_ARCH) 57endif # $(my_skip_non_preferred_arch) not true 58 59LOCAL_2ND_ARCH_VAR_PREFIX := 60 61ifdef LOCAL_IS_HOST_MODULE 62ifdef HOST_CROSS_OS 63ifneq (,$(filter EXECUTABLES STATIC_LIBRARIES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS))) 64my_prefix := HOST_CROSS_ 65LOCAL_HOST_PREFIX := $(my_prefix) 66include $(BUILD_SYSTEM)/module_arch_supported.mk 67ifeq ($(my_module_arch_supported),true) 68# host cross compilation is supported 69OVERRIDE_BUILT_MODULE_PATH := 70LOCAL_BUILT_MODULE := 71LOCAL_INSTALLED_MODULE := 72LOCAL_INTERMEDIATE_TARGETS := 73include $(BUILD_SYSTEM)/prebuilt_internal.mk 74endif 75LOCAL_HOST_PREFIX := 76endif 77 78ifdef HOST_CROSS_2ND_ARCH 79my_prefix := HOST_CROSS_ 80LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX) 81LOCAL_HOST_PREFIX := $(my_prefix) 82include $(BUILD_SYSTEM)/module_arch_supported.mk 83ifeq ($(my_module_arch_supported),true) 84OVERRIDE_BUILT_MODULE_PATH := 85LOCAL_BUILT_MODULE := 86LOCAL_INSTALLED_MODULE := 87LOCAL_INTERMEDIATE_TARGETS := 88include $(BUILD_SYSTEM)/prebuilt_internal.mk 89endif 90LOCAL_HOST_PREFIX := 91LOCAL_2ND_ARCH_VAR_PREFIX := 92endif 93endif 94endif 95 96my_module_arch_supported := 97