Skip to contentSkip to conversation

Fix TAGS creation

PATCH Applied David Gibson 4 participants 4 messages Mar 12, 2013 – Mar 19, 2013 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix TAGS creation

Currently the Makefile creates TAGS for emacs with the command:

    find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags

That works only if xargs ends up invoking etags just once. If xargs runs etags several times, as it will if there are enough files, then the later invocations will overwrite the output from the earlier invocations. This patch uses the etags --append option to fix the bug.

---
v2: Improved portability based on suggest from Markus Armbruster.

---
 Makefile |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile +2 -1
index 12c7662..6915178 100644
@@ -334,7 +334,8 @@ test speed: all
 
 .PHONY: TAGS
 TAGS:
-	find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags
+	rm -f $@
+	find "$(SRC_PATH)" -name '*.[hc]' -exec etags --append {} +
 
 cscope:
 	rm -f ./cscope.*
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · David Gibson

Currently the Makefile creates TAGS for emacs with the command:

    find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags

That works only if xargs ends up invoking etags just once. If xargs runs etags several times, as it will if there are enough files, then the later invocations will overwrite the output from the earlier invocations. This patch uses the etags --append option to fix the bug.

#2 lore raw
Quoted 9 lines · Markus Armbruster
Quoted 7 lines · David Gibson

Currently the Makefile creates TAGS for emacs with the command:

    find "$(SRC_PATH)" -name '*.[hc]' -print0 | xargs -0 etags

That works only if xargs ends up invoking etags just once. If xargs runs etags several times, as it will if there are enough files, then the later invocations will overwrite the output from the earlier invocations. This patch uses the etags --append option to fix the bug.

Quoted 3 lines
Quoted 1 line

Anyone? Anyone? Please apply?

Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson