LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Patch 0/8] Remove 'TOPDIR' from Makefiles
@ 2008-01-01  7:13 WANG Cong
  2008-01-01  7:18 ` [Patch 1/8] UML: " WANG Cong
                   ` (9 more replies)
  0 siblings, 10 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:13 UTC (permalink / raw)
  To: LKML; +Cc: Sam Ravnborg, linux-kbuild, Andrew Morton


TOPDIR is obsolete, use srctree or objtree instead.

This patch set removes all the TOPDIR use in the whole
source tree and finally drops it in the top Makefile.
They're against the current linus-tree.

Note that Patch [8/8] should be applied _after_ all the
previous patches are applied.

Regards.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Andrew Morton <akpm@osdl.org>



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
@ 2008-01-01  7:18 ` WANG Cong
  2008-01-01 10:33   ` Sam Ravnborg
  2008-01-01  7:22 ` [Patch 2/8] MIPS: " WANG Cong
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:18 UTC (permalink / raw)
  To: LKML
  Cc: Sam Ravnborg, linux-kbuild, Andrew Morton, jdike, user-mode-linux-devel


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all UML Makefiles.

Cc: Jeff Dike <jdike@addtoit.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/um/Makefile b/arch/um/Makefile
index ba6813a..57491af 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
 else
-	$(Q)cd $(TOPDIR)/$(dir $@) ; \
+	$(Q)cd $(objtree)/$(dir $@) ; \
 	ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
 endif
 
@@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
 else
-	$(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
+	$(Q)cd $(objtree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
 endif
 
 $(objtree)/$(ARCH_DIR)/include:
diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile
index a9814a7..a3cfae7 100644
--- a/arch/um/sys-ppc/Makefile
+++ b/arch/um/sys-ppc/Makefile
@@ -6,7 +6,7 @@ OBJ = built-in.o
 OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \
 	ptrace_user.o sysrq.o
 
-EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel
+EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(objtree)/arch/ppc/kernel
 
 all: $(OBJ)
 
@@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c
 
 semaphore.c:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 checksum.S:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/lib/$@ $@
+	ln -s $(objtree)/arch/ppc/lib/$@ $@
 
 mk_defs.c:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.head:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(objtree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.h: mk_defs.c ppc_defs.head \
-		$(TOPDIR)/include/asm-ppc/mmu.h \
-		$(TOPDIR)/include/asm-ppc/processor.h \
-		$(TOPDIR)/include/asm-ppc/pgtable.h \
-		$(TOPDIR)/include/asm-ppc/ptrace.h
+		$(objtree)/include/asm-ppc/mmu.h \
+		$(objtree)/include/asm-ppc/processor.h \
+		$(objtree)/include/asm-ppc/pgtable.h \
+		$(objtree)/include/asm-ppc/ptrace.h
 #	$(CC) $(CFLAGS) -S mk_defs.c
 	cp ppc_defs.head ppc_defs.h
 # for bk, this way we can write to the file even if it's not checked out
@@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \
 
 checksum.o: checksum.S
 	rm -f asm
-	ln -s $(TOPDIR)/include/asm-ppc asm
+	ln -s $(objtree)/include/asm-ppc asm
 	$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
 	rm -f asm
 
 misc.o: misc.S ppc_defs.h
 	rm -f asm
-	ln -s $(TOPDIR)/include/asm-ppc asm
+	ln -s $(objtree)/include/asm-ppc asm
 	$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
 	rm -f asm
 
diff --git a/arch/x86/Makefile_32 b/arch/x86/Makefile_32

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
  2008-01-01  7:18 ` [Patch 1/8] UML: " WANG Cong
@ 2008-01-01  7:22 ` WANG Cong
  2008-01-01 10:15   ` Sam Ravnborg
  2008-01-01  7:25 ` [Patch 3/8] S390: " WANG Cong
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:22 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, linux-mips


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all Mips Makefiles.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449..5196962 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,7 +12,7 @@ endif
 
 MKLASATIMG = mklasatimg
 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = $(TOPDIR)/vmlinux
+KERNEL_IMAGE = $(objtree)/vmlinux
 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
 
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D TIMESTAMP=$(shell date +%s)
 
 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
-	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
+	$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
 
 OBJECTS = head.o kImage.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 3/8] S390: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
  2008-01-01  7:18 ` [Patch 1/8] UML: " WANG Cong
  2008-01-01  7:22 ` [Patch 2/8] MIPS: " WANG Cong
@ 2008-01-01  7:25 ` WANG Cong
  2008-01-01 10:17   ` Sam Ravnborg
  2008-01-01  7:29 ` [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:25 UTC (permalink / raw)
  To: Martin Schwidefsky
  Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, linux-s390


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all s390 Makefiles.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 56cb710..a753a71 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
 #
 # This is just to get the dependencies...
 #
-binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
+binfmt_elf32.o:	$(objtree)/fs/binfmt_elf.c

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (2 preceding siblings ...)
  2008-01-01  7:25 ` [Patch 3/8] S390: " WANG Cong
@ 2008-01-01  7:29 ` WANG Cong
  2008-01-01 10:20   ` Sam Ravnborg
  2008-01-01  7:33 ` [Patch 5/8] INFINIBAND: " WANG Cong
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:29 UTC (permalink / raw)
  To: Mikael Starvik; +Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, dev-etrax


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all Cris Makefiles.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
index 9f77eda..8586922 100644
--- a/arch/cris/arch-v32/boot/compressed/Makefile
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -7,7 +7,7 @@
 target = $(target_compressed_dir)
 src    = $(src_compressed_dir)
 
-CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
+CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include
 CFLAGS = -O2
 LD = gcc-cris -mlinux -march=v32 -nostdlib
 OBJCOPY = objcopy-cris

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (3 preceding siblings ...)
  2008-01-01  7:29 ` [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles WANG Cong
@ 2008-01-01  7:33 ` WANG Cong
  2008-01-01 10:26   ` Sam Ravnborg
  2008-01-01  7:36 ` [Patch 6/8] FRV: " WANG Cong
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:33 UTC (permalink / raw)
  To: Roland Dreier, mshefty
  Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, hal.rosenstock


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all infiniband Makefiles.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <mshefty@ichips.intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile
index 36b9898..b82286a 100644
--- a/drivers/infiniband/hw/cxgb3/Makefile
+++ b/drivers/infiniband/hw/cxgb3/Makefile
@@ -1,5 +1,5 @@
-EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
-		-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core
+EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \
+		-I$(objtree)/drivers/infiniband/hw/cxgb3/core
 
 obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 6/8] FRV: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (4 preceding siblings ...)
  2008-01-01  7:33 ` [Patch 5/8] INFINIBAND: " WANG Cong
@ 2008-01-01  7:36 ` WANG Cong
  2008-01-01 10:27   ` Sam Ravnborg
  2008-01-01  7:41 ` [Patch 7/8] FS: Remove " WANG Cong
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:36 UTC (permalink / raw)
  To: David Howells; +Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all frv Makefiles.

Cc: David Howells <dhowells@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile
index dc6f038..d93f768 100644
--- a/arch/frv/boot/Makefile
+++ b/arch/frv/boot/Makefile
@@ -10,7 +10,7 @@
 
 targets := Image zImage bootpImage
 
-SYSTEM	=$(TOPDIR)/$(LINUX)
+SYSTEM	=$(objtree)/$(LINUX)
 
 ZTEXTADDR	 = 0x02080000
 PARAMS_PHYS	 = 0x0207c000
@@ -45,7 +45,7 @@ zImage:	$(CONFIGURE) compressed/$(LINUX)
 bootpImage: bootp/bootp
 	$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
 
-compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep
+compressed/$(LINUX): $(objtree)/$(LINUX) dep
 	@$(MAKE) -C compressed $(LINUX)
 
 bootp/bootp: zImage initrd
@@ -59,10 +59,10 @@ initrd:
 # installation
 #
 install: $(CONFIGURE) Image
-	sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)"
+	sh ./install.sh $(KERNELRELEASE) Image $(objtree)/System.map "$(INSTALL_PATH)"
 
 zinstall: $(CONFIGURE) zImage
-	sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
+	sh ./install.sh $(KERNELRELEASE) zImage $(objtree)/System.map "$(INSTALL_PATH)"
 
 #
 # miscellany

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (5 preceding siblings ...)
  2008-01-01  7:36 ` [Patch 6/8] FRV: " WANG Cong
@ 2008-01-01  7:41 ` WANG Cong
  2008-01-01 10:30   ` Sam Ravnborg
  2008-01-01 17:27   ` [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles Eric Sandeen
  2008-01-01  7:43 ` [Patch 8/8] Remove 'TOPDIR' from the Top Makefile WANG Cong
                   ` (2 subsequent siblings)
  9 siblings, 2 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:41 UTC (permalink / raw)
  To: Tim Shimmin; +Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, viro


TOPDIR is obsolete, use objtree instead.
This patch removes TOPDIR from all fs/ Makefiles.

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Tim Shimmin <xfs-masters@oss.sgi.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile
index 6673ee8..9b5e92b 100644
--- a/fs/smbfs/Makefile
+++ b/fs/smbfs/Makefile
@@ -34,5 +34,5 @@ proto:
 	@echo >> proto2.h "struct sock;"
 	@echo >> proto2.h "struct statfs;"
 	@echo >> proto2.h ""
-	cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
+	cproto -E "gcc -E" -e -v -I $(objtree)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
 	mv proto2.h proto.h
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 49e3e7e..d1d3d49 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -1 +1 @@
-include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
+include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)

^ permalink raw reply	[flat|nested] 50+ messages in thread

* [Patch 8/8] Remove 'TOPDIR' from the Top Makefile
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (6 preceding siblings ...)
  2008-01-01  7:41 ` [Patch 7/8] FS: Remove " WANG Cong
@ 2008-01-01  7:43 ` WANG Cong
  2008-01-01 10:09 ` [Patch 0/8] Remove 'TOPDIR' from Makefiles Sam Ravnborg
  2008-01-02  9:51 ` Sam Ravnborg
  9 siblings, 0 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-01  7:43 UTC (permalink / raw)
  To: LKML; +Cc: Sam Ravnborg, linux-kbuild, Andrew Morton


TOPDIR is obsolete, thus can be removed.
This patch removes TOPDIR from the top Makefile.

Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/Makefile b/Makefile
index fbb8dfc..c892d14 100644
--- a/Makefile
+++ b/Makefile
@@ -148,15 +148,13 @@ _all: modules
 endif
 
 srctree		:= $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
-TOPDIR		:= $(srctree)
-# FIXME - TOPDIR is obsolete, use srctree/objtree
 objtree		:= $(CURDIR)
 src		:= $(srctree)
 obj		:= $(objtree)
 
 VPATH		:= $(srctree)$(if $(KBUILD_EXTMOD),:$(KBUILD_EXTMOD))
 
-export srctree objtree VPATH TOPDIR
+export srctree objtree VPATH
 
 
 # SUBARCH tells the usermode build what the underlying arch is.  That is set

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 0/8] Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (7 preceding siblings ...)
  2008-01-01  7:43 ` [Patch 8/8] Remove 'TOPDIR' from the Top Makefile WANG Cong
@ 2008-01-01 10:09 ` Sam Ravnborg
  2008-01-02  9:51 ` Sam Ravnborg
  9 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:09 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML, linux-kbuild, Andrew Morton

On Tue, Jan 01, 2008 at 03:13:11PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use srctree or objtree instead.

Glad to see this being done - long overdue.

Most of your patches (if not all) replaces TOPDIR
with objtree but usage of objtree is only
correct when dealing with output files.
Note that objtree != srctree only for O=... builds.

And a few cases should be dealt with differently.
See individual comments.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:22 ` [Patch 2/8] MIPS: " WANG Cong
@ 2008-01-01 10:15   ` Sam Ravnborg
  2008-01-01 13:11     ` (Try #2) " WANG Cong
  2008-01-01 13:44     ` Andreas Schwab
  0 siblings, 2 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:15 UTC (permalink / raw)
  To: WANG Cong; +Cc: Ralf Baechle, LKML, linux-kbuild, Andrew Morton, linux-mips

On Tue, Jan 01, 2008 at 03:22:38PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all Mips Makefiles.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
> index 5332449..5196962 100644
> --- a/arch/mips/lasat/image/Makefile
> +++ b/arch/mips/lasat/image/Makefile
> @@ -12,7 +12,7 @@ endif
>  
>  MKLASATIMG = mklasatimg
>  MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
> -KERNEL_IMAGE = $(TOPDIR)/vmlinux
> +KERNEL_IMAGE = $(objtree)/vmlinux

Current directory when building is $(objtree) so here we should
just skip the use of TOPDIR like this:
> +KERNEL_IMAGE = vmlinux


>  KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
>  KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
>  
> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
>  		-D TIMESTAMP=$(shell date +%s)
>  
>  $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
> -	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
> +	$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
This has never worked with O=.. builds.
The correct fix here is to use:
> +	$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $<

The -Iinclude2 is only for O=... builds so to keep current
behaviour removing $(TOPDIR)/ would do it.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 3/8] S390: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:25 ` [Patch 3/8] S390: " WANG Cong
@ 2008-01-01 10:17   ` Sam Ravnborg
  2008-01-01 13:27     ` (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:17 UTC (permalink / raw)
  To: WANG Cong
  Cc: Martin Schwidefsky, LKML, linux-kbuild, Andrew Morton, linux-s390

On Tue, Jan 01, 2008 at 03:25:55PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all s390 Makefiles.
> 
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
> index 56cb710..a753a71 100644
> --- a/arch/s390/kernel/Makefile
> +++ b/arch/s390/kernel/Makefile
> @@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
>  #
>  # This is just to get the dependencies...
>  #
> -binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
> +binfmt_elf32.o:	$(objtree)/fs/binfmt_elf.c

This prerequisite listing looks just bogus and should be removed altogether.
We only need to list prerequisites explicit for generated files.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:29 ` [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles WANG Cong
@ 2008-01-01 10:20   ` Sam Ravnborg
  2008-01-01 13:34     ` (Try #2) " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:20 UTC (permalink / raw)
  To: WANG Cong; +Cc: Mikael Starvik, LKML, linux-kbuild, Andrew Morton, dev-etrax

On Tue, Jan 01, 2008 at 03:29:22PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all Cris Makefiles.
> 
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
> index 9f77eda..8586922 100644
> --- a/arch/cris/arch-v32/boot/compressed/Makefile
> +++ b/arch/cris/arch-v32/boot/compressed/Makefile
> @@ -7,7 +7,7 @@
>  target = $(target_compressed_dir)
>  src    = $(src_compressed_dir)
>  
> -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
> +CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include

As in the mips case the right fix is to use:
> +CC = gcc-cris -mlinux -march=v32 -Iinclude -Iinclude2

In this way we pick up the includes also in the O=..
case.

PS. Mikael - should Jesper be mentioned in MAINTAINERS?

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:33 ` [Patch 5/8] INFINIBAND: " WANG Cong
@ 2008-01-01 10:26   ` Sam Ravnborg
  2008-01-01 13:41     ` (Try #2) " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:26 UTC (permalink / raw)
  To: WANG Cong
  Cc: Roland Dreier, mshefty, LKML, linux-kbuild, Andrew Morton,
	hal.rosenstock

On Tue, Jan 01, 2008 at 03:33:31PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all infiniband Makefiles.
> 
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Roland Dreier <rolandd@cisco.com>
> Cc: Sean Hefty <mshefty@ichips.intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile
> index 36b9898..b82286a 100644
> --- a/drivers/infiniband/hw/cxgb3/Makefile
> +++ b/drivers/infiniband/hw/cxgb3/Makefile
> @@ -1,5 +1,5 @@
> -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
> -		-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core

> +EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \
Drop $(TOPDIR) like this:
> +EXTRA_CFLAGS += -Idrivers/net/cxgb3 \

> +		-I$(objtree)/drivers/infiniband/hw/cxgb3/core
And this line can be deleted - there is no such directory.
At least not in my tree.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 6/8] FRV: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:36 ` [Patch 6/8] FRV: " WANG Cong
@ 2008-01-01 10:27   ` Sam Ravnborg
  2008-01-01 14:00     ` (Try #2) [Patch 6/8] FRV: Drop " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:27 UTC (permalink / raw)
  To: WANG Cong; +Cc: David Howells, LKML, linux-kbuild, Andrew Morton

On Tue, Jan 01, 2008 at 03:36:45PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all frv Makefiles.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile
> index dc6f038..d93f768 100644
> --- a/arch/frv/boot/Makefile
> +++ b/arch/frv/boot/Makefile
> @@ -10,7 +10,7 @@
>  
>  targets := Image zImage bootpImage
>  
> -SYSTEM	=$(TOPDIR)/$(LINUX)
> +SYSTEM	=$(objtree)/$(LINUX)
>  
>  ZTEXTADDR	 = 0x02080000
>  PARAMS_PHYS	 = 0x0207c000
> @@ -45,7 +45,7 @@ zImage:	$(CONFIGURE) compressed/$(LINUX)
>  bootpImage: bootp/bootp
>  	$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
>  
> -compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep
> +compressed/$(LINUX): $(objtree)/$(LINUX) dep
>  	@$(MAKE) -C compressed $(LINUX)
>  
>  bootp/bootp: zImage initrd
> @@ -59,10 +59,10 @@ initrd:
>  # installation
>  #
>  install: $(CONFIGURE) Image
> -	sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)"
> +	sh ./install.sh $(KERNELRELEASE) Image $(objtree)/System.map "$(INSTALL_PATH)"
>  
>  zinstall: $(CONFIGURE) zImage
> -	sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
> +	sh ./install.sh $(KERNELRELEASE) zImage $(objtree)/System.map "$(INSTALL_PATH)"

In this file we can just drop use of $(TOPDIR) since this is our
current directory anyway.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:41 ` [Patch 7/8] FS: Remove " WANG Cong
@ 2008-01-01 10:30   ` Sam Ravnborg
  2008-01-01 14:28     ` (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code WANG Cong
  2008-01-01 17:27   ` [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles Eric Sandeen
  1 sibling, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:30 UTC (permalink / raw)
  To: WANG Cong; +Cc: Tim Shimmin, LKML, linux-kbuild, Andrew Morton, viro

On Tue, Jan 01, 2008 at 03:41:05PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all fs/ Makefiles.
> 
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Tim Shimmin <xfs-masters@oss.sgi.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ---
> 
> diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile
> index 6673ee8..9b5e92b 100644
> --- a/fs/smbfs/Makefile
> +++ b/fs/smbfs/Makefile
> @@ -34,5 +34,5 @@ proto:
>  	@echo >> proto2.h "struct sock;"
>  	@echo >> proto2.h "struct statfs;"
>  	@echo >> proto2.h ""
> -	cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
> +	cproto -E "gcc -E" -e -v -I $(objtree)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
>  	mv proto2.h proto.h
> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 49e3e7e..d1d3d49 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -1 +1 @@
> -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
> +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)

The whole "Maintainer rules" part of this file should be deleted.
I cannot see how it can be used anyway.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:18 ` [Patch 1/8] UML: " WANG Cong
@ 2008-01-01 10:33   ` Sam Ravnborg
  2008-01-01 10:49     ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:33 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML, linux-kbuild, Andrew Morton, jdike, user-mode-linux-devel

On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all UML Makefiles.
> 

I do not feel confident with these changes.
In some places I had expected to see srctree and not objtree.
I would like to see this tested before applying it.

Building a ppc toolchain now to test it...

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:33   ` Sam Ravnborg
@ 2008-01-01 10:49     ` Sam Ravnborg
  2008-01-01 13:01       ` (Try #2) " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 10:49 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML, linux-kbuild, Andrew Morton, jdike, user-mode-linux-devel

On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote:
> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
> > 
> > TOPDIR is obsolete, use objtree instead.
> > This patch removes TOPDIR from all UML Makefiles.
> > 
> 
> I do not feel confident with these changes.
> In some places I had expected to see srctree and not objtree.
> I would like to see this tested before applying it.
> 
> Building a ppc toolchain now to test it...

It seems that building a ppc based um kernel is not supported
in mainline.
Kconfig.ppc is missing and when creating it um build fails
in sys-ppc/ due to user-offset.c is missing.

As most of your patch touches ppc specific code I suggest
to just replace TOPDIR with srctree all over (no semantic change)
and the the um people can figure out the ppc stuff when they get to it.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:49     ` Sam Ravnborg
@ 2008-01-01 13:01       ` WANG Cong
  2008-01-02 15:02         ` Jeff Dike
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 13:01 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, LKML, linux-kbuild, Andrew Morton, jdike,
	user-mode-linux-devel

On Tue, Jan 01, 2008 at 11:49:42AM +0100, Sam Ravnborg wrote:
>On Tue, Jan 01, 2008 at 11:33:42AM +0100, Sam Ravnborg wrote:
>> On Tue, Jan 01, 2008 at 03:18:46PM +0800, WANG Cong wrote:
>> > 
>> > TOPDIR is obsolete, use objtree instead.
>> > This patch removes TOPDIR from all UML Makefiles.
>> > 
>> 
>> I do not feel confident with these changes.
>> In some places I had expected to see srctree and not objtree.
>> I would like to see this tested before applying it.
>> 
>> Building a ppc toolchain now to test it...
>
>It seems that building a ppc based um kernel is not supported
>in mainline.
>Kconfig.ppc is missing and when creating it um build fails
>in sys-ppc/ due to user-offset.c is missing.
>
>As most of your patch touches ppc specific code I suggest
>to just replace TOPDIR with srctree all over (no semantic change)
>and the the um people can figure out the ppc stuff when they get to it.

You're right. I use srctree instead. And tested with:

$ make O=../foobar/ ARCH=um linux

It works fine. Thanks for your points!

-------->

TOPDIR is obsolete, use srctree instead.
This patch removes TOPDIR from all UML Makefiles.

Cc: Jeff Dike <jdike@addtoit.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/um/Makefile b/arch/um/Makefile
index ba6813a..08a2865 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -158,7 +158,7 @@ ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
 else
-	$(Q)cd $(TOPDIR)/$(dir $@) ; \
+	$(Q)cd $(srctree)/$(dir $@) ; \
 	ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
 endif
 
@@ -168,7 +168,7 @@ ifneq ($(KBUILD_SRC),)
 	$(Q)mkdir -p $(objtree)/include/asm-um
 	$(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
 else
-	$(Q)cd $(TOPDIR)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
+	$(Q)cd $(srctree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
 endif
 
 $(objtree)/$(ARCH_DIR)/include:
diff --git a/arch/um/sys-ppc/Makefile b/arch/um/sys-ppc/Makefile
index a9814a7..0890152 100644
--- a/arch/um/sys-ppc/Makefile
+++ b/arch/um/sys-ppc/Makefile
@@ -6,7 +6,7 @@ OBJ = built-in.o
 OBJS = ptrace.o sigcontext.o semaphore.o checksum.o miscthings.o misc.o \
 	ptrace_user.o sysrq.o
 
-EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(TOPDIR)/arch/ppc/kernel
+EXTRA_AFLAGS := -DCONFIG_PPC32 -I. -I$(srctree)/arch/ppc/kernel
 
 all: $(OBJ)
 
@@ -22,25 +22,25 @@ sigcontext.o: sigcontext.c
 
 semaphore.c:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(srctree)/arch/ppc/kernel/$@ $@
 
 checksum.S:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/lib/$@ $@
+	ln -s $(srctree)/arch/ppc/lib/$@ $@
 
 mk_defs.c:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(srctree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.head:
 	rm -f $@
-	ln -s $(TOPDIR)/arch/ppc/kernel/$@ $@
+	ln -s $(srctree)/arch/ppc/kernel/$@ $@
 
 ppc_defs.h: mk_defs.c ppc_defs.head \
-		$(TOPDIR)/include/asm-ppc/mmu.h \
-		$(TOPDIR)/include/asm-ppc/processor.h \
-		$(TOPDIR)/include/asm-ppc/pgtable.h \
-		$(TOPDIR)/include/asm-ppc/ptrace.h
+		$(srctree)/include/asm-ppc/mmu.h \
+		$(srctree)/include/asm-ppc/processor.h \
+		$(srctree)/include/asm-ppc/pgtable.h \
+		$(srctree)/include/asm-ppc/ptrace.h
 #	$(CC) $(CFLAGS) -S mk_defs.c
 	cp ppc_defs.head ppc_defs.h
 # for bk, this way we can write to the file even if it's not checked out
@@ -56,13 +56,13 @@ ppc_defs.h: mk_defs.c ppc_defs.head \
 
 checksum.o: checksum.S
 	rm -f asm
-	ln -s $(TOPDIR)/include/asm-ppc asm
+	ln -s $(srctree)/include/asm-ppc asm
 	$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
 	rm -f asm
 
 misc.o: misc.S ppc_defs.h
 	rm -f asm
-	ln -s $(TOPDIR)/include/asm-ppc asm
+	ln -s $(srctree)/include/asm-ppc asm
 	$(CC) $(EXTRA_AFLAGS) $(KBUILD_AFLAGS) -D__ASSEMBLY__ -D__UM_PPC__ -c $< -o $*.o
 	rm -f asm
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:15   ` Sam Ravnborg
@ 2008-01-01 13:11     ` WANG Cong
  2008-01-01 13:44     ` Andreas Schwab
  1 sibling, 0 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-01 13:11 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Ralf Baechle, LKML, linux-kbuild, Andrew Morton, linux-mips


>> -KERNEL_IMAGE = $(TOPDIR)/vmlinux
>> +KERNEL_IMAGE = $(objtree)/vmlinux
>
>Current directory when building is $(objtree) so here we should
>just skip the use of TOPDIR like this:
>> +KERNEL_IMAGE = vmlinux
>
>
>>  KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
>>  KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
>>  
>> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
>>  		-D TIMESTAMP=$(shell date +%s)
>>  
>>  $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
>> -	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
>> +	$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
>This has never worked with O=.. builds.
>The correct fix here is to use:
>> +	$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $<
>
>The -Iinclude2 is only for O=... builds so to keep current
>behaviour removing $(TOPDIR)/ would do it.

Thank you for your explanations!

The following one corrects all the mistakes as you told.

------->

Since TOPDIR is obsolete, this patch removes TOPDIR
from the Mips Makefiles.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449..1ae73ce 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,7 +12,7 @@ endif
 
 MKLASATIMG = mklasatimg
 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = $(TOPDIR)/vmlinux
+KERNEL_IMAGE = vmlinux
 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
 
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D TIMESTAMP=$(shell date +%s)
 
 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
-	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
+	$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $<
 
 OBJECTS = head.o kImage.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile
  2008-01-01 10:17   ` Sam Ravnborg
@ 2008-01-01 13:27     ` WANG Cong
  2008-01-01 17:42       ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 13:27 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Martin Schwidefsky, LKML, linux-kbuild, Andrew Morton,
	linux-s390


>> -binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
>> +binfmt_elf32.o:	$(objtree)/fs/binfmt_elf.c
>
>This prerequisite listing looks just bogus and should be removed altogether.
>We only need to list prerequisites explicit for generated files.

Not so sure whether this is what s390 people do on purpose.
Thanks anyway!

The following one contains the new fix.

------------>

This patch removes TOPDIR and fixes a bogus prerequisite
in arch/s390/kernel/Makefile.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

----

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 56cb710..4accf27 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -20,7 +20,7 @@ obj-$(CONFIG_AUDIT)		+= audit.o
 compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
 obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o \
 					compat_wrapper.o compat_exec_domain.o \
-					binfmt_elf32.o $(compat-obj-y)
+					binfmt_elf.o $(compat-obj-y)
 
 obj-$(CONFIG_VIRT_TIMER)	+= vtime.o
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
@@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
 #
 # This is just to get the dependencies...
 #
-binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
+binfmt_elf.o:	$(objtree)/fs/binfmt_elf.c

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:20   ` Sam Ravnborg
@ 2008-01-01 13:34     ` WANG Cong
  2008-01-02  6:27       ` (Try #3) " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 13:34 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Mikael Starvik, LKML, linux-kbuild, Andrew Morton, dev-etrax


>> -CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
>> +CC = gcc-cris -mlinux -march=v32 -I $(objtree)/include
>
>As in the mips case the right fix is to use:
>> +CC = gcc-cris -mlinux -march=v32 -Iinclude -Iinclude2
>
>In this way we pick up the includes also in the O=..
>case.

Thanks, Sam!

Resend it. ;)

--------->

This patch removes TOPDIR from Cris Makefiles.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
index 9f77eda..27e9f15 100644
--- a/arch/cris/arch-v32/boot/compressed/Makefile
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -7,7 +7,7 @@
 target = $(target_compressed_dir)
 src    = $(src_compressed_dir)
 
-CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
+CC = gcc-cris -mlinux -march=v32 -Iinclude -Iinclude2
 CFLAGS = -O2
 LD = gcc-cris -mlinux -march=v32 -nostdlib
 OBJCOPY = objcopy-cris

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:26   ` Sam Ravnborg
@ 2008-01-01 13:41     ` WANG Cong
  2008-01-02 19:26       ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 13:41 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Roland Dreier, mshefty, LKML, linux-kbuild,
	Andrew Morton, hal.rosenstock


>> -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
>> -		-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core
>
>> +EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \
>Drop $(TOPDIR) like this:
>> +EXTRA_CFLAGS += -Idrivers/net/cxgb3 \
>
>> +		-I$(objtree)/drivers/infiniband/hw/cxgb3/core
>And this line can be deleted - there is no such directory.
>At least not in my tree.

Yes, correct. Thank you.

----------->

This patch removes TOPDIR from infiniband Makefiles.

Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Roland Dreier <rolandd@cisco.com>
Cc: Sean Hefty <mshefty@ichips.intel.com>
Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/drivers/infiniband/hw/cxgb3/Makefile b/drivers/infiniband/hw/cxgb3/Makefile
index 36b9898..7e7b5a6 100644
--- a/drivers/infiniband/hw/cxgb3/Makefile
+++ b/drivers/infiniband/hw/cxgb3/Makefile
@@ -1,5 +1,4 @@
-EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
-		-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core
+EXTRA_CFLAGS += -Idrivers/net/cxgb3
 
 obj-$(CONFIG_INFINIBAND_CXGB3) += iw_cxgb3.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01 10:15   ` Sam Ravnborg
  2008-01-01 13:11     ` (Try #2) " WANG Cong
@ 2008-01-01 13:44     ` Andreas Schwab
  2008-01-01 17:57       ` Sam Ravnborg
  1 sibling, 1 reply; 50+ messages in thread
From: Andreas Schwab @ 2008-01-01 13:44 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Ralf Baechle, LKML, linux-kbuild, Andrew Morton, linux-mips

Sam Ravnborg <sam@ravnborg.org> writes:

>> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
>>  		-D TIMESTAMP=$(shell date +%s)
>>  
>>  $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
>> -	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
>> +	$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
> This has never worked with O=.. builds.
> The correct fix here is to use:
>> +	$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $<
>
> The -Iinclude2 is only for O=... builds so to keep current
> behaviour removing $(TOPDIR)/ would do it.

Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 6/8] FRV: Drop 'TOPDIR' from Makefiles
  2008-01-01 10:27   ` Sam Ravnborg
@ 2008-01-01 14:00     ` WANG Cong
  2008-01-02 19:26       ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 14:00 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: WANG Cong, David Howells, LKML, linux-kbuild, Andrew Morton

>
>In this file we can just drop use of $(TOPDIR) since this is our
>current directory anyway.

Thanks!

-------->

This patch drops TOPDIR from frv Makefiles.

Cc: David Howells <dhowells@redhat.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/frv/boot/Makefile b/arch/frv/boot/Makefile
index dc6f038..6ae3254 100644
--- a/arch/frv/boot/Makefile
+++ b/arch/frv/boot/Makefile
@@ -10,7 +10,7 @@
 
 targets := Image zImage bootpImage
 
-SYSTEM	=$(TOPDIR)/$(LINUX)
+SYSTEM	=$(LINUX)
 
 ZTEXTADDR	 = 0x02080000
 PARAMS_PHYS	 = 0x0207c000
@@ -45,7 +45,7 @@ zImage:	$(CONFIGURE) compressed/$(LINUX)
 bootpImage: bootp/bootp
 	$(OBJCOPY) -O binary -R .note -R .comment -S bootp/bootp $@
 
-compressed/$(LINUX): $(TOPDIR)/$(LINUX) dep
+compressed/$(LINUX): $(LINUX) dep
 	@$(MAKE) -C compressed $(LINUX)
 
 bootp/bootp: zImage initrd
@@ -59,10 +59,10 @@ initrd:
 # installation
 #
 install: $(CONFIGURE) Image
-	sh ./install.sh $(KERNELRELEASE) Image $(TOPDIR)/System.map "$(INSTALL_PATH)"
+	sh ./install.sh $(KERNELRELEASE) Image System.map "$(INSTALL_PATH)"
 
 zinstall: $(CONFIGURE) zImage
-	sh ./install.sh $(KERNELRELEASE) zImage $(TOPDIR)/System.map "$(INSTALL_PATH)"
+	sh ./install.sh $(KERNELRELEASE) zImage System.map "$(INSTALL_PATH)"
 
 #
 # miscellany

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code
  2008-01-01 10:30   ` Sam Ravnborg
@ 2008-01-01 14:28     ` WANG Cong
  2008-01-02 19:27       ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-01 14:28 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Tim Shimmin, LKML, linux-kbuild, Andrew Morton, viro


>
>The whole "Maintainer rules" part of this file should be deleted.
>I cannot see how it can be used anyway.

Agreed.

I delete them all and renew the patch.
Passed compiling test.

--------->

This patch drops TOPDIR since it's obsolete and removes
some dead code from fs/smbfs/Makefile.

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Tim Shimmin <xfs-masters@oss.sgi.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile
index 6673ee8..4faf8c4 100644
--- a/fs/smbfs/Makefile
+++ b/fs/smbfs/Makefile
@@ -16,23 +16,3 @@ EXTRA_CFLAGS += -DSMBFS_PARANOIA
 #EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP
 #EXTRA_CFLAGS += -Werror
 
-#
-# Maintainer rules
-#
-
-# getopt.c not included. It is intentionally separate
-SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \
-	symlink.c
-
-proto:
-	-rm -f proto.h
-	@echo >  proto2.h "/*"
-	@echo >> proto2.h " *  Autogenerated with cproto on: " `date`
-	@echo >> proto2.h " */"
-	@echo >> proto2.h ""
-	@echo >> proto2.h "struct smb_request;"
-	@echo >> proto2.h "struct sock;"
-	@echo >> proto2.h "struct statfs;"
-	@echo >> proto2.h ""
-	cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
-	mv proto2.h proto.h
diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
index 49e3e7e..d1d3d49 100644
--- a/fs/xfs/Makefile
+++ b/fs/xfs/Makefile
@@ -1 +1 @@
-include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
+include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles
  2008-01-01  7:41 ` [Patch 7/8] FS: Remove " WANG Cong
  2008-01-01 10:30   ` Sam Ravnborg
@ 2008-01-01 17:27   ` Eric Sandeen
  2008-01-01 17:37     ` Sam Ravnborg
  1 sibling, 1 reply; 50+ messages in thread
From: Eric Sandeen @ 2008-01-01 17:27 UTC (permalink / raw)
  To: xfs-masters; +Cc: LKML, Sam Ravnborg, linux-kbuild, Andrew Morton, viro

WANG Cong wrote:
> TOPDIR is obsolete, use objtree instead.
> This patch removes TOPDIR from all fs/ Makefiles.

> diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> index 49e3e7e..d1d3d49 100644
> --- a/fs/xfs/Makefile
> +++ b/fs/xfs/Makefile
> @@ -1 +1 @@
> -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
> +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)

FWIW $(TOPDIR) is already banished from the latest xfs build code:

http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/Makefile

and the patch is in -mm too via git:

http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc6/2.6.24-rc6-mm1/broken-out/git-xfs.patch

Thanks,

-Eric

p.s. what is $(objtree) exactly?  I don't see it mentioned in
Documentation/kbuild except as one line in an example... I thought
$(obj) and $(src) should be used outside of the core kbuild
infrastructure, and in this case wouldn't it be $(src) anyway?


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles
  2008-01-01 17:27   ` [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles Eric Sandeen
@ 2008-01-01 17:37     ` Sam Ravnborg
  2008-01-02  5:55       ` (Try #3) [Patch 7/8] FS: Remove dead code WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 17:37 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: xfs-masters, LKML, linux-kbuild, Andrew Morton, viro

On Tue, Jan 01, 2008 at 11:27:37AM -0600, Eric Sandeen wrote:
> WANG Cong wrote:
> > TOPDIR is obsolete, use objtree instead.
> > This patch removes TOPDIR from all fs/ Makefiles.
> 
> > diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
> > index 49e3e7e..d1d3d49 100644
> > --- a/fs/xfs/Makefile
> > +++ b/fs/xfs/Makefile
> > @@ -1 +1 @@
> > -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
> > +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
> 
> FWIW $(TOPDIR) is already banished from the latest xfs build code:
> 
Good - I will ignore the xfs bits.

> http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/Makefile
> 
> and the patch is in -mm too via git:
> 
> http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.24-rc6/2.6.24-rc6-mm1/broken-out/git-xfs.patch

You can do this simpler:
+EXTRA_CFLAGS +=	 -I$(src) -I$(src)/linux-2.6 -funsigned-char
+
+XFS_LINUX := linux-2.6
+
+ifeq ($(CONFIG_XFS_DEBUG),y)
+	EXTRA_CFLAGS += -g
+endif
+

like this:

ccflags-y := -I$(src) -I$(src)/linux-2.6 -funsigned-char
ccflags-$(CONFIG_XFS_DEBUG) += -g

XFS_LINUX := linux-2.6

> p.s. what is $(objtree) exactly?  I don't see it mentioned in
> Documentation/kbuild except as one line in an example... I thought
> $(obj) and $(src) should be used outside of the core kbuild
> infrastructure, and in this case wouldn't it be $(src) anyway?

$(objtree) specify the build directory and is only rarely used.
Half of the current users are buggy and I should fix it one day.

	Sam 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile
  2008-01-01 13:27     ` (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile WANG Cong
@ 2008-01-01 17:42       ` Sam Ravnborg
  2008-01-02  6:42         ` (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 17:42 UTC (permalink / raw)
  To: WANG Cong
  Cc: Martin Schwidefsky, LKML, linux-kbuild, Andrew Morton, linux-s390

On Tue, Jan 01, 2008 at 09:27:39PM +0800, WANG Cong wrote:
> 
> >> -binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
> >> +binfmt_elf32.o:	$(objtree)/fs/binfmt_elf.c
> >
> >This prerequisite listing looks just bogus and should be removed altogether.
> >We only need to list prerequisites explicit for generated files.
> 
> Not so sure whether this is what s390 people do on purpose.
> Thanks anyway!
> 
> The following one contains the new fix.
> 
> ------------>
> 
> This patch removes TOPDIR and fixes a bogus prerequisite
> in arch/s390/kernel/Makefile.
> 
> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> ----
> 
> diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
> index 56cb710..4accf27 100644
> --- a/arch/s390/kernel/Makefile
> +++ b/arch/s390/kernel/Makefile
> @@ -20,7 +20,7 @@ obj-$(CONFIG_AUDIT)		+= audit.o
>  compat-obj-$(CONFIG_AUDIT)	+= compat_audit.o
>  obj-$(CONFIG_COMPAT)		+= compat_linux.o compat_signal.o \
>  					compat_wrapper.o compat_exec_domain.o \
> -					binfmt_elf32.o $(compat-obj-y)
> +					binfmt_elf.o $(compat-obj-y)
>  
>  obj-$(CONFIG_VIRT_TIMER)	+= vtime.o
>  obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
> @@ -34,4 +34,4 @@ obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
>  #
>  # This is just to get the dependencies...
>  #
> -binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
> +binfmt_elf.o:	$(objtree)/fs/binfmt_elf.c

This is wrong. s390 have a file named binfmt_elf32.c and with this
change it does no longer build.

If the output file does not exist then kbuild does not care about the
dependencies and will just build the target.
On the second invocation when the target exists then kbuild has
created a file named .<target>.cmd that list the dependencies
and this includes any included .c file.
So there is just no pint in defining this dependency explicit
in the MAkefile - kbuild will figure it out automatically.

The right fix is just to kill the explicit listed dependency.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01 13:44     ` Andreas Schwab
@ 2008-01-01 17:57       ` Sam Ravnborg
  2008-01-02  6:21         ` (Try #3) " WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-01 17:57 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: WANG Cong, Ralf Baechle, LKML, linux-kbuild, Andrew Morton, linux-mips

On Tue, Jan 01, 2008 at 02:44:48PM +0100, Andreas Schwab wrote:
> Sam Ravnborg <sam@ravnborg.org> writes:
> 
> >> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
> >>  		-D TIMESTAMP=$(shell date +%s)
> >>  
> >>  $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
> >> -	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
> >> +	$(CC) -fno-pic $(HEAD_DEFINES) -I$(objtree)/include -c -o $@ $<
> > This has never worked with O=.. builds.
> > The correct fix here is to use:
> >> +	$(CC) -fno-pic $(HEAD_DEFINES) -Iinclude -Iinclude2 -c -o $@ $<
> >
> > The -Iinclude2 is only for O=... builds so to keep current
> > behaviour removing $(TOPDIR)/ would do it.
> 
> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
It would be better to use $(LINUXINCLUDE) as we then pull in all config
symbols too and do not have to hardcode kbuild internal names (include2).

As for the use of KBUILD_CPPFLAGS at present the usage is not consistent
across the architectures. Why does arm for example say:
KBUILD_CPPFLAGS       += -mbig-endian

This looks like a KBUILD_CFLAGS thing to me.

So we should preferably stick with LINUXINCLUDE for now.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #3) [Patch 7/8] FS: Remove dead code
  2008-01-01 17:37     ` Sam Ravnborg
@ 2008-01-02  5:55       ` WANG Cong
  0 siblings, 0 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-02  5:55 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Eric Sandeen, xfs-masters, LKML, linux-kbuild, Andrew Morton, viro

On Tue, Jan 01, 2008 at 06:37:29PM +0100, Sam Ravnborg wrote:
>On Tue, Jan 01, 2008 at 11:27:37AM -0600, Eric Sandeen wrote:
>> WANG Cong wrote:
>> > TOPDIR is obsolete, use objtree instead.
>> > This patch removes TOPDIR from all fs/ Makefiles.
>> 
>> > diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile
>> > index 49e3e7e..d1d3d49 100644
>> > --- a/fs/xfs/Makefile
>> > +++ b/fs/xfs/Makefile
>> > @@ -1 +1 @@
>> > -include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
>> > +include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
>> 
>> FWIW $(TOPDIR) is already banished from the latest xfs build code:
>> 
>Good - I will ignore the xfs bits.

Thanks. I will drop the xfs part.

------->

Remove dead code in smbfs makefile.

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Tim Shimmin <xfs-masters@oss.sgi.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/fs/smbfs/Makefile b/fs/smbfs/Makefile
index 6673ee8..4faf8c4 100644
--- a/fs/smbfs/Makefile
+++ b/fs/smbfs/Makefile
@@ -16,23 +16,3 @@ EXTRA_CFLAGS += -DSMBFS_PARANOIA
 #EXTRA_CFLAGS += -DDEBUG_SMB_TIMESTAMP
 #EXTRA_CFLAGS += -Werror
 
-#
-# Maintainer rules
-#
-
-# getopt.c not included. It is intentionally separate
-SRC = proc.c dir.c cache.c sock.c inode.c file.c ioctl.c smbiod.c request.c \
-	symlink.c
-
-proto:
-	-rm -f proto.h
-	@echo >  proto2.h "/*"
-	@echo >> proto2.h " *  Autogenerated with cproto on: " `date`
-	@echo >> proto2.h " */"
-	@echo >> proto2.h ""
-	@echo >> proto2.h "struct smb_request;"
-	@echo >> proto2.h "struct sock;"
-	@echo >> proto2.h "struct statfs;"
-	@echo >> proto2.h ""
-	cproto -E "gcc -E" -e -v -I $(TOPDIR)/include -DMAKING_PROTO -D__KERNEL__ $(SRC) >> proto2.h
-	mv proto2.h proto.h

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-01 17:57       ` Sam Ravnborg
@ 2008-01-02  6:21         ` WANG Cong
  2008-01-02 19:24           ` Sam Ravnborg
  2008-01-11 14:17           ` Ralf Baechle
  0 siblings, 2 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-02  6:21 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Andreas Schwab, WANG Cong, Ralf Baechle, LKML, linux-kbuild,
	Andrew Morton, linux-mips


>> 
>> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
>It would be better to use $(LINUXINCLUDE) as we then pull in all config
>symbols too and do not have to hardcode kbuild internal names (include2).

OK. Refine this patch.

----------->

Since TOPDIR is obsolete, this patch removes TOPDIR
from the Mips Makefiles.

Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449..17f5266 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,7 +12,7 @@ endif
 
 MKLASATIMG = mklasatimg
 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = $(TOPDIR)/vmlinux
+KERNEL_IMAGE = vmlinux
 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
 
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D TIMESTAMP=$(shell date +%s)
 
 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
-	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
+	$(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
 
 OBJECTS = head.o kImage.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-01 13:34     ` (Try #2) " WANG Cong
@ 2008-01-02  6:27       ` WANG Cong
  2008-01-02 19:25         ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-02  6:27 UTC (permalink / raw)
  To: WANG Cong
  Cc: Sam Ravnborg, Mikael Starvik, LKML, linux-kbuild, Andrew Morton,
	dev-etrax, Andreas Schwab


Refine it as suggested by Andreas.

-------->

This patch removes TOPDIR from Cris Makefiles.

Cc: Mikael Starvik <starvik@axis.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Andreas Schwab <schwab@suse.de>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/cris/arch-v32/boot/compressed/Makefile b/arch/cris/arch-v32/boot/compressed/Makefile
index 9f77eda..609692f 100644
--- a/arch/cris/arch-v32/boot/compressed/Makefile
+++ b/arch/cris/arch-v32/boot/compressed/Makefile
@@ -7,7 +7,7 @@
 target = $(target_compressed_dir)
 src    = $(src_compressed_dir)
 
-CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
+CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
 CFLAGS = -O2
 LD = gcc-cris -mlinux -march=v32 -nostdlib
 OBJCOPY = objcopy-cris

^ permalink raw reply	[flat|nested] 50+ messages in thread

* (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile
  2008-01-01 17:42       ` Sam Ravnborg
@ 2008-01-02  6:42         ` WANG Cong
  2008-01-02  9:31           ` Martin Schwidefsky
  0 siblings, 1 reply; 50+ messages in thread
From: WANG Cong @ 2008-01-02  6:42 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Martin Schwidefsky, LKML, linux-kbuild, Andrew Morton,
	linux-s390


>If the output file does not exist then kbuild does not care about the
>dependencies and will just build the target.
>On the second invocation when the target exists then kbuild has
>created a file named .<target>.cmd that list the dependencies
>and this includes any included .c file.
>So there is just no pint in defining this dependency explicit
>in the MAkefile - kbuild will figure it out automatically.
>
>The right fix is just to kill the explicit listed dependency.

If I understand you correctly, then the fix should be
the below one.

-------->

This patch removes TOPDIR from arch/s390/kernel/Makefile.

Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

---

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 56cb710..b3b650a 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -31,7 +31,3 @@ S390_KEXEC_OBJS := machine_kexec.o crash.o
 S390_KEXEC_OBJS += $(if $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o)
 obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
 
-#
-# This is just to get the dependencies...
-#
-binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile
  2008-01-02  6:42         ` (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile WANG Cong
@ 2008-01-02  9:31           ` Martin Schwidefsky
  2008-01-02  9:49             ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: Martin Schwidefsky @ 2008-01-02  9:31 UTC (permalink / raw)
  To: WANG Cong; +Cc: Sam Ravnborg, LKML, linux-kbuild, Andrew Morton, linux-s390

On Wed, 2008-01-02 at 14:42 +0800, WANG Cong wrote:
> diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
> index 56cb710..b3b650a 100644
> --- a/arch/s390/kernel/Makefile
> +++ b/arch/s390/kernel/Makefile
> @@ -31,7 +31,3 @@ S390_KEXEC_OBJS := machine_kexec.o crash.o
>  S390_KEXEC_OBJS += $(if
> $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o)
>  obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
> 
> -#
> -# This is just to get the dependencies...
> -#
> -binfmt_elf32.o:        $(TOPDIR)/fs/binfmt_elf.c

This one is correct. I'll add it to git390.

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile
  2008-01-02  9:31           ` Martin Schwidefsky
@ 2008-01-02  9:49             ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02  9:49 UTC (permalink / raw)
  To: Martin Schwidefsky
  Cc: WANG Cong, LKML, linux-kbuild, Andrew Morton, linux-s390

On Wed, Jan 02, 2008 at 10:31:35AM +0100, Martin Schwidefsky wrote:
> On Wed, 2008-01-02 at 14:42 +0800, WANG Cong wrote:
> > diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
> > index 56cb710..b3b650a 100644
> > --- a/arch/s390/kernel/Makefile
> > +++ b/arch/s390/kernel/Makefile
> > @@ -31,7 +31,3 @@ S390_KEXEC_OBJS := machine_kexec.o crash.o
> >  S390_KEXEC_OBJS += $(if
> > $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o)
> >  obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
> > 
> > -#
> > -# This is just to get the dependencies...
> > -#
> > -binfmt_elf32.o:        $(TOPDIR)/fs/binfmt_elf.c
> 
> This one is correct. I'll add it to git390.

Thanks Martin.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 0/8] Remove 'TOPDIR' from Makefiles
  2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
                   ` (8 preceding siblings ...)
  2008-01-01 10:09 ` [Patch 0/8] Remove 'TOPDIR' from Makefiles Sam Ravnborg
@ 2008-01-02  9:51 ` Sam Ravnborg
  2008-01-03  4:37   ` WANG Cong
  9 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02  9:51 UTC (permalink / raw)
  To: WANG Cong; +Cc: LKML, linux-kbuild, Andrew Morton

On Tue, Jan 01, 2008 at 03:13:11PM +0800, WANG Cong wrote:
> 
> TOPDIR is obsolete, use srctree or objtree instead.
> 
> This patch set removes all the TOPDIR use in the whole
> source tree and finally drops it in the top Makefile.
> They're against the current linus-tree.
> 
> Note that Patch [8/8] should be applied _after_ all the
> previous patches are applied.

Hi Wang.

You a heads up. I will most likely apply
the remaining of the patches tonight, except the UM stuff
which I hope Jeff to take and the final removal of TOPDIR
may wait a bit.
I want the s390, xfs and um changes to hit -mm at least
and we have several external modules that uses TOPDIR.

And some of these external modules I care about - not
all of them but some of them.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-01 13:01       ` (Try #2) " WANG Cong
@ 2008-01-02 15:02         ` Jeff Dike
  2008-01-02 17:27           ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: Jeff Dike @ 2008-01-02 15:02 UTC (permalink / raw)
  To: WANG Cong
  Cc: Sam Ravnborg, LKML, linux-kbuild, Andrew Morton, user-mode-linux-devel

On Tue, Jan 01, 2008 at 09:01:25PM +0800, WANG Cong wrote:
> TOPDIR is obsolete, use srctree instead.
> This patch removes TOPDIR from all UML Makefiles.

Thanks, I'll send this to Andrew.

				Jeff

-- 
Work email - jdike at linux dot intel dot com

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles
  2008-01-02 15:02         ` Jeff Dike
@ 2008-01-02 17:27           ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 17:27 UTC (permalink / raw)
  To: Jeff Dike
  Cc: WANG Cong, LKML, linux-kbuild, Andrew Morton, user-mode-linux-devel

On Wed, Jan 02, 2008 at 10:02:55AM -0500, Jeff Dike wrote:
> On Tue, Jan 01, 2008 at 09:01:25PM +0800, WANG Cong wrote:
> > TOPDIR is obsolete, use srctree instead.
> > This patch removes TOPDIR from all UML Makefiles.
> 
> Thanks, I'll send this to Andrew.

Thanks Jeff.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-02  6:21         ` (Try #3) " WANG Cong
@ 2008-01-02 19:24           ` Sam Ravnborg
  2008-01-11 14:17           ` Ralf Baechle
  1 sibling, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 19:24 UTC (permalink / raw)
  To: WANG Cong
  Cc: Andreas Schwab, Ralf Baechle, LKML, linux-kbuild, Andrew Morton,
	linux-mips

On Wed, Jan 02, 2008 at 02:21:36PM +0800, WANG Cong wrote:
> 
> >> 
> >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
> >It would be better to use $(LINUXINCLUDE) as we then pull in all config
> >symbols too and do not have to hardcode kbuild internal names (include2).
> 
> OK. Refine this patch.
> 
> ----------->
> 
> Since TOPDIR is obsolete, this patch removes TOPDIR
> from the Mips Makefiles.
> 
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
Applied.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-02  6:27       ` (Try #3) " WANG Cong
@ 2008-01-02 19:25         ` Sam Ravnborg
  2008-01-03 17:03           ` Jesper Nilsson
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 19:25 UTC (permalink / raw)
  To: WANG Cong
  Cc: Mikael Starvik, LKML, linux-kbuild, Andrew Morton, dev-etrax,
	Andreas Schwab, Jesper Nilsson

On Wed, Jan 02, 2008 at 02:27:59PM +0800, WANG Cong wrote:
> 
> Refine it as suggested by Andreas.
> 
> -------->
> 
> This patch removes TOPDIR from Cris Makefiles.
> 
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Andreas Schwab <schwab@suse.de>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

Added Jesper to Cc and applied.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles
  2008-01-01 13:41     ` (Try #2) " WANG Cong
@ 2008-01-02 19:26       ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 19:26 UTC (permalink / raw)
  To: WANG Cong
  Cc: Roland Dreier, mshefty, LKML, linux-kbuild, Andrew Morton,
	hal.rosenstock

On Tue, Jan 01, 2008 at 09:41:08PM +0800, WANG Cong wrote:
> 
> >> -EXTRA_CFLAGS += -I$(TOPDIR)/drivers/net/cxgb3 \
> >> -		-I$(TOPDIR)/drivers/infiniband/hw/cxgb3/core
> >
> >> +EXTRA_CFLAGS += -I$(objtree)/drivers/net/cxgb3 \
> >Drop $(TOPDIR) like this:
> >> +EXTRA_CFLAGS += -Idrivers/net/cxgb3 \
> >
> >> +		-I$(objtree)/drivers/infiniband/hw/cxgb3/core
> >And this line can be deleted - there is no such directory.
> >At least not in my tree.
> 
> Yes, correct. Thank you.
> 
> ----------->
> 
> This patch removes TOPDIR from infiniband Makefiles.
> 
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Roland Dreier <rolandd@cisco.com>
> Cc: Sean Hefty <mshefty@ichips.intel.com>
> Cc: Hal Rosenstock <hal.rosenstock@gmail.com>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

Applied.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 6/8] FRV: Drop 'TOPDIR' from Makefiles
  2008-01-01 14:00     ` (Try #2) [Patch 6/8] FRV: Drop " WANG Cong
@ 2008-01-02 19:26       ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 19:26 UTC (permalink / raw)
  To: WANG Cong; +Cc: David Howells, LKML, linux-kbuild, Andrew Morton

On Tue, Jan 01, 2008 at 10:00:04PM +0800, WANG Cong wrote:
> >
> >In this file we can just drop use of $(TOPDIR) since this is our
> >current directory anyway.
> 
> Thanks!
> 
> -------->
> 
> This patch drops TOPDIR from frv Makefiles.
> 
> Cc: David Howells <dhowells@redhat.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 

Applied.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code
  2008-01-01 14:28     ` (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code WANG Cong
@ 2008-01-02 19:27       ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-02 19:27 UTC (permalink / raw)
  To: WANG Cong; +Cc: Tim Shimmin, LKML, linux-kbuild, Andrew Morton, viro

On Tue, Jan 01, 2008 at 10:28:52PM +0800, WANG Cong wrote:
> 
> >
> >The whole "Maintainer rules" part of this file should be deleted.
> >I cannot see how it can be used anyway.
> 
> Agreed.
> 
> I delete them all and renew the patch.
> Passed compiling test.
> 
> --------->
> 
> This patch drops TOPDIR since it's obsolete and removes
> some dead code from fs/smbfs/Makefile.
> 
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: Tim Shimmin <xfs-masters@oss.sgi.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

Applied.

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [Patch 0/8] Remove 'TOPDIR' from Makefiles
  2008-01-02  9:51 ` Sam Ravnborg
@ 2008-01-03  4:37   ` WANG Cong
  0 siblings, 0 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-03  4:37 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: WANG Cong, LKML, linux-kbuild, Andrew Morton


>Hi Wang.
>
>You a heads up. I will most likely apply
>the remaining of the patches tonight, except the UM stuff
>which I hope Jeff to take and the final removal of TOPDIR
>may wait a bit.
>I want the s390, xfs and um changes to hit -mm at least
>and we have several external modules that uses TOPDIR.
>
>And some of these external modules I care about - not
>all of them but some of them.
>
>	Sam

Thanks, Sam!

 Cong


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-02 19:25         ` Sam Ravnborg
@ 2008-01-03 17:03           ` Jesper Nilsson
  2008-01-03 19:59             ` Sam Ravnborg
  0 siblings, 1 reply; 50+ messages in thread
From: Jesper Nilsson @ 2008-01-03 17:03 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: WANG Cong, Mikael Starvik, LKML, linux-kbuild, Andrew Morton,
	dev-etrax, Andreas Schwab

On Wed, Jan 02, 2008 at 08:25:35PM +0100, Sam Ravnborg wrote:
> On Wed, Jan 02, 2008 at 02:27:59PM +0800, WANG Cong wrote:
> > 
> > Refine it as suggested by Andreas.
> > 
> > -------->
> > 
> > This patch removes TOPDIR from Cris Makefiles.

We had the TOPDIR replaced with $(srcdir) already, but this looks better.

Compiles OK for both EtraxFS and ARTPEC-3 cpus in our tree.

> > Cc: Mikael Starvik <starvik@axis.com>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Andreas Schwab <schwab@suse.de>
> > Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> Added Jesper to Cc and applied.

Thanks!

> 	Sam

/^JN - Jesper Nilsson
--
               Jesper Nilsson -- jesper.nilsson@axis.com

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles
  2008-01-03 17:03           ` Jesper Nilsson
@ 2008-01-03 19:59             ` Sam Ravnborg
  0 siblings, 0 replies; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-03 19:59 UTC (permalink / raw)
  To: Jesper Nilsson
  Cc: WANG Cong, Mikael Starvik, LKML, linux-kbuild, Andrew Morton,
	dev-etrax, Andreas Schwab

On Thu, Jan 03, 2008 at 06:03:22PM +0100, Jesper Nilsson wrote:
> On Wed, Jan 02, 2008 at 08:25:35PM +0100, Sam Ravnborg wrote:
> > On Wed, Jan 02, 2008 at 02:27:59PM +0800, WANG Cong wrote:
> > > 
> > > Refine it as suggested by Andreas.
> > > 
> > > -------->
> > > 
> > > This patch removes TOPDIR from Cris Makefiles.
> 
> We had the TOPDIR replaced with $(srcdir) already, but this looks better.
> 
> Compiles OK for both EtraxFS and ARTPEC-3 cpus in our tree.

Thanks - added a:
Tested-by: Jesper Nilsson <jesper.nilsson@axis.com>

	Sam

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-02  6:21         ` (Try #3) " WANG Cong
  2008-01-02 19:24           ` Sam Ravnborg
@ 2008-01-11 14:17           ` Ralf Baechle
  2008-01-11 17:02             ` Sam Ravnborg
  1 sibling, 1 reply; 50+ messages in thread
From: Ralf Baechle @ 2008-01-11 14:17 UTC (permalink / raw)
  To: WANG Cong
  Cc: Sam Ravnborg, Andreas Schwab, LKML, linux-kbuild, Andrew Morton,
	linux-mips

On Wed, Jan 02, 2008 at 02:21:36PM +0800, WANG Cong wrote:

> >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
> >It would be better to use $(LINUXINCLUDE) as we then pull in all config
> >symbols too and do not have to hardcode kbuild internal names (include2).
> 
> OK. Refine this patch.

LDSCRIPT also needed fixing to get builds in a separate object directory
working again.

I've applied below fix.

  Ralf

>From 8babf06e1265214116fb8ffc634c04df85597c52 Mon Sep 17 00:00:00 2001
From: WANG Cong <xiyou.wangcong@gmail.com>
Date: Wed, 2 Jan 2008 14:21:36 +0800
Subject: [PATCH] [MIPS] Lasat: Fix built in separate object directory.

Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>

[Ralf: The LDSCRIPT script needed fixing, too]

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
index 5332449..7ccd40d 100644
--- a/arch/mips/lasat/image/Makefile
+++ b/arch/mips/lasat/image/Makefile
@@ -12,11 +12,11 @@ endif
 
 MKLASATIMG = mklasatimg
 MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
-KERNEL_IMAGE = $(TOPDIR)/vmlinux
+KERNEL_IMAGE = vmlinux
 KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
 KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
 
-LDSCRIPT= -L$(obj) -Tromscript.normal
+LDSCRIPT= -L$(srctree)/$(obj) -Tromscript.normal
 
 HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D_kernel_entry=0x$(KERNEL_ENTRY) \
@@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
 		-D TIMESTAMP=$(shell date +%s)
 
 $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
-	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
+	$(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
 
 OBJECTS = head.o kImage.o
 

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-11 14:17           ` Ralf Baechle
@ 2008-01-11 17:02             ` Sam Ravnborg
  2008-01-14  6:26               ` WANG Cong
  0 siblings, 1 reply; 50+ messages in thread
From: Sam Ravnborg @ 2008-01-11 17:02 UTC (permalink / raw)
  To: Ralf Baechle
  Cc: WANG Cong, Andreas Schwab, LKML, linux-kbuild, Andrew Morton, linux-mips

On Fri, Jan 11, 2008 at 02:17:54PM +0000, Ralf Baechle wrote:
> On Wed, Jan 02, 2008 at 02:21:36PM +0800, WANG Cong wrote:
> 
> > >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
> > >It would be better to use $(LINUXINCLUDE) as we then pull in all config
> > >symbols too and do not have to hardcode kbuild internal names (include2).
> > 
> > OK. Refine this patch.
> 
> LDSCRIPT also needed fixing to get builds in a separate object directory
> working again.
> 
> I've applied below fix.

Great - I will drop it from my tree. 

See small comment below.

	Sam


>   Ralf
> 
> From 8babf06e1265214116fb8ffc634c04df85597c52 Mon Sep 17 00:00:00 2001
> From: WANG Cong <xiyou.wangcong@gmail.com>
> Date: Wed, 2 Jan 2008 14:21:36 +0800
> Subject: [PATCH] [MIPS] Lasat: Fix built in separate object directory.
> 
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
> 
> [Ralf: The LDSCRIPT script needed fixing, too]
> 
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
> 
> diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
> index 5332449..7ccd40d 100644
> --- a/arch/mips/lasat/image/Makefile
> +++ b/arch/mips/lasat/image/Makefile
> @@ -12,11 +12,11 @@ endif
>  
>  MKLASATIMG = mklasatimg
>  MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
> -KERNEL_IMAGE = $(TOPDIR)/vmlinux
> +KERNEL_IMAGE = vmlinux
>  KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
>  KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
>  
> -LDSCRIPT= -L$(obj) -Tromscript.normal
> +LDSCRIPT= -L$(srctree)/$(obj) -Tromscript.normal

This needs to read:
> +LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal


(There is no difference between src and obj in normal cases but to be consistent
it shuld be like above).

>  
>  HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
>  		-D_kernel_entry=0x$(KERNEL_ENTRY) \
> @@ -24,7 +24,7 @@ HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \
>  		-D TIMESTAMP=$(shell date +%s)
>  
>  $(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
> -	$(CC) -fno-pic $(HEAD_DEFINES) -I$(TOPDIR)/include -c -o $@ $<
> +	$(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
>  
>  OBJECTS = head.o kImage.o
>  

^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles
  2008-01-11 17:02             ` Sam Ravnborg
@ 2008-01-14  6:26               ` WANG Cong
  0 siblings, 0 replies; 50+ messages in thread
From: WANG Cong @ 2008-01-14  6:26 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Ralf Baechle, WANG Cong, Andreas Schwab, LKML, linux-kbuild,
	Andrew Morton, linux-mips

On Fri, Jan 11, 2008 at 06:02:04PM +0100, Sam Ravnborg wrote:
>On Fri, Jan 11, 2008 at 02:17:54PM +0000, Ralf Baechle wrote:
>> On Wed, Jan 02, 2008 at 02:21:36PM +0800, WANG Cong wrote:
>> 
>> > >> Shouldn't that use $(LINUXINCLUDE), or $(KBUILD_CPPFLAGS)?
>> > >It would be better to use $(LINUXINCLUDE) as we then pull in all config
>> > >symbols too and do not have to hardcode kbuild internal names (include2).
>> > 
>> > OK. Refine this patch.
>> 
>> LDSCRIPT also needed fixing to get builds in a separate object directory
>> working again.
>> 
>> I've applied below fix.
>
>Great - I will drop it from my tree. 
>
>See small comment below.
>
>	Sam
>
>
>>   Ralf
>> 
>> From 8babf06e1265214116fb8ffc634c04df85597c52 Mon Sep 17 00:00:00 2001
>> From: WANG Cong <xiyou.wangcong@gmail.com>
>> Date: Wed, 2 Jan 2008 14:21:36 +0800
>> Subject: [PATCH] [MIPS] Lasat: Fix built in separate object directory.
>> 
>> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
>> 
>> [Ralf: The LDSCRIPT script needed fixing, too]
>> 
>> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
>> 
>> diff --git a/arch/mips/lasat/image/Makefile b/arch/mips/lasat/image/Makefile
>> index 5332449..7ccd40d 100644
>> --- a/arch/mips/lasat/image/Makefile
>> +++ b/arch/mips/lasat/image/Makefile
>> @@ -12,11 +12,11 @@ endif
>>  
>>  MKLASATIMG = mklasatimg
>>  MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
>> -KERNEL_IMAGE = $(TOPDIR)/vmlinux
>> +KERNEL_IMAGE = vmlinux
>>  KERNEL_START = $(shell $(NM) $(KERNEL_IMAGE) | grep " _text" | cut -f1 -d\ )
>>  KERNEL_ENTRY = $(shell $(NM) $(KERNEL_IMAGE) | grep kernel_entry | cut -f1 -d\ )
>>  
>> -LDSCRIPT= -L$(obj) -Tromscript.normal
>> +LDSCRIPT= -L$(srctree)/$(obj) -Tromscript.normal
>
>This needs to read:
>> +LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
>
>
>(There is no difference between src and obj in normal cases but to be consistent
>it shuld be like above).

Agreed. Thank you!


^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2008-01-14  6:27 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-01  7:13 [Patch 0/8] Remove 'TOPDIR' from Makefiles WANG Cong
2008-01-01  7:18 ` [Patch 1/8] UML: " WANG Cong
2008-01-01 10:33   ` Sam Ravnborg
2008-01-01 10:49     ` Sam Ravnborg
2008-01-01 13:01       ` (Try #2) " WANG Cong
2008-01-02 15:02         ` Jeff Dike
2008-01-02 17:27           ` Sam Ravnborg
2008-01-01  7:22 ` [Patch 2/8] MIPS: " WANG Cong
2008-01-01 10:15   ` Sam Ravnborg
2008-01-01 13:11     ` (Try #2) " WANG Cong
2008-01-01 13:44     ` Andreas Schwab
2008-01-01 17:57       ` Sam Ravnborg
2008-01-02  6:21         ` (Try #3) " WANG Cong
2008-01-02 19:24           ` Sam Ravnborg
2008-01-11 14:17           ` Ralf Baechle
2008-01-11 17:02             ` Sam Ravnborg
2008-01-14  6:26               ` WANG Cong
2008-01-01  7:25 ` [Patch 3/8] S390: " WANG Cong
2008-01-01 10:17   ` Sam Ravnborg
2008-01-01 13:27     ` (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile WANG Cong
2008-01-01 17:42       ` Sam Ravnborg
2008-01-02  6:42         ` (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile WANG Cong
2008-01-02  9:31           ` Martin Schwidefsky
2008-01-02  9:49             ` Sam Ravnborg
2008-01-01  7:29 ` [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles WANG Cong
2008-01-01 10:20   ` Sam Ravnborg
2008-01-01 13:34     ` (Try #2) " WANG Cong
2008-01-02  6:27       ` (Try #3) " WANG Cong
2008-01-02 19:25         ` Sam Ravnborg
2008-01-03 17:03           ` Jesper Nilsson
2008-01-03 19:59             ` Sam Ravnborg
2008-01-01  7:33 ` [Patch 5/8] INFINIBAND: " WANG Cong
2008-01-01 10:26   ` Sam Ravnborg
2008-01-01 13:41     ` (Try #2) " WANG Cong
2008-01-02 19:26       ` Sam Ravnborg
2008-01-01  7:36 ` [Patch 6/8] FRV: " WANG Cong
2008-01-01 10:27   ` Sam Ravnborg
2008-01-01 14:00     ` (Try #2) [Patch 6/8] FRV: Drop " WANG Cong
2008-01-02 19:26       ` Sam Ravnborg
2008-01-01  7:41 ` [Patch 7/8] FS: Remove " WANG Cong
2008-01-01 10:30   ` Sam Ravnborg
2008-01-01 14:28     ` (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code WANG Cong
2008-01-02 19:27       ` Sam Ravnborg
2008-01-01 17:27   ` [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles Eric Sandeen
2008-01-01 17:37     ` Sam Ravnborg
2008-01-02  5:55       ` (Try #3) [Patch 7/8] FS: Remove dead code WANG Cong
2008-01-01  7:43 ` [Patch 8/8] Remove 'TOPDIR' from the Top Makefile WANG Cong
2008-01-01 10:09 ` [Patch 0/8] Remove 'TOPDIR' from Makefiles Sam Ravnborg
2008-01-02  9:51 ` Sam Ravnborg
2008-01-03  4:37   ` WANG Cong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).