Commit f81b1be40c44b33b9706d64c117edd29e627ad12

Authored by Guennadi Liakhovetski
Committed by Michal Marek
1 parent d0679c7303

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: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
[mmarek@suse.cz: fix 'var+=text' bashism]
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 1 changed file with 14 additions and 6 deletions Side-by-side Diff

... ... @@ -32,13 +32,20 @@
32 32 # find sources in arch/$ARCH
33 33 find_arch_sources()
34 34 {
35   - find ${tree}arch/$1 $ignore -name "$2" -print;
  35 + for i in $archincludedir; do
  36 + prune="$prune -wholename $i -prune -o"
  37 + done
  38 + find ${tree}arch/$1 $ignore $prune -name "$2" -print;
36 39 }
37 40  
38 41 # find sources in arch/$1/include
39 42 find_arch_include_sources()
40 43 {
41   - find ${tree}arch/$1/include $ignore -name "$2" -print;
  44 + include=$(find ${tree}arch/$1/ -name include -type d);
  45 + if [ -n "$include" ]; then
  46 + archincludedir="$archincludedir $include"
  47 + find $include $ignore -name "$2" -print;
  48 + fi
42 49 }
43 50  
44 51 # find sources in include/
45 52  
... ... @@ -63,14 +70,15 @@
63 70  
64 71 all_sources()
65 72 {
66   - for arch in $ALLSOURCE_ARCHS
67   - do
68   - find_sources $arch '*.[chS]'
69   - done
  73 + find_arch_include_sources ${ARCH} '*.[chS]'
70 74 if [ ! -z "$archinclude" ]; then
71 75 find_arch_include_sources $archinclude '*.[chS]'
72 76 fi
73 77 find_include_sources '*.[chS]'
  78 + for arch in $ALLSOURCE_ARCHS
  79 + do
  80 + find_sources $arch '*.[chS]'
  81 + done
74 82 find_other_sources '*.[chS]'
75 83 }
76 84