Skip to contentSkip to conversation

makesystem: revive cscope target

PATCH In review Jiri Slaby 2 participants 6 messages Dec 10, 2008 – Dec 13, 2008 Kbuild

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 makesystem: revive cscope target

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

---
 Makefile        |    2 +-
 scripts/tags.sh |   22 +++++++++++-----------
 2 files changed, 12 insertions(+), 12 deletions(-)
Makefile +1 -1
index 8f4f626..a094d74 100644
@@ -156,7 +156,7 @@ obj		:= $(objtree)
 
 VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
-export srctree objtree VPATH TOPDIR
+export src obj srctree objtree VPATH TOPDIR
 
 
 # SUBARCH tells the usermode build what the underlying arch is.  That is set
scripts/tags.sh +11 -11
index 47274dc..3b7225c 100644
@@ -21,25 +21,25 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
 if [ ${src} == ${obj} ]; then
 	tree=
 else
-	tree=${srctree}
+	tree=${srctree}/
 fi
 
 # find sources in arch/$ARCH
 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_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_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
@@ -48,27 +48,27 @@ find_other_sources()
 {
 	find ${tree}* $ignore \
 	     \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-	       -name $1 -print;
+	       -name "$1" -print;
 }
 
 find_sources()
 {
-	find_arch_sources $1 $2
-	find_include_sources $2
-	find_other_sources $2
+	find_arch_sources $1 "$2"
+	find_include_sources "$2"
+	find_other_sources "$2"
 }
 
 all_sources()
 {
-	find_sources $SRCARCH *.[chS]
+	find_sources $SRCARCH '*.[chS]'
 	if [ ! -z "$archinclude" ]; then
-		find_arch_include_sources $archinclude *.[chS]
+		find_arch_include_sources $archinclude '*.[chS]'
 	fi
 }
 
 all_kconfigs()
 {
-	find_sources $SRCARCH "Kconfig*"
+	find_sources $SRCARCH 'Kconfig*'
 }
 
 all_defconfigs()
Signature · 1 line
1.6.0.5
#1 lore raw
Quoted 2 lines · Jiri Slaby

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

What benefit does this patch give us?
We do not use $obj neither $src in tags.sh.

Likewise we do not pass it non-expanded parameters.

Sam

author
#2 lore raw
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Jiri Slaby

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

What benefit does this patch give us?
We do not use $obj neither $src in tags.sh.

I'm confused...

git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-next.git says:
# Do not use full path is we do not use O=.. builds if [ ${src} == ${obj} ]; then
tree=
else

        tree=${srctree}

fi
in scripts/tags.sh.

Quoted 1 line

Likewise we do not pass it non-expanded parameters.

We do inside the script. Try to touch XYZ.S in your build tree, the tags.sh won't work then.

#3 lore raw
Quoted 16 lines · Jiri Slaby
Quoted 6 lines · Sam Ravnborg
Quoted 2 lines · Jiri Slaby

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

What benefit does this patch give us?
We do not use $obj neither $src in tags.sh.

I'm confused...

git kernel.org:/pub/scm/linux/kernel/git/sam/kbuild-next.git says:
# Do not use full path is we do not use O=.. builds if [ ${src} == ${obj} ]; then
tree=
else

Quoted 3 lines
        tree=${srctree}

fi
in scripts/tags.sh.

OK - forgot about that one.
Will apply your patches when I get at my Linux box.

Sam

author
#4 lore raw
Quoted 2 lines · Sam Ravnborg

OK - forgot about that one.
Will apply your patches when I get at my Linux box.

Ok, thanks.

#5 lore raw
In reply to Jiri Slaby
Quoted 5 lines · Jiri Slaby

- export src and obj, so that we can check them in tags.sh
- don't allow * expansion during sh function calls

I have applied a slightly modifed version.
See below.

Sam

From 6d97189e6862970911ec74cfeaadc3d9ed3e295a Mon Sep 17 00:00:00 2001
From: Jiri Slaby <[email protected]>
Date: Wed, 10 Dec 2008 13:10:13 +0100
Subject: [PATCH] kbuild fix make tags/cscope

- fix combining O=... and tags
- don't allow * expansion during sh function calls

[sam: use KBUILD_SRC to check if we use O=...]
---
 scripts/tags.sh |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)
scripts/tags.sh +12 -12
index 47274dc..3c814ba 100755
@@ -18,28 +18,28 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
           -prune -o"
 
 # Do not use full path is we do not use O=.. builds
-if [ ${src} == ${obj} ]; then
+if [ "${KBUILD_SRC}" == "" ]; then
 	tree=
 else
-	tree=${srctree}
+	tree=${srctree}/
 fi
 
 # find sources in arch/$ARCH
 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_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_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
@@ -48,27 +48,27 @@ find_other_sources()
 {
 	find ${tree}* $ignore \
 	     \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
-	       -name $1 -print;
+	       -name "$1" -print;
 }
 
 find_sources()
 {
-	find_arch_sources $1 $2
-	find_include_sources $2
-	find_other_sources $2
+	find_arch_sources $1 "$2"
+	find_include_sources "$2"
+	find_other_sources "$2"
 }
 
 all_sources()
 {
-	find_sources $SRCARCH *.[chS]
+	find_sources $SRCARCH '*.[chS]'
 	if [ ! -z "$archinclude" ]; then
-		find_arch_include_sources $archinclude *.[chS]
+		find_arch_include_sources $archinclude '*.[chS]'
 	fi
 }
 
 all_kconfigs()
 {
-	find_sources $SRCARCH "Kconfig*"
+	find_sources $SRCARCH 'Kconfig*'
 }
 
 all_defconfigs()
Signature · 1 line
1.5.6.GIT