-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sam Ravnborg
committed
Dec 3, 2008
1 parent
b33f7dc
commit 15346fc
Showing
3 changed files
with
164 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: f6682f915760ccfe57ef1b6cd5ff2d8f2bf8c1d4 | ||
refs/heads/master: a680eedc6c621c75695c68198533fc3c98f4053b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
#!/bin/sh | ||
# Generate tags or cscope files | ||
# Usage tags.sh <mode> | ||
# | ||
# mode may be any of: tags, TAGS, cscope | ||
# | ||
# Uses the following environment variables: | ||
# ARCH, SUBARCH, srctree, src, obj | ||
|
||
if [ $KBUILD_VERBOSE == 1 ]; then | ||
set -x | ||
fi | ||
|
||
# This is a duplicate of RCS_FIND_IGNORE without escaped '()' | ||
ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ | ||
-name CVS -o -name .pc -o -name .hg -o \ | ||
-name .git ) \ | ||
-prune -o" | ||
|
||
# Do not use full path is we do not use O=.. builds | ||
if [ ${src} == ${obj} ]; then | ||
tree= | ||
else | ||
tree=${srctree} | ||
fi | ||
|
||
# find sources in arch/$ARCH | ||
find_arch_sources() | ||
{ | ||
find ${tree}arch/$1 $ignore -name $2 -print; | ||
} | ||
|
||
# find sources in arch/$1/include | ||
find_arch_include_sources() | ||
{ | ||
find ${tree}arch/$1/include $ignore -name $2 -print; | ||
} | ||
|
||
# find sources in include/ | ||
find_include_sources() | ||
{ | ||
find ${tree}include $ignore -name config -prune -o -name $1 -print; | ||
} | ||
|
||
# find sources in rest of tree | ||
# we could benefit from a list of dirs to search in here | ||
find_other_sources() | ||
{ | ||
find ${tree}* $ignore \ | ||
\( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ | ||
-name $1 -print; | ||
} | ||
|
||
find_sources() | ||
{ | ||
find_arch_sources $1 $2 | ||
find_include_sources $2 | ||
find_other_sources $2 | ||
} | ||
|
||
all_sources() | ||
{ | ||
find_sources $SRCARCH *.[chS] | ||
if [ ! -z "$archinclude" ]; then | ||
find_arch_include_sources $archinclude *.[chS] | ||
fi | ||
} | ||
|
||
all_kconfigs() | ||
{ | ||
find_sources $SRCARCH "Kconfig*" | ||
} | ||
|
||
all_defconfigs() | ||
{ | ||
find_sources $SRCARCH "defconfig" | ||
} | ||
|
||
docscope() | ||
{ | ||
(echo \-k; echo \-q; all_sources) > cscope.files | ||
cscope -b -f cscope.out | ||
} | ||
|
||
exuberant() | ||
{ | ||
all_sources > all | ||
all_sources | xargs $1 -a \ | ||
-I __initdata,__exitdata,__acquires,__releases \ | ||
-I __read_mostly,____cacheline_aligned \ | ||
-I ____cacheline_aligned_in_smp \ | ||
-I ____cacheline_internodealigned_in_smp \ | ||
-I EXPORT_SYMBOL,EXPORT_SYMBOL_GPL \ | ||
--extra=+f --c-kinds=+px \ | ||
--regex-asm='/^ENTRY\(([^)]*)\).*/\1/' | ||
|
||
all_kconfigs | xargs $1 -a \ | ||
--langdef=kconfig --language-force=kconfig \ | ||
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/\2/' | ||
|
||
all_kconfigs | xargs $1 -a \ | ||
--langdef=kconfig --language-force=kconfig \ | ||
--regex-kconfig='/^[[:blank:]]*(menu|)config[[:blank:]]+([[:alnum:]_]+)/CONFIG_\2/' | ||
|
||
all_defconfigs | xargs -r $1 -a \ | ||
--langdef=dotconfig --language-force=dotconfig \ | ||
--regex-dotconfig='/^#?[[:blank:]]*(CONFIG_[[:alnum:]_]+)/\1/' | ||
|
||
} | ||
|
||
emacs() | ||
{ | ||
all_sources | xargs $1 -a | ||
|
||
all_kconfigs | xargs $1 -a \ | ||
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/\3/' | ||
|
||
all_kconfigs | xargs $1 -a \ | ||
--regex='/^[ \t]*\(\(menu\)*config\)[ \t]+\([a-zA-Z0-9_]+\)/CONFIG_\3/' | ||
|
||
all_defconfigs | xargs -r $1 -a \ | ||
--regex='/^#?[ \t]?\(CONFIG_[a-zA-Z0-9_]+\)/\1/' | ||
} | ||
|
||
xtags() | ||
{ | ||
if $1 --version 2>&1 | grep -iq exuberant; then | ||
exuberant $1 | ||
elif $1 --version 2>&1 | grep -iq emacs; then | ||
emacs $1 | ||
else | ||
all_sources | xargs $1 -a | ||
fi | ||
} | ||
|
||
|
||
# Support um (which uses SUBARCH) | ||
if [ ${ARCH} == um ]; then | ||
if [ $SUBARCH == i386 ]; then | ||
archinclude=x86 | ||
elif [ $SUBARCH == x86_64 ]; then | ||
archinclude=x86 | ||
else | ||
archinclude=${SUBARCH} | ||
fi | ||
fi | ||
|
||
case "$1" in | ||
"cscope") | ||
docscope | ||
;; | ||
|
||
"tags") | ||
xtags ctags | ||
;; | ||
|
||
"TAGS") | ||
xtags etags | ||
;; | ||
esac |