From a151d5b8d1378a52a6023fa27b3f5d2e3d224a81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 2 Apr 2020 11:34:34 +0200 Subject: [PATCH 1/2] Improve ctags invocation in Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adding .function was necessary, as otherwise ctags would have no idea what to do with those files. Adding .h may not be necessary, as by default ctags considers them C++ which is probably good enough, but since we're tuning the mapping anyway... Signed-off-by: Manuel Pégourié-Gonnard --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1ae6bd991..65dccc58d 100644 --- a/Makefile +++ b/Makefile @@ -124,7 +124,7 @@ endif ## Editor navigation files C_SOURCE_FILES = $(wildcard include/*/*.h library/*.[hc] programs/*/*.[hc] tests/suites/*.function) tags: $(C_SOURCE_FILES) - ctags -o $@ $(C_SOURCE_FILES) + ctags -o $@ --langmap=c:+.h.function $(C_SOURCE_FILES) TAGS: $(C_SOURCE_FILES) etags -o $@ $(C_SOURCE_FILES) GPATH GRTAGS GSYMS GTAGS: $(C_SOURCE_FILES) From 6c2908ea5f0e58798a050b75b6f0eaa847120550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 2 Apr 2020 12:10:45 +0200 Subject: [PATCH 2/2] Allow alternative ctags versions in Makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manuel Pégourié-Gonnard --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 65dccc58d..0a9640fc3 100644 --- a/Makefile +++ b/Makefile @@ -123,8 +123,10 @@ endif ## Editor navigation files C_SOURCE_FILES = $(wildcard include/*/*.h library/*.[hc] programs/*/*.[hc] tests/suites/*.function) +# Exuberant-ctags invocation. Other ctags implementations may require different options. +CTAGS = ctags --langmap=c:+.h.function -o tags: $(C_SOURCE_FILES) - ctags -o $@ --langmap=c:+.h.function $(C_SOURCE_FILES) + $(CTAGS) $@ $(C_SOURCE_FILES) TAGS: $(C_SOURCE_FILES) etags -o $@ $(C_SOURCE_FILES) GPATH GRTAGS GSYMS GTAGS: $(C_SOURCE_FILES)