Merge "Make the duplicate header copy warning more explicit"

This commit is contained in:
Treehugger Robot
2019-02-08 09:15:38 +00:00
committed by Gerrit Code Review

View File

@@ -75,11 +75,17 @@ endef
has_dup_copy_headers :=
$(foreach dest,$(ALL_COPIED_HEADERS), \
$(eval _srcs := $(ALL_COPIED_HEADERS.$(dest).SRC)) \
$(eval _src := $(word $(words $(_srcs)),$(_srcs))) \
$(eval _src := $(lastword $(_srcs))) \
$(if $(call streq,$(_src),$(_srcs)),, \
$(warning Duplicate header copy: $(dest)) \
$(warning Defined in: $(ALL_COPIED_HEADERS.$(dest).MAKEFILE)) \
$(eval has_dup_copy_headers := true)) \
$(warning _ Using $(_src)) \
$(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))))
all_copied_headers: $(ALL_COPIED_HEADERS)