diff --git a/core/Makefile b/core/Makefile index 706b37155..3073f9166 100644 --- a/core/Makefile +++ b/core/Makefile @@ -12,9 +12,11 @@ LOCAL_PATH := $(BUILD_SYSTEM) # The filter part means "only eval the copy-one-file rule if this # src:dest pair is the first one to match the same dest" #$(1): the src:dest pair +#$(2): the dest define check-product-copy-files -$(if $(filter %.apk, $(call word-colon, 2, $(1))),$(error \ - Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!)) +$(if $(filter-out $(TARGET_COPY_OUT_SYSTEM_OTHER)/%,$(2)), \ + $(if $(filter %.apk, $(2)),$(error \ + Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!))) endef # filter out the duplicate : pairs. unique_product_copy_files_pairs := @@ -26,7 +28,7 @@ product_copy_files_ignored := $(foreach cf,$(unique_product_copy_files_pairs), \ $(eval _src := $(call word-colon,1,$(cf))) \ $(eval _dest := $(call word-colon,2,$(cf))) \ - $(call check-product-copy-files,$(cf)) \ + $(call check-product-copy-files,$(cf),$(_dest)) \ $(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \ $(eval product_copy_files_ignored += $(cf)), \ $(eval _fulldest := $(call append-path,$(PRODUCT_OUT),$(_dest))) \