From 8d5dc6be579b1fffa821f4b67d5df21244b469b6 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 26 Feb 2018 18:42:47 -0800 Subject: [PATCH] Better error for missing LOCAL_SRC_FILES in prebuilts If there's a prebuilt with LOCAL_MULTILIB := true, but only a single LOCAL_SRC_FILES entry, we end up with a weird build error where `cp` is trying to copy the local directory. Exit early with an error in this case. Bug: 73904572 Test: build-aosp_marlin.ninja is identical Change-Id: Ie2821817c237087a96e87fb9602e430e0f86584a --- core/prebuilt_internal.mk | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index cb1d4016d..d4f552231 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -20,19 +20,19 @@ my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT) ifdef LOCAL_PREBUILT_MODULE_FILE my_prebuilt_src_file := $(LOCAL_PREBUILT_MODULE_FILE) +else ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) + my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) + LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := +else ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix) + my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)) + LOCAL_SRC_FILES_$(my_32_64_bit_suffix) := +else ifdef LOCAL_SRC_FILES + my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) + LOCAL_SRC_FILES := +else ifdef LOCAL_REPLACE_PREBUILT_APK_INSTALLED + # This is handled specially below else - ifdef LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) - my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) - LOCAL_SRC_FILES_$($(my_prefix)$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH) := - else - ifdef LOCAL_SRC_FILES_$(my_32_64_bit_suffix) - my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES_$(my_32_64_bit_suffix)) - LOCAL_SRC_FILES_$(my_32_64_bit_suffix) := - else - my_prebuilt_src_file := $(LOCAL_PATH)/$(LOCAL_SRC_FILES) - LOCAL_SRC_FILES := - endif - endif + $(call pretty-error,No source files specified) endif LOCAL_CHECKED_MODULE := $(my_prebuilt_src_file)