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 LOCAL_BUILT_MODULE :=
     51 LOCAL_INSTALLED_MODULE :=
     52 LOCAL_INTERMEDIATE_TARGETS :=
     53 include $(BUILD_SYSTEM)/prebuilt_internal.mk
     54 endif # $(my_module_arch_supported)
     55 endif # $($(my_prefix)2ND_ARCH)
     56 endif # $(my_skip_non_preferred_arch) not true
     57 
     58 LOCAL_2ND_ARCH_VAR_PREFIX :=
     59 
     60 my_module_arch_supported :=
     61