Make the duplicate header copy warning more explicit

So that it's easier to understand which makefile is actually being used,
and which ones are being ignored.

Test: manually check the warnings on a device that sets BUILD_BROKEN_DUP_COPY_HEADERS
Change-Id: If9e29458eaa655b28e6b770d194d1da867cb8d16
This commit is contained in:
Dan Willemsen 2019-02-07 17:34:57 -08:00
parent 2b526bf7f3
commit f4249d1052

View file

@ -75,11 +75,17 @@ endef
has_dup_copy_headers := has_dup_copy_headers :=
$(foreach dest,$(ALL_COPIED_HEADERS), \ $(foreach dest,$(ALL_COPIED_HEADERS), \
$(eval _srcs := $(ALL_COPIED_HEADERS.$(dest).SRC)) \ $(eval _srcs := $(ALL_COPIED_HEADERS.$(dest).SRC)) \
$(eval _src := $(word $(words $(_srcs)),$(_srcs))) \ $(eval _src := $(lastword $(_srcs))) \
$(if $(call streq,$(_src),$(_srcs)),, \ $(if $(call streq,$(_src),$(_srcs)),, \
$(warning Duplicate header copy: $(dest)) \ $(warning Duplicate header copy: $(dest)) \
$(warning Defined in: $(ALL_COPIED_HEADERS.$(dest).MAKEFILE)) \ $(warning _ Using $(_src)) \
$(eval has_dup_copy_headers := true)) \ $(warning __ from $(lastword $(ALL_COPIED_HEADERS.$(dest).MAKEFILE))) \
$(eval _makefiles := $$(wordlist 1,$(call int_subtract,$(words $(ALL_COPIED_HEADERS.$(dest).MAKEFILE)),1),$$(ALL_COPIED_HEADERS.$$(dest).MAKEFILE))) \
$(foreach src,$(wordlist 1,$(call int_subtract,$(words $(_srcs)),1),$(_srcs)), \
$(warning _ Ignoring $(src)) \
$(warning __ from $(firstword $(_makefiles))) \
$(eval _makefiles := $$(wordlist 2,9999,$$(_makefiles)))) \
$(eval has_dup_copy_headers := true)) \
$(eval $(call copy-one-header,$(_src),$(dest)))) $(eval $(call copy-one-header,$(_src),$(dest))))
all_copied_headers: $(ALL_COPIED_HEADERS) all_copied_headers: $(ALL_COPIED_HEADERS)