From c91284dcd8ade4546375537e24bfee430d63b740 Mon Sep 17 00:00:00 2001 From: nelsonli Date: Fri, 5 Oct 2018 16:58:14 +0800 Subject: [PATCH] Build System: Ignore copies in copy-many-files if src == dst BUG: 117224272 Test: 1. Modify build/core/base_rules.mk Add the following line after line 617 $(eval my_compat_dist_$(suite) += out/a:out/a)) 2. touch out/a 3. make -j BluetoothInstrumentationTests 4. It should build pass without any dependency errors. Change-Id: I40372eab5b74e042f605c3cb38e72942531ed69a --- core/definitions.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index b57813491d..0347157030 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2481,7 +2481,8 @@ $(foreach f, $(1), $(strip \ $(eval _cmf_tuple := $(subst :, ,$(f))) \ $(eval _cmf_src := $(word 1,$(_cmf_tuple))) \ $(eval _cmf_dest := $(word 2,$(_cmf_tuple))) \ - $(eval $(call copy-one-file,$(_cmf_src),$(_cmf_dest))) \ + $(if $(filter-out $(_cmf_src), $(_cmf_dest)), \ + $(eval $(call copy-one-file,$(_cmf_src),$(_cmf_dest)))) \ $(_cmf_dest))) endef