views:

116

answers:

1

I'm building a an 'external' module ( device driver ), i.e. it's not in the Linux kernel source tree, but in a separate unrelated source tree.

I want to use ctags to browse variable / function declarations and definitions that are being pulled in from the kernel via header files.

For example assuming I have:

~/src/kernel-source
~/src/my_external_module

and I've run make tags for the kernel then how can I run ctags against my module so that it will pick up the tags from what is effectively a separate project in a different directory tree, in this case the Linux kernel source?

+1  A: 

If you care about tags files, you must be using them in an editor that uses them, such as vi. Instead of trying to combine tags files, how about telling vi about the additional tags file? Try adding the additional tags file to the 'tags' option:

 :set tags=./tags,tags,/home/myhome/Work/linux-2.6.31/tags,/home/myhome/Work/driver/tags

This sets up a tags search path in vi. See :help tags for more information.

Shannon Nelson
+1: Yes, I'm using vim. Assuming I start vim from `~/src/my_external_module` then all I should need to do is append `~/src/kernel-source` to my tag search path. Is that possible?
Robert S. Barnes
Give it a try, but yes, that should work.
Shannon Nelson