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:
@@ -201,11 +201,16 @@ size: $(OBJ)
|
|||||||
$(SIZE) -t $^
|
$(SIZE) -t $^
|
||||||
|
|
||||||
## Generate a ctags file
|
## Generate a ctags file
|
||||||
|
#
|
||||||
|
# run twice to only include prototypes in header files
|
||||||
.PHONY: tags ctags
|
.PHONY: tags ctags
|
||||||
tags ctags:
|
tags ctags:
|
||||||
$(strip $(CTAGS) \
|
$(strip $(CTAGS) \
|
||||||
--totals --fields=+n --c-types=+p \
|
--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
|
## Show this help text
|
||||||
.PHONY: help
|
.PHONY: help
|
||||||
|
|||||||
Reference in New Issue
Block a user