From d6a713f1478009aca115edf45941dcabbe419705 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 21 Jun 2025 16:56:30 -0500 Subject: [PATCH] make: ctags: Limited prototype tags to header files Jumping to prototypes in header files is extremely useful, because that's usually where all the documentation is. But jumping to prototypes in C files is a bit much. These are usually just uncomment definitions to keep the compiler happy, and make navigation a bit of a pain. Unfortunately it doesn't seem like ctags supports per-file-type tag kinds (at least I couldn't find it in the documentation), but running ctags twice with the --append flag seems to work. --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a04e1a98..8b90c633 100644 --- a/Makefile +++ b/Makefile @@ -201,11 +201,16 @@ size: $(OBJ) $(SIZE) -t $^ ## Generate a ctags file +# +# run twice to only include prototypes in header files .PHONY: tags ctags tags ctags: $(strip $(CTAGS) \ --totals --fields=+n --c-types=+p \ - $(shell find -H -name '*.h') $(SRC)) + $(shell find -H -name '*.h')) + $(strip $(CTAGS) \ + --totals --append --fields=+n \ + $(SRC)) ## Show this help text .PHONY: help