blob: 94626402c98a748ed929f22023ca8504f6afad44 [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)
Dan Willemsenbbe4e112019-06-12 17:13:28 +000026 my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))
Dan Willemsen926ee442018-02-27 23:27:30 +000027 LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) :=
28else ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix)
Dan Willemsenbbe4e112019-06-12 17:13:28 +000029 my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)))
Dan Willemsen926ee442018-02-27 23:27:30 +000030 LOCAL_SRC_FILES_$(my_32_64_bit_suffix) :=
31else ifdef LOCAL_SRC_FILES
Dan Willemsenbbe4e112019-06-12 17:13:28 +000032 my_prebuilt_src_file := $(call clean-path,$(LOCAL_PATH)/$(LOCAL_SRC_FILES))
Dan Willemsen926ee442018-02-27 23:27:30 +000033 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
Jooyung Han36c1f672019-05-28 17:17:47 +090052else ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES EXECUTABLES NATIVE_TESTS,$(LOCAL_MODULE_CLASS)),)
Jaewoong Jungf22997e2019-03-20 10:35:43 -070053 include $(BUILD_SYSTEM)/cc_prebuilt_internal.mk
Jaewoong Jung3f2850e2019-11-11 09:30:38 -080054else ifneq ($(filter SCRIPT ETC DATA RENDERSCRIPT_BITCODE,$(LOCAL_MODULE_CLASS)),)
Jooyung Han36c1f672019-05-28 17:17:47 +090055 include $(BUILD_SYSTEM)/misc_prebuilt_internal.mk
56else
57 $(error $(LOCAL_MODULE) : unexpected LOCAL_MODULE_CLASS for prebuilts: $(LOCAL_MODULE_CLASS))
Colin Crosse18cb932014-02-13 15:04:18 -080058endif
Jaewoong Jung09bfe552019-03-18 14:25:00 -070059
Wei Li49933362023-01-04 17:13:47 -080060$(if $(filter-out $(SOONG_ANDROID_MK),$(LOCAL_MODULE_MAKEFILE)), \
61 $(eval ALL_MODULES.$(my_register_name).IS_PREBUILT_MAKE_MODULE := Y))
62
Dan Willemsen1c6dc5b2016-01-06 14:28:36 -080063$(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES)
Colin Crosse18cb932014-02-13 15:04:18 -080064
65my_prebuilt_src_file :=