Commit 709cc372 authored by Jiri Slaby's avatar Jiri Slaby Committed by Sam Ravnborg

kbuild: fix make tags/cscope

- fix combining O=... and tags
- don't allow * expansion during sh function calls
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
[sam: use KBUILD_SRC to check if we use O=...]
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 31110ebb
...@@ -18,28 +18,28 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \ ...@@ -18,28 +18,28 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
-prune -o" -prune -o"
# Do not use full path is we do not use O=.. builds # Do not use full path is we do not use O=.. builds
if [ ${src} == ${obj} ]; then if [ "${KBUILD_SRC}" == "" ]; then
tree= tree=
else else
tree=${srctree} tree=${srctree}/
fi 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; find ${tree}arch/$1 $ignore -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; find ${tree}arch/$1/include $ignore -name "$2" -print;
} }
# find sources in include/ # find sources in include/
find_include_sources() find_include_sources()
{ {
find ${tree}include $ignore -name config -prune -o -name $1 -print; find ${tree}include $ignore -name config -prune -o -name "$1" -print;
} }
# find sources in rest of tree # find sources in rest of tree
...@@ -48,27 +48,27 @@ find_other_sources() ...@@ -48,27 +48,27 @@ find_other_sources()
{ {
find ${tree}* $ignore \ find ${tree}* $ignore \
\( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-name $1 -print; -name "$1" -print;
} }
find_sources() find_sources()
{ {
find_arch_sources $1 $2 find_arch_sources $1 "$2"
find_include_sources $2 find_include_sources "$2"
find_other_sources $2 find_other_sources "$2"
} }
all_sources() all_sources()
{ {
find_sources $SRCARCH *.[chS] find_sources $SRCARCH '*.[chS]'
if [ ! -z "$archinclude" ]; then if [ ! -z "$archinclude" ]; then
find_arch_include_sources $archinclude *.[chS] find_arch_include_sources $archinclude '*.[chS]'
fi fi
} }
all_kconfigs() all_kconfigs()
{ {
find_sources $SRCARCH "Kconfig*" find_sources $SRCARCH 'Kconfig*'
} }
all_defconfigs() all_defconfigs()
......
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