Commit 4f628248a578585472e19e4cba2c604643af8c6c

Authored by Jike Song
Committed by Sam Ravnborg
1 parent 40c8c85a47

kbuild: reintroduce ALLSOURCE_ARCHS support for tags/cscope

This patch reintroduce the ALLSOURCE_ARCHS support for tags/TAGS/
cscope targets. The Kbuild previously has this feature, but after
moving the targets into scripts/tags.sh, ALLSOURCE_ARCHS disappears.

It's something like this:

	$ make ALLSOURCE_ARCHS="x86 mips arm" tags cscope

Signed-off-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

Showing 2 changed files with 20 additions and 5 deletions Side-by-side Diff

Documentation/kbuild/kbuild.txt
... ... @@ -124,4 +124,11 @@
124 124 --------------------------------------------------
125 125 For modules use symbols from another modules.
126 126 See more details in modules.txt.
  127 +
  128 +ALLSOURCE_ARCHS
  129 +--------------------------------------------------
  130 +For tags/TAGS/cscope targets, you can specify more than one archs
  131 +to be included in the databases, separated by blankspace. e.g.
  132 +
  133 + $ make ALLSOURCE_ARCHS="x86 mips arm" tags
... ... @@ -24,6 +24,11 @@
24 24 tree=${srctree}/
25 25 fi
26 26  
  27 +# Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
  28 +if [ "${ALLSOURCE_ARCHS}" = "" ]; then
  29 + ALLSOURCE_ARCHS=${SRCARCH}
  30 +fi
  31 +
27 32 # find sources in arch/$ARCH
28 33 find_arch_sources()
29 34 {
30 35  
31 36  
32 37  
33 38  
... ... @@ -54,26 +59,29 @@
54 59 find_sources()
55 60 {
56 61 find_arch_sources $1 "$2"
57   - find_include_sources "$2"
58   - find_other_sources "$2"
59 62 }
60 63  
61 64 all_sources()
62 65 {
63   - find_sources $SRCARCH '*.[chS]'
  66 + for arch in $ALLSOURCE_ARCHS
  67 + do
  68 + find_sources $arch '*.[chS]'
  69 + done
64 70 if [ ! -z "$archinclude" ]; then
65 71 find_arch_include_sources $archinclude '*.[chS]'
66 72 fi
  73 + find_include_sources '*.[chS]'
  74 + find_other_sources '*.[chS]'
67 75 }
68 76  
69 77 all_kconfigs()
70 78 {
71   - find_sources $SRCARCH 'Kconfig*'
  79 + find_sources $ALLSOURCE_ARCHS 'Kconfig*'
72 80 }
73 81  
74 82 all_defconfigs()
75 83 {
76   - find_sources $SRCARCH "defconfig"
  84 + find_sources $ALLSOURCE_ARCHS "defconfig"
77 85 }
78 86  
79 87 docscope()