Skip to contentSkip to conversation

Makefile: fix wrong dirs when making cscope

PATCH Superseded WANG Cong 2 participants 3 messages Nov 5, 2007 Kbuild

lore
Share & tools
lore

WANG Cong

author
#0 lore raw

PATCH 1/1 Makefile: fix wrong dirs when making cscope

Hi, Sam!

This patch fixed the following errors when doing "make cscope" and "make cscope ARCH=um".

FILELST cscope.files
find: arch/i386: No such file or directory
MAKE cscope.out

FILELST cscope.files
find: include/asm-i386: No such file or directory
MAKE cscope.out

Cc Sam Ravnborg <[email protected]>
---
 Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
Index: linux-2.6/Makefile
===================================================================
@@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
 endif
 
 define find-sources
-        ( for arch in $(ALLSOURCE_ARCHS) ; do \
+        ( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \
@@ -1331,7 +1331,7 @@ define find-sources
 	  find $(__srctree)include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name $1 -print; \
-	  for arch in $(ALLINCLUDE_ARCHS) ; do \
+	  for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \
#1 lore raw

Hi Wang.

Thanks for this fix, but I have a few comments. See below.

Quoted 28 lines · WANG Cong

Hi, Sam!

This patch fixed the following errors when doing "make cscope" and "make cscope ARCH=um".

FILELST cscope.files
find: arch/i386: No such file or directory
MAKE cscope.out

FILELST cscope.files
find: include/asm-i386: No such file or directory
MAKE cscope.out

Cc Sam Ravnborg <[email protected]>
---
 Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/Makefile
===================================================================

Makefile ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH) · line 1328

Quoted 8 lines
Makefile +1 -1
@@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
 endif
 
 define find-sources
-        ( for arch in $(ALLSOURCE_ARCHS) ; do \
+        ( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \

Could you change this such that the substitution takes places where we assign ALLSOURCE_ARCHS so all potential users benefit from this fix. And on top of this fix it so x86_64 is also replaced by x86 so we fix both x86 architectures.

Makefile define find-sources · line 1337

Quoted 10 lines
Makefile +1 -1
@@ -1331,7 +1331,7 @@ define find-sources
 	  find $(__srctree)include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name $1 -print; \
-	  for arch in $(ALLINCLUDE_ARCHS) ; do \
+	  for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \

Same comments for ALLINCLUDE_ARCHS

PS. Yout patch may be obsoleted by ongoing work to eliminate ARCH=i386 / ARCH=x86_64. But if/when this hits mainline I dunno so please do the requested changes and send me a new patch.

Tanks,
Sam

author
#2 lore raw
Quoted 35 lines · Sam Ravnborg

Hi Wang.

Thanks for this fix, but I have a few comments. See below.

Quoted 30 lines · WANG Cong

Hi, Sam!

This patch fixed the following errors when doing "make cscope" and "make cscope ARCH=um".

FILELST cscope.files
find: arch/i386: No such file or directory
MAKE cscope.out

FILELST cscope.files
find: include/asm-i386: No such file or directory
MAKE cscope.out

Cc Sam Ravnborg <[email protected]>
---
 Makefile |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: linux-2.6/Makefile
===================================================================

Makefile +0 -0
@@ -1322,7 +1322,7 @@ ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH)
 endif
 
Quoted 11 lines

Makefile ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH) · line 1328

Quoted 6 lines
Makefile +1 -1
 define find-sources
-        ( for arch in $(ALLSOURCE_ARCHS) ; do \
+        ( for arch in `echo $(ALLSOURCE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)arch/$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \

Could you change this such that the substitution takes places where we assign ALLSOURCE_ARCHS so all potential users benefit from this fix. And on top of this fix it so x86_64 is also replaced by x86 so we fix both x86 architectures.

OK. Thank you. I will try to do that. ;)

Quoted 14 lines

Makefile define find-sources · line 1337

Quoted 12 lines
Makefile +1 -1
@@ -1331,7 +1331,7 @@ define find-sources
 	  find $(__srctree)include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name $1 -print; \
-	  for arch in $(ALLINCLUDE_ARCHS) ; do \
+	  for arch in `echo $(ALLINCLUDE_ARCHS)|sed -e "s/i386/x86/"`; do \
 	       find $(__srctree)include/asm-$${arch} $(RCS_FIND_IGNORE) \
 	            -name $1 -print; \
 	  done ; \

Same comments for ALLINCLUDE_ARCHS

Quoted 3 lines

PS. Yout patch may be obsoleted by ongoing work to eliminate ARCH=i386 / ARCH=x86_64. But if/when this hits mainline I dunno so please do the requested changes and send me a new patch.

Sam, the root of this problem is the use of `uname -m' command. It always outputs 'i*86' on x86_32 machines. Unless this output changes or we find another way to determine the arch, we will always need to fix this.

New patch will come soon.

Thanks.

WANG Cong