Ticket #4195 (new enhancement)

Opened 4 years ago

Last modified 4 years ago

Makefile utility targets for tags

Reported by: psprint Owned by:
Priority: major Milestone: Future Releases
Component: mc-core Version: master
Keywords: ctags,tags,makefile,make Cc:
Blocked By: Blocking:
Branch state: no branch Votes for changeset:

Description

Hi,
the patch adds three Makefile targets:

  • tags-emacs, which generates the TAGS file ↔ the Emacs style tags (actually used by mcedit),
  • tags-vim, which generates the tags file with Vim-style tags,
  • tags, which generates both above,

… from a curated, well done ctags command invocation, with all the needed options like the recursion and search for C sources and e.g.: proper parsing of the headers (.h). The command is in two forms, first for Exuberant Ctags and the second one for Universal Ctags (there's a check for which one is being found).

Attachments

Makefile-tags-targets.patch (2.4 KB) - added by psprint 4 years ago.
Makefile-tags-targets_v2.patch (2.4 KB) - added by psprint 4 years ago.
Added extra tags for #include macros

Change History

Changed 4 years ago by psprint

Changed 4 years ago by psprint

Added extra tags for #include macros

comment:1 Changed 4 years ago by andrew_b

Unfortunately, this patch is useless if out-of-source build is used.

comment:2 follow-up: ↓ 3 Changed 4 years ago by psprint

I do not understand, could you please explain? Out-of-source build means AFAIK putting compiled objects in a subfolder and I don't see conflict with running ctags via top level Makefile?

The patch is of lesser importance, I thought that such targets would be cool and I'd sent it mostly for my own convenience…

comment:3 in reply to: ↑ 2 Changed 4 years ago by andrew_b

Replying to psprint:

Out-of-source build means AFAIK putting compiled objects in a subfolder

Build tree can be located in any place as far from source tree as you wish.

and I don't see conflict with running ctags via top level Makefile?

Top level Makefile created in the build tree, not in the source one. In the build tree, there are no c/h files excepting config.h, and only config.h is found by ctags.

BTW, the automake's built-in target ctags doesn't support of out-of-source build either.

Note: See TracTickets for help on using tickets.