* ctags as generated by make tags
@ 2001-05-29 3:30 Mark Frazer
2001-05-29 17:21 ` Pete Wyckoff
0 siblings, 1 reply; 2+ messages in thread
From: Mark Frazer @ 2001-05-29 3:30 UTC (permalink / raw)
To: Linux Kernel
Anyone have any good tips on getting tags to generate nicely?
I'm having some problems with some tags for macros and such being
declared in several places since ctags doesn't honour any CPP #if'ing.
I've currently got my Makefile doing this, which seems to give me some
sanity as the redefinitions tend to be made by drivers and such.
I'm basically walking the include tree by depth without doing any sorting
of tags and then doing a stable sort on the final tags file.
--- Makefile.old Mon May 28 22:44:01 2001
+++ Makefile Mon May 28 23:19:07 2001
@@ -334,10 +334,28 @@
# Exuberant ctags works better with -I
tags: dummy
- CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "-I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
+ CTAGSF=`ctags --version | grep -i exuberant >/dev/null && echo "--sort=no -I __initdata,__exitdata,EXPORT_SYMBOL,EXPORT_SYMBOL_NOVERS"`; \
ctags $$CTAGSF `find include/asm-$(ARCH) -name '*.h'` && \
- find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 2 -maxdepth 2 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 3 -maxdepth 3 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 4 -maxdepth 4 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
+ find include -type f -name '*.h' -mindepth 5 -maxdepth 5 \
+ | grep -v include/asm- | grep -v include/config \
+ | xargs -r ctags $$CTAGSF -a && \
find $(SUBDIRS) init -name '*.c' | xargs ctags $$CTAGSF -a
+ mv tags tags.unsorted
+ LC_ALL=C sort -k 1,1 -s tags.unsorted > tags
+ rm tags.unsorted
+
+#
+#find include -type d \( -name "asm-*" -o -name config \) -prune -o -name '*.h' -print | xargs ctags $$CTAGSF -a && \
+#
ifdef CONFIG_MODULES
ifdef CONFIG_MODVERSIONS
Anyone else doing anything smarter?
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ctags as generated by make tags
2001-05-29 3:30 ctags as generated by make tags Mark Frazer
@ 2001-05-29 17:21 ` Pete Wyckoff
0 siblings, 0 replies; 2+ messages in thread
From: Pete Wyckoff @ 2001-05-29 17:21 UTC (permalink / raw)
To: Linux Kernel
mark@somanetworks.com said:
> Anyone have any good tips on getting tags to generate nicely?
>
> I'm having some problems with some tags for macros and such being
> declared in several places since ctags doesn't honour any CPP #if'ing.
> I've currently got my Makefile doing this, which seems to give me some
> sanity as the redefinitions tend to be made by drivers and such.
Like net_device gets redefined or typedefed in a bunch of drivers
striving for backward compatibility.
> I'm basically walking the include tree by depth without doing any sorting
> of tags and then doing a stable sort on the final tags file.
I wrote a little perl script to post-process the tags file to sort
duplicate entries that are "more important" to the top, where that means
struct >> typedef >> union >> ... >> #define >> ...
So vim goes to the "real" definition of net_device first, before any of
the overridies in the drivers.
See http://www.osc.edu/~pw/index.html#tags for the script, and a
more complete set of ignores.
-- Pete
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-05-29 17:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-29 3:30 ctags as generated by make tags Mark Frazer
2001-05-29 17:21 ` Pete Wyckoff
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox