kbuild: reintroduce ALLSOURCE_ARCHS support for tags/cscope
authorJike Song <albcamus@gmail.com>
Mon, 5 Jan 2009 06:57:03 +0000 (14:57 +0800)
committerSam Ravnborg <sam@ravnborg.org>
Wed, 7 Jan 2009 20:44:21 +0000 (21:44 +0100)
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>
Documentation/kbuild/kbuild.txt
scripts/tags.sh

index 51771847e816d8905fc74465f0a82c75a5ccd0d9..923f9ddee8f6c4f5d90d74bb2dea3407dc43c428 100644 (file)
@@ -124,3 +124,10 @@ KBUILD_EXTRA_SYMBOLS
 --------------------------------------------------
 For modules use symbols from another modules.
 See more details in modules.txt.
+
+ALLSOURCE_ARCHS
+--------------------------------------------------
+For tags/TAGS/cscope targets, you can specify more than one archs
+to be included in the databases, separated by blankspace. e.g.
+
+    $ make ALLSOURCE_ARCHS="x86 mips arm" tags
index 9e3451d2c3a1d608b401c01685b841df02ae0550..fdbe78bb5e2b6ad8359aeabb26b0fcf98af44957 100755 (executable)
@@ -24,6 +24,11 @@ else
        tree=${srctree}/
 fi
 
+# Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
+if [ "${ALLSOURCE_ARCHS}" = "" ]; then
+       ALLSOURCE_ARCHS=${SRCARCH}
+fi
+
 # find sources in arch/$ARCH
 find_arch_sources()
 {
@@ -54,26 +59,29 @@ find_other_sources()
 find_sources()
 {
        find_arch_sources $1 "$2"
-       find_include_sources "$2"
-       find_other_sources "$2"
 }
 
 all_sources()
 {
-       find_sources $SRCARCH '*.[chS]'
+       for arch in $ALLSOURCE_ARCHS
+       do
+               find_sources $arch '*.[chS]'
+       done
        if [ ! -z "$archinclude" ]; then
                find_arch_include_sources $archinclude '*.[chS]'
        fi
+       find_include_sources '*.[chS]'
+       find_other_sources '*.[chS]'
 }
 
 all_kconfigs()
 {
-       find_sources $SRCARCH 'Kconfig*'
+       find_sources $ALLSOURCE_ARCHS 'Kconfig*'
 }
 
 all_defconfigs()
 {
-       find_sources $SRCARCH "defconfig"
+       find_sources $ALLSOURCE_ARCHS "defconfig"
 }
 
 docscope()