From 8bce8c05bfed80590ea95ae3b1adaf16d7504f82 Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Wed, 5 Sep 2012 18:08:29 -0700 Subject: [PATCH] Remove duplicate src:dest pairs in PRODUCT_COPY_FILES Before setting up the rules. Change-Id: Ifedbc0e988895a899cae315dc730a152bae91ae2 --- core/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 066931fbd0f..22b0de3b869 100644 --- a/core/Makefile +++ b/core/Makefile @@ -35,8 +35,13 @@ define check-product-copy-files $(if $(filter %.apk, $(1)),$(error \ Prebuilt apk found in PRODUCT_COPY_FILES: $(1), use BUILD_PREBUILT instead!)) endef -unique_product_copy_files_destinations := +# filter out the duplicate : pairs. +unique_product_copy_files_pairs := $(foreach cf,$(PRODUCT_COPY_FILES), \ + $(if $(filter $(unique_product_copy_files_pairs),$(cf)),,\ + $(eval unique_product_copy_files_pairs += $(cf)))) +unique_product_copy_files_destinations := +$(foreach cf,$(unique_product_copy_files_pairs), \ $(eval _src := $(call word-colon,1,$(cf))) \ $(eval _dest := $(call word-colon,2,$(cf))) \ $(if $(filter $(unique_product_copy_files_destinations),$(_dest)), \ @@ -47,6 +52,7 @@ $(foreach cf,$(PRODUCT_COPY_FILES), \ $(eval $(call copy-one-file,$(_src),$(_fulldest)))) \ $(eval ALL_DEFAULT_INSTALLED_MODULES += $(_fulldest)) \ $(eval unique_product_copy_files_destinations += $(_dest)))) +unique_product_copy_files_pairs := unique_product_copy_files_destinations := # -----------------------------------------------------------------