Home | History | Annotate | Download | only in core
      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 
     10 ifdef LOCAL_IS_HOST_MODULE
     11   my_prefix := HOST_
     12   LOCAL_HOST_PREFIX :=
     13 else
     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
     22 endif
     23 
     24 include $(BUILD_SYSTEM)/multilib.mk
     25 
     26 my_skip_non_preferred_arch :=
     27 
     28 # check if first arch is supported
     29 LOCAL_2ND_ARCH_VAR_PREFIX :=
     30 include $(BUILD_SYSTEM)/module_arch_supported.mk
     31 ifeq ($(my_module_arch_supported),true)
     32 # first arch is supported
     33 include $(BUILD_SYSTEM)/prebuilt_internal.mk
     34 ifneq ($(my_module_multilib),both)
     35 my_skip_non_preferred_arch := true
     36 endif # $(my_module_multilib)
     37 # For apps, we don't want to set up the prebuilt apk rule twice even if "LOCAL_MULTILIB := both".
     38 ifeq (APPS,$(LOCAL_MODULE_CLASS))
     39 my_skip_non_preferred_arch := true
     40 endif
     41 endif # $(my_module_arch_supported)
     42 
     43 ifndef my_skip_non_preferred_arch
     44 ifneq (,$($(my_prefix)2ND_ARCH))
     45 # check if secondary arch is supported
     46 LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
     47 include $(BUILD_SYSTEM)/module_arch_supported.mk
     48 ifeq ($(my_module_arch_supported),true)
     49 # secondary arch is supported
     50 OVERRIDE_BUILT_MODULE_PATH :=
     51 LOCAL_BUILT_MODULE :=
     52 LOCAL_INSTALLED_MODULE :=
     53 LOCAL_INTERMEDIATE_TARGETS :=
     54 include $(BUILD_SYSTEM)/prebuilt_internal.mk
     55 endif # $(my_module_arch_supported)
     56 endif # $($(my_prefix)2ND_ARCH)
     57 endif # $(my_skip_non_preferred_arch) not true
     58 
     59 LOCAL_2ND_ARCH_VAR_PREFIX :=
     60 
     61 ifdef LOCAL_IS_HOST_MODULE
     62 ifdef HOST_CROSS_OS
     63 ifneq (,$(filter EXECUTABLES STATIC_LIBRARIES SHARED_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)))
     64 my_prefix := HOST_CROSS_
     65 LOCAL_HOST_PREFIX := $(my_prefix)
     66 include $(BUILD_SYSTEM)/module_arch_supported.mk
     67 ifeq ($(my_module_arch_supported),true)
     68 # host cross compilation is supported
     69 OVERRIDE_BUILT_MODULE_PATH :=
     70 LOCAL_BUILT_MODULE :=
     71 LOCAL_INSTALLED_MODULE :=
     72 LOCAL_INTERMEDIATE_TARGETS :=
     73 include $(BUILD_SYSTEM)/prebuilt_internal.mk
     74 endif
     75 LOCAL_HOST_PREFIX :=
     76 endif
     77 
     78 ifdef HOST_CROSS_2ND_ARCH
     79 my_prefix := HOST_CROSS_
     80 LOCAL_2ND_ARCH_VAR_PREFIX := $($(my_prefix)2ND_ARCH_VAR_PREFIX)
     81 LOCAL_HOST_PREFIX := $(my_prefix)
     82 include $(BUILD_SYSTEM)/module_arch_supported.mk
     83 ifeq ($(my_module_arch_supported),true)
     84 OVERRIDE_BUILT_MODULE_PATH :=
     85 LOCAL_BUILT_MODULE :=
     86 LOCAL_INSTALLED_MODULE :=
     87 LOCAL_INTERMEDIATE_TARGETS :=
     88 include $(BUILD_SYSTEM)/prebuilt_internal.mk
     89 endif
     90 LOCAL_HOST_PREFIX :=
     91 LOCAL_2ND_ARCH_VAR_PREFIX :=
     92 endif
     93 endif
     94 endif
     95 
     96 my_module_arch_supported :=
     97