1#!/bin/sh 2 3# This file illustrates how to generate a useful TAGS file via etags 4# for emacs. This should be invoked from the top source directory i.e.: 5# > build/MakeEtags 6# and will create a TAGS file in the top source directory. 7 8# This script falls under the Apache License. 9# See http://www.apache.org/docs/LICENSE 10 11# Once you have created ./TAGS in emacs you'll need to setup 12# tag-table-alist with an entry to assure it finds the single ./TAGS 13# file from the many source directories. Something along these lines: 14# (setq tag-table-alist 15# '(("/home/me/work/apr-x.y/" . "/home/me/work/apr-x.y/") 16# ("/home/me/work/apr-util-x.y/" . "/home/me/work/apr-util-x.y/") 17# ("/home/me/work/httpd-x.y/" . "/home/me/work/httpd-x.y/") 18# )) 19 20# This requires a special version of etags, i.e. the 21# one called "Exuberant ctags" available at: 22# http://ctags.sourceforge.net/ 23# Once that is setup you'll need to point to the 24# executable here: 25 26etags=${ETAGS-etags} 27 28# Exuberant etags is necessary since it can ignore some defined symbols 29# that obscure the function signatures. 30 31ignore=AP_DECLARE,AP_DECLARE_NONSTD,__declspec,APR_DECLARE,APR_DECLARE_NONSTD 32ignore=$ignore,APU_DECLARE,APU_DECLARE_NONSTD 33 34# Create an etags file at the root of the source 35# tree, then create symbol links to it from each 36# directory in the source tree. By passing etags 37# absolute pathnames we get a tag file that is 38# NOT portable when we move the directory tree. 39 40find . -name '*.[ch]' -print | $etags -I "$ignore" -L - 41 42