[PATCH] Makefile: dedup git-ls-files output to prevent duplicate targets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Jiang Xin <zhiyou.jx@xxxxxxxxxxxxxxx>

If there are unresolved conflicts left in the working tree, "make" may
report warnings as follows:

    Makefile:xxxx: target '.build/pot/po/FOO.c.po' given more than once
                   in the same rule

The duplicate targets are introduced by the following pattern rule we
added in the preceding commit for incremental build of "po/git.pot",

    $(LOCALIZED_C_GEN_PO): .build/pot/po/%.po: %

and the duplicate entries in $(LOCALIZED_C_GEN_PO) come from the
"git ls-files" command in SOURCES_CMD.

We can pass the option "--deduplicate" to git-ls-files to suppress
duplicate entries for unresolved conflicts.

Reported-by: Junio C Hamano <gitster@xxxxxxxxx>
Signed-off-by: Jiang Xin <zhiyou.jx@xxxxxxxxxxxxxxx>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index a3f8446de9..a8880ed482 100644
--- a/Makefile
+++ b/Makefile
@@ -846,7 +846,7 @@ generated-hdrs: $(GENERATED_H)
 ## Exhaustive lists of our source files, either dynamically generated,
 ## or hardcoded.
 SOURCES_CMD = ( \
-	git ls-files \
+	git ls-files --deduplicate \
 		'*.[hcS]' \
 		'*.sh' \
 		':!*[tp][0-9][0-9][0-9][0-9]*' \
-- 
2.36.0.1.g15c4090757




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux