1###########################################################
2## Standard rules for copying files that are prebuilt
3##
4## Additional inputs from base_rules.make:
5## None.
6##
7###########################################################
8
9include $(BUILD_SYSTEM)/use_lld_setup.mk
10
11ifneq ($(LOCAL_PREBUILT_LIBS),)
12$(call pretty-error,dont use LOCAL_PREBUILT_LIBS anymore)
13endif
14ifneq ($(LOCAL_PREBUILT_EXECUTABLES),)
15$(call pretty-error,dont use LOCAL_PREBUILT_EXECUTABLES anymore)
16endif
17ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),)
18$(call pretty-error,dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore)
19endif
20
21my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
22
23ifdef LOCAL_PREBUILT_MODULE_FILE
24  my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
25else ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
26  my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))
27  LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) :=
28else ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix)
29  my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)))
30  LOCAL_SRC_FILES_$(my_32_64_bit_suffix) :=
31else ifdef LOCAL_SRC_FILES
32  my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES))
33  LOCAL_SRC_FILES :=
34else ifdef LOCAL_REPLACE_PREBUILT_APK_INSTALLED
35  # This is handled specially in app_prebuilt_internal.mk
36else
37  $(call pretty-error,No source files specified)
38endif
39
40LOCAL_CHECKED_MODULE := $(my_prebuilt_src_file)
41
42ifneq (APPS,$(LOCAL_MODULE_CLASS))
43ifdef LOCAL_COMPRESSED_MODULE
44$(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module class APPS)
45endif  # LOCAL_COMPRESSED_MODULE
46endif  # APPS
47
48ifeq (APPS,$(LOCAL_MODULE_CLASS))
49  include $(BUILD_SYSTEM)/app_prebuilt_internal.mk
50else ifeq (JAVA_LIBRARIES,$(LOCAL_MODULE_CLASS))
51  include $(BUILD_SYSTEM)/java_prebuilt_internal.mk
52else ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
53  include $(BUILD_SYSTEM)/cc_prebuilt_internal.mk
54else ifneq ($(filter SCRIPT ETC DATA RENDERSCRIPT_BITCODE,$(LOCAL_MODULE_CLASS)),)
55  include $(BUILD_SYSTEM)/misc_prebuilt_internal.mk
56else
57  $(error $(LOCAL_MODULE) : unexpected LOCAL_MODULE_CLASS for prebuilts: $(LOCAL_MODULE_CLASS))
58endif
59
60$(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES)
61
62my_prebuilt_src_file :=
63my_preopt_for_extracted_apk :=
64