Commit f81b1be4 authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Michal Marek

tags: include headers before source files

Currently looking up a structure definition in TAGS / tags takes one to
one of multiple "static struct X" definitions in arch sources, which makes
it for many structs practically impossible to get to the required header.
This patch changes the order of sources being tagged to first scan
architecture includes, then the top-level include/ directory, and only
then the rest. It also takes into account, that many architectures have
more than one include directory, i.e., not only arch/$ARCH/include, but
also arch/$ARCH/mach-X/include etc.
Signed-off-by: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: default avatarWANG Cong <xiyou.wangcong@gmail.com>
[mmarek@suse.cz: fix 'var+=text' bashism]
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent d0679c73
...@@ -32,13 +32,20 @@ fi ...@@ -32,13 +32,20 @@ fi
# find sources in arch/$ARCH # find sources in arch/$ARCH
find_arch_sources() 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 sources in arch/$1/include
find_arch_include_sources() 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/ # find sources in include/
...@@ -63,14 +70,15 @@ find_sources() ...@@ -63,14 +70,15 @@ find_sources()
all_sources() all_sources()
{ {
for arch in $ALLSOURCE_ARCHS find_arch_include_sources ${ARCH} '*.[chS]'
do
find_sources $arch '*.[chS]'
done
if [ ! -z "$archinclude" ]; then if [ ! -z "$archinclude" ]; then
find_arch_include_sources $archinclude '*.[chS]' find_arch_include_sources $archinclude '*.[chS]'
fi fi
find_include_sources '*.[chS]' find_include_sources '*.[chS]'
for arch in $ALLSOURCE_ARCHS
do
find_sources $arch '*.[chS]'
done
find_other_sources '*.[chS]' find_other_sources '*.[chS]'
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment