Skip to contentSkip to conversation

rt-tests: Makefile: Restore support for Exuberant Ctags

PATCH In review Mathias Krause 2 participants 2 messages Oct 19, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt-tests: Makefile: Restore support for Exuberant Ctags

Commit 974241c78a6f ("rt-tests: Makefile: ctags: Change obsolete extra to extras") is Universal Ctags specific and broke Exuberant Ctags.

Restore support for Exuberant Ctags by automatically detecting which variant to use.

---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Makefile +6 -1
index 223a839151ec..8d3268d19901 100644
@@ -251,6 +251,11 @@ help:
 	@echo "    tarball   :  make a rt-tests tarball suitable for release"
 	@echo "    help      :  print this message"
 
+# Universal Ctags warns about the backward compatible option '--extra' and
+# wants it to be called '--extras'.
+CTAGS_BIN = ctags
+CTAGS_EXTRA := $(shell $(CTAGS_BIN) --version 2>&1 | grep -iq universal && echo extras || echo extra)
+
 .PHONY: tags
 tags:
-	ctags -R --extras=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *
+	$(CTAGS_BIN) -R --$(CTAGS_EXTRA)=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *
Signature · 1 line
2.30.2
#1 lore raw
Quoted 19 lines · Mathias Krause

Commit 974241c78a6f ("rt-tests: Makefile: ctags: Change obsolete extra to extras") is Universal Ctags specific and broke Exuberant Ctags.

Restore support for Exuberant Ctags by automatically detecting which variant to use.

---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Makefile +0 -0
index 223a839151ec..8d3268d19901 100644
@@ -251,6 +251,11 @@ help:
 	@echo "    tarball   :  make a rt-tests tarball suitable for release"
 	@echo "    help      :  print this message"

Makefile help: · line 261

Quoted 10 lines
Makefile +6 -1
 
+# Universal Ctags warns about the backward compatible option '--extra' and
+# wants it to be called '--extras'.
+CTAGS_BIN = ctags
+CTAGS_EXTRA := $(shell $(CTAGS_BIN) --version 2>&1 | grep -iq universal && echo extras || echo extra)
+
 .PHONY: tags
 tags:
-	ctags -R --extras=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *
+	$(CTAGS_BIN) -R --$(CTAGS_EXTRA)=+f --c-kinds=+p --exclude=tmp --exclude=BUILD *