Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 1 | ########################################################### |
| 2 | ## Standard rules for copying files that are prebuilt |
| 3 | ## |
| 4 | ## Additional inputs from base_rules.make: |
| 5 | ## None. |
| 6 | ## |
| 7 | ########################################################### |
| 8 | |
Chih-Hung Hsieh | 32427d6 | 2018-04-12 10:55:54 -0700 | [diff] [blame] | 9 | include $(BUILD_SYSTEM)/use_lld_setup.mk |
| 10 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 11 | ifneq ($(LOCAL_PREBUILT_LIBS),) |
Colin Cross | 8466769 | 2018-06-25 13:20:04 -0700 | [diff] [blame] | 12 | $(call pretty-error,dont use LOCAL_PREBUILT_LIBS anymore) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 13 | endif |
| 14 | ifneq ($(LOCAL_PREBUILT_EXECUTABLES),) |
Colin Cross | 8466769 | 2018-06-25 13:20:04 -0700 | [diff] [blame] | 15 | $(call pretty-error,dont use LOCAL_PREBUILT_EXECUTABLES anymore) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 16 | endif |
| 17 | ifneq ($(LOCAL_PREBUILT_JAVA_LIBRARIES),) |
Colin Cross | 8466769 | 2018-06-25 13:20:04 -0700 | [diff] [blame] | 18 | $(call pretty-error,dont use LOCAL_PREBUILT_JAVA_LIBRARIES anymore) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 19 | endif |
| 20 | |
Ying Wang | 34d5f1b | 2014-05-16 10:38:43 -0700 | [diff] [blame] | 21 | my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32) |
| 22 | |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 23 | ifdef LOCAL_PREBUILT_MODULE_FILE |
Ying Wang | c0adfb7 | 2014-02-27 14:10:53 -0800 | [diff] [blame] | 24 | my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) |
Dan Willemsen | 926ee44 | 2018-02-27 23:27:30 +0000 | [diff] [blame] | 25 | else 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) := |
| 28 | else 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) := |
| 31 | else ifdef LOCAL_SRC_FILES |
| 32 | my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) |
| 33 | LOCAL_SRC_FILES := |
| 34 | else ifdef LOCAL_REPLACE_PREBUILT_APK_INSTALLED |
Jaewoong Jung | f22997e | 2019-03-20 10:35:43 -0700 | [diff] [blame] | 35 | # This is handled specially in app_prebuilt_internal.mk |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 36 | else |
Dan Willemsen | 926ee44 | 2018-02-27 23:27:30 +0000 | [diff] [blame] | 37 | $(call pretty-error,No source files specified) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 38 | endif |
| 39 | |
Colin Cross | 01e1b8f | 2016-10-27 22:10:55 +0000 | [diff] [blame] | 40 | LOCAL_CHECKED_MODULE := $(my_prebuilt_src_file) |
| 41 | |
Jaewoong Jung | f22997e | 2019-03-20 10:35:43 -0700 | [diff] [blame] | 42 | ifneq (APPS,$(LOCAL_MODULE_CLASS)) |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 43 | ifdef LOCAL_COMPRESSED_MODULE |
| 44 | $(error $(LOCAL_MODULE) : LOCAL_COMPRESSED_MODULE can only be defined for module class APPS) |
| 45 | endif # LOCAL_COMPRESSED_MODULE |
Jaewoong Jung | f22997e | 2019-03-20 10:35:43 -0700 | [diff] [blame] | 46 | endif # APPS |
Narayan Kamath | 7c20510 | 2017-08-07 12:31:17 +0100 | [diff] [blame] | 47 | |
Jaewoong Jung | f22997e | 2019-03-20 10:35:43 -0700 | [diff] [blame] | 48 | ifeq (APPS,$(LOCAL_MODULE_CLASS)) |
| 49 | include $(BUILD_SYSTEM)/app_prebuilt_internal.mk |
| 50 | else ifeq (JAVA_LIBRARIES,$(LOCAL_MODULE_CLASS)) |
| 51 | include $(BUILD_SYSTEM)/java_prebuilt_internal.mk |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 52 | else |
Jaewoong Jung | f22997e | 2019-03-20 10:35:43 -0700 | [diff] [blame] | 53 | # TODO(jungjw): Check LOCAL_MODULE_CLASS value and generate an error for unexpected ones. |
| 54 | include $(BUILD_SYSTEM)/cc_prebuilt_internal.mk |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 55 | endif |
Jaewoong Jung | 09bfe55 | 2019-03-18 14:25:00 -0700 | [diff] [blame] | 56 | |
Dan Willemsen | 1c6dc5b | 2016-01-06 14:28:36 -0800 | [diff] [blame] | 57 | $(built_module) : $(LOCAL_ADDITIONAL_DEPENDENCIES) |
Colin Cross | e18cb93 | 2014-02-13 15:04:18 -0800 | [diff] [blame] | 58 | |
| 59 | my_prebuilt_src_file := |
Mathieu Chartier | 55eabd5 | 2017-09-15 13:40:48 -0700 | [diff] [blame] | 60 | my_preopt_for_extracted_apk := |