X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=scripts%2Ftags.sh;h=caa867dba16de32aad4a2494e2f3d04bdb3d6f86;hb=4431d4ce996de2cd2c45583209ba0dbbc9bf2795;hp=d52f7a01557c1b28cf3155a640c175ce613558aa;hpb=ef26b1691d11e17af205a4ff9c91458d931d11db;p=pandora-kernel.git diff --git a/scripts/tags.sh b/scripts/tags.sh index d52f7a01557c..caa867dba16d 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -5,7 +5,7 @@ # mode may be any of: tags, TAGS, cscope # # Uses the following environment variables: -# ARCH, SUBARCH, srctree, src, obj +# ARCH, SUBARCH, SRCARCH, srctree, src, obj if [ "$KBUILD_VERBOSE" = "1" ]; then set -x @@ -17,7 +17,7 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ -name .git ) \ -prune -o" -# Do not use full path is we do not use O=.. builds +# Do not use full path if we do not use O=.. builds if [ "${KBUILD_SRC}" = "" ]; then tree= else @@ -32,13 +32,20 @@ fi # find sources in arch/$ARCH find_arch_sources() { - find ${tree}arch/$1 $ignore -name "$2" -print; + for i in $archincludedir; do + prune="$prune -wholename $i -prune -o" + done + find ${tree}arch/$1 $ignore $prune -name "$2" -print; } # find sources in arch/$1/include find_arch_include_sources() { - find ${tree}arch/$1/include $ignore -name "$2" -print; + include=$(find ${tree}arch/$1/ -name include -type d); + if [ -n "$include" ]; then + archincludedir="$archincludedir $include" + find $include $ignore -name "$2" -print; + fi } # find sources in include/ @@ -63,14 +70,15 @@ find_sources() all_sources() { - for arch in $ALLSOURCE_ARCHS - do - find_sources $arch '*.[chS]' - done + find_arch_include_sources ${SRCARCH} '*.[chS]' if [ ! -z "$archinclude" ]; then find_arch_include_sources $archinclude '*.[chS]' fi find_include_sources '*.[chS]' + for arch in $ALLSOURCE_ARCHS + do + find_sources $arch '*.[chS]' + done find_other_sources '*.[chS]' } @@ -89,7 +97,13 @@ all_defconfigs() docscope() { - (echo \-k; echo \-q; all_sources) > cscope.files + # always use absolute paths for cscope, as recommended by cscope + # upstream + case "$tree" in + /*) ;; + *) tree=$PWD/$tree ;; + esac + (cd /; echo \-k; echo \-q; all_sources) > cscope.files cscope -b -f cscope.out }