blob: f5b92fe4dcb9d69e653c8c917353166fd5d45af8 [file] [log] [blame]
Colin Crosse18cb932014-02-13 15:04:18 -08001###########################################################
2## Standard rules for copying files that are prebuilt
3##
4## Additional inputs from base_rules.make:
5## None.
6##
7###########################################################
8
Chih-Hung Hsieh32427d62018-04-12 10:55:54 -07009include $(BUILD_SYSTEM)/use_lld_setup.mk
10
Colin Crosse18cb932014-02-13 15:04:18 -080011ifneq ($(LOCAL_PREBUILT_LIBS),)
Colin Cross84667692018-06-25 13:20:04 -070012$(call pretty-error,dont use LOCAL_PREBUILT_LIBS anymore)
Colin Crosse18cb932014-02-13 15:04:18 -080013endif
14ifneq ($(LOCAL_PREBUILT_EXECUTABLES),)
Colin Cross84667692018-06-25 13:20:04 -070015$(call pretty-error,dont use LOCAL_PREBUILT_EXECUTABLES anymore)
Colin Crosse18cb932014-02-13 15:04:18 -080016endif
17ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),)
Colin Cross84667692018-06-25 13:20:04 -070018$(call pretty-error,dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore)
Colin Crosse18cb932014-02-13 15:04:18 -080019endif
20
Ying Wang34d5f1b2014-05-16 10:38:43 -070021my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
22
Colin Crosse18cb932014-02-13 15:04:18 -080023ifdef LOCAL_PREBUILT_MODULE_FILE
Ying Wangc0adfb72014-02-27 14:10:53 -080024 my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE)
Dan Willemsen926ee442018-02-27 23:27:30 +000025else ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)
26 my_prebuilt_src_file := $(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 := $(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 := $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
33 LOCAL_SRC_FILES :=
34else ifdef LOCAL_REPLACE_PREBUILT_APK_INSTALLED
Jaewoong Jungf22997e2019-03-20 10:35:43 -070035 # This is handled specially in app_prebuilt_internal.mk
Colin Crosse18cb932014-02-13 15:04:18 -080036else
Dan Willemsen926ee442018-02-27 23:27:30 +000037 $(call pretty-error,No source files specified)
Colin Crosse18cb932014-02-13 15:04:18 -080038endif
39
Colin Cross01e1b8f2016-10-27 22:10:55 +000040LOCAL_CHECKED_MODULE := $(my_prebuilt_src_file)
41
Jaewoong Jungf22997e2019-03-20 10:35:43 -070042ifneq (APPS,$(LOCAL_MODULE_CLASS))
Narayan Kamath7c205102017-08-07 12:31:17 +010043ifdef LOCAL_COMPRESSED_MODULE
44$(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module class APPS)
45endif # LOCAL_COMPRESSED_MODULE
Jaewoong Jungf22997e2019-03-20 10:35:43 -070046endif # APPS
Narayan Kamath7c205102017-08-07 12:31:17 +010047
Jaewoong Jungf22997e2019-03-20 10:35:43 -070048ifeq (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
Colin Crosse18cb932014-02-13 15:04:18 -080052else
Jaewoong Jungf22997e2019-03-20 10:35:43 -070053 # TODO(jungjw): Check LOCAL_MODULE_CLASS value and generate an error for unexpected ones.
54 include $(BUILD_SYSTEM)/cc_prebuilt_internal.mk
Colin Crosse18cb932014-02-13 15:04:18 -080055endif
Jaewoong Jung09bfe552019-03-18 14:25:00 -070056
Dan Willemsen1c6dc5b2016-01-06 14:28:36 -080057$(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES)
Colin Crosse18cb932014-02-13 15:04:18 -080058
59my_prebuilt_src_file :=
Mathieu Chartier55eabd52017-09-15 13:40:48 -070060my_preopt_for_extracted_apk :=