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.
This commit is contained in:
Christopher Haster
2025-06-21 16:56:30 -05:00
parent f967cad907
commit d6a713f147
+6 -1
View File
@@ -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