The Emacs Wiki is often a good source for answers to common problems or best practices. For your specific problem there is a solution for both Windows and Unixen:
http://www.emacswiki.org/emacs/RecursiveTags#toc2
Basically you run a command to find all .cpp
and all .h
files (change file selectors if you use different file endings, such as e.g., .C
) and pipe the result into etags. Since Windows does not seem to have xargs, you need a more recent version of etags that can read from stdin (note the dash at the end of the line which symbolizes stdin). Of course, if you use a recent version of etags, you can use the dash parameter instead of xargs there, too.
Windows:
cd c:source-root
dir /b /s *.cpp *.h *.hpp | etags --your_options -
Unix:
cd /path/to/source-root
find . -name "*.cpp" -print -or -name "*.h" -print | xargs etags --append
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…