Skip to contentSkip to conversation

Allow `make O=<obj> {cscope,tags}` to work

PATCH In review George G. Davis 2 participants 5 messages Jul 19, 2004 – Jul 22, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Allow `make O=<obj> {cscope,tags}` to work

Greetings,

Here's a trivial fix to allow make O=<obj> {cscope,tags} to work:

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/07/19 12:49:14-04:00 [email protected]
# Makefile:
# Allow make O=<obj> {cscope,tags} to work
#
# Makefile
# 2004/07/19 12:28:02-04:00 [email protected] +9 -9
# Allow make O=<obj> {cscope,tags} to work
#

Makefile +9 -9
diff -Nru a/Makefile b/Makefile
@@ -1009,26 +1009,26 @@
 # ---------------------------------------------------------------------------
 
 define all-sources
-	( find . $(RCS_FIND_IGNORE) \
+	( find $(srctree) $(RCS_FIND_IGNORE) \
 	       \( -name include -o -name arch \) -prune -o \
 	       -name '*.[chS]' -print; \
-	  find arch/$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find security/selinux/include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name '*.[chS]' -print; \
-	  find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include/asm-generic $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print )
 endef
 
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = $(all-sources) > cscope.files
+quiet_cmd_cscope-file = FILELST $(obj)/cscope.files
+      cmd_cscope-file = $(all-sources) > $(obj)/cscope.files
 
-quiet_cmd_cscope = MAKE    cscope.out
+quiet_cmd_cscope = MAKE    $(obj)/cscope.out
       cmd_cscope = cscope -k -b -q
 
 cscope: FORCE

--
Regards,
George

#1 lore raw
Quoted 33 lines · George G. Davis

Greetings,

Here's a trivial fix to allow make O=<obj> {cscope,tags} to work:

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/07/19 12:49:14-04:00 [email protected]
# Makefile:
# Allow make O=<obj> {cscope,tags} to work
#
# Makefile
# 2004/07/19 12:28:02-04:00 [email protected] +9 -9
# Allow make O=<obj> {cscope,tags} to work
#
diff -Nru a/Makefile b/Makefile

Makefile +3 -3
@@ -1009,26 +1009,26 @@
 # ---------------------------------------------------------------------------
 
 define all-sources
-	( find . $(RCS_FIND_IGNORE) \
+	( find $(srctree) $(RCS_FIND_IGNORE) \
 	       \( -name include -o -name arch \) -prune -o \
 	       -name '*.[chS]' -print; \
-	  find arch/$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find security/selinux/include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \

Makefile line 1025

Quoted 10 lines
Makefile +3 -3
-	  find include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name '*.[chS]' -print; \
-	  find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include/asm-generic $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print )

OK so far.

Makefile line 1029

Quoted 6 lines
Makefile +2 -2
 endef
 
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = $(all-sources) > cscope.files
+quiet_cmd_cscope-file = FILELST $(obj)/cscope.files
+      cmd_cscope-file = $(all-sources) > $(obj)/cscope.files

The $(obj) in this line should not be needed. Current directory defaults to $(obj) equals $(objtree) when executing make cscope.

Sam

#2 lore raw
Quoted 1 line · On Mon, Jul 19, 2004 at 09:24:30PM +0200, [email protected] wrote:

On Mon, Jul 19, 2004 at 01:17:59PM -0400, George G. Davis wrote:

<snip>

Quoted 8 lines

Makefile line 1029

Quoted 6 lines

endef

Makefile +2 -2
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = $(all-sources) > cscope.files
+quiet_cmd_cscope-file = FILELST $(obj)/cscope.files
+      cmd_cscope-file = $(all-sources) > $(obj)/cscope.files

The $(obj) in this line should not be needed. Current directory defaults to $(obj) equals $(objtree) when executing make cscope.

Yep, I got carried away there, Thanks. Should I resubmit a revised patch?

TIA!

--
Regards,
George

#3 lore raw
Quoted 7 lines · George G. Davis
Quoted 1 line · On Mon, Jul 19, 2004 at 09:24:30PM +0200, [email protected] wrote:

On Mon, Jul 19, 2004 at 01:17:59PM -0400, George G. Davis wrote:

<snip>

Quoted 2 lines
Quoted 2 lines

endef

Quoted 8 lines
Quoted 6 lines

Review

Quoted 4 lines
(quoted diff) +2 -2
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = $(all-sources) > cscope.files
+quiet_cmd_cscope-file = FILELST $(obj)/cscope.files
+      cmd_cscope-file = $(all-sources) > $(obj)/cscope.files

The $(obj) in this line should not be needed. Current directory defaults to $(obj) equals $(objtree) when executing make cscope.

Yep, I got carried away there, Thanks. Should I resubmit a revised patch?

Ok, after clutzing about with bk fix, etc., here's the revised patch:

# This is a BitKeeper generated diff -Nru style patch. #
# ChangeSet
# 2004/07/19 14:24:28-04:00 [email protected]
# Makefile:
# Allow make O=<obj> {cscope,tags} to work
#
# Makefile
# 2004/07/19 14:17:25-04:00 [email protected] +6 -6
# Allow make O=<obj> {cscope,tags} to work
#

Makefile +6 -6
diff -Nru a/Makefile b/Makefile
@@ -1009,19 +1009,19 @@
 # ---------------------------------------------------------------------------
 
 define all-sources
-	( find . $(RCS_FIND_IGNORE) \
+	( find $(srctree) $(RCS_FIND_IGNORE) \
 	       \( -name include -o -name arch \) -prune -o \
 	       -name '*.[chS]' -print; \
-	  find arch/$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/arch/$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find security/selinux/include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/security/selinux/include $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include $(RCS_FIND_IGNORE) \
 	       \( -name config -o -name 'asm-*' \) -prune \
 	       -o -name '*.[chS]' -print; \
-	  find include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-$(ARCH) $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print; \
-	  find include/asm-generic $(RCS_FIND_IGNORE) \
+	  find $(srctree)/include/asm-generic $(RCS_FIND_IGNORE) \
 	       -name '*.[chS]' -print )
 endef
 

--
Regards,
George

#4 lore raw
Quoted 15 lines · George G. Davis
Quoted 14 lines · George G. Davis
Quoted 1 line · On Mon, Jul 19, 2004 at 09:24:30PM +0200, [email protected] wrote:

On Mon, Jul 19, 2004 at 01:17:59PM -0400, George G. Davis wrote:

<snip>

Quoted 8 lines

Review

Quoted 6 lines

endef

(quoted diff) +2 -2
-quiet_cmd_cscope-file = FILELST cscope.files
-      cmd_cscope-file = $(all-sources) > cscope.files
+quiet_cmd_cscope-file = FILELST $(obj)/cscope.files
+      cmd_cscope-file = $(all-sources) > $(obj)/cscope.files

The $(obj) in this line should not be needed. Current directory defaults to $(obj) equals $(objtree) when executing make cscope.

Quoted 3 lines
Quoted 1 line

Yep, I got carried away there, Thanks. Should I resubmit a revised patch?

Ok, after clutzing about with bk fix, etc., here's the revised patch:

Thanks. Added to my local kbuild tree.

Sam