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
diff --git a/core/definitions.mk b/core/definitions.mk
index b578134..0347157 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2481,7 +2481,8 @@
$(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