diff mbox series

rt-tests: Makefile: Restore support for Exuberant Ctags

Message ID 20231019065328.932835-1-minipli@grsecurity.net
State New
Headers show
Series rt-tests: Makefile: Restore support for Exuberant Ctags | expand

Commit Message

Mathias Krause Oct. 19, 2023, 6:53 a.m. UTC
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.

Signed-off-by: Mathias Krause <minipli@grsecurity.net>
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

John Kacur Oct. 19, 2023, 1:46 p.m. UTC | #1
On Thu, 19 Oct 2023, Mathias Krause wrote:

> 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.
> 
> Signed-off-by: Mathias Krause <minipli@grsecurity.net>
> ---
>  Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/Makefile b/Makefile
> index 223a839151ec..8d3268d19901 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -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 *
> -- 

Signed-off-by: John Kacur <jkacur@redhat.com>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 223a839151ec..8d3268d19901 100644
--- a/Makefile
+++ b/Makefile
@@ -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 *