Skip to contentSkip to conversation

Remove 'TOPDIR' from Makefiles

PATCH Applied WANG Cong 8 participants 50 messages Jan 1, 2008 – Jan 14, 2008

Subsystems (7)
x86 Kbuild MIPS InfiniBand +3 more subsystems
lore
Share & tools
lore

WANG Cong

author
#0 lore raw

cover Remove 'TOPDIR' from Makefiles

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 <[email protected]>
Cc Andrew Morton <[email protected]>
author
#1 lore raw

PATCH 1/8 UML: Remove 'TOPDIR' from Makefiles

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

Cc Jeff Dike <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/um/Makefile +2 -2
index ba6813a..57491af 100644
@@ -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:
arch/um/sys-ppc/Makefile +11 -11
index a9814a7..a3cfae7 100644
@@ -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
 
arch/x86/Makefile_32 +0 -0

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#2 lore raw

Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

Quoted 4 lines · WANG Cong

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#3 lore raw

Re: [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

Quoted 11 lines · Sam Ravnborg
Quoted 4 lines · WANG Cong

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#4 lore raw

(Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

Quoted 13 lines · Sam Ravnborg
Quoted 11 lines · Sam Ravnborg
Quoted 4 lines · WANG Cong

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...

Quoted 8 lines

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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/um/Makefile +2 -2
index ba6813a..08a2865 100644
@@ -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:
arch/um/sys-ppc/Makefile +11 -11
index a9814a7..0890152 100644
@@ -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
 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

#5 lore raw

Re: (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

Quoted 2 lines · WANG Cong

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

Thanks, I'll send this to Andrew.

Jeff

Signature · 10 lines
Work email - jdike at linux dot intel dot com

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel
#6 lore raw

Re: (Try #2) [Patch 1/8] UML: Remove 'TOPDIR' from Makefiles

Quoted 5 lines · Jeff Dike
Quoted 2 lines · WANG Cong

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

Thanks, I'll send this to Andrew.

Thanks Jeff.

Sam

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

author
#7 lore raw

PATCH 2/8 MIPS: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc Ralf Baechle <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/mips/lasat/image/Makefile +2 -2
index 5332449..5196962 100644
@@ -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
 
#8 lore raw

Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 15 lines · WANG Cong

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

Cc Ralf Baechle <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/mips/lasat/image/Makefile +0 -0
index 5332449..5196962 100644

arch/mips/lasat/image/Makefile endif · line 15

Quoted 5 lines
arch/mips/lasat/image/Makefile +1 -1
@@ -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:

arch/mips/lasat/image/Makefile HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 27

Quoted 12 lines
arch/mips/lasat/image/Makefile +2 -1
+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:

arch/mips/lasat/image/Makefile HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 28

Quoted 1 line
arch/mips/lasat/image/Makefile +1 -0
+	$(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

author
#9 lore raw

(Try #2) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 20 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
-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:

Review HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 27

Quoted 12 lines
(quoted diff) +2 -1
+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:

Quoted 4 lines

Review HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 28

Quoted 1 line
(quoted diff) +1 -0
+	$(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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/mips/lasat/image/Makefile +2 -2
index 5332449..1ae73ce 100644
@@ -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
 
#10 lore raw

Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

In reply to Sam Ravnborg
Quoted 8 lines · Sam Ravnborg

arch/mips/lasat/image/Makefile HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 27

Quoted 6 lines
arch/mips/lasat/image/Makefile +1 -1
@@ -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:

Quoted 4 lines

Review HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 28

Quoted 1 line
(quoted diff) +1 -0
+	$(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.

Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected]
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."
#11 lore raw

Re: [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Sam Ravnborg

arch/mips/lasat/image/Makefile HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 27

Quoted 6 lines
arch/mips/lasat/image/Makefile +1 -1
@@ -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:

Quoted 6 lines
Quoted 4 lines

Review HEAD_DEFINES := -D_kernel_start=0x$(KERNEL_START) \ · line 28

Quoted 1 line
(quoted diff) +1 -0
+	$(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

author
#12 lore raw

(Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 5 lines
Quoted 3 lines

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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/mips/lasat/image/Makefile +2 -2
index 5332449..17f5266 100644
@@ -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
 
Applied
#13 lore raw

Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 8 lines · WANG Cong
Quoted 5 lines
Quoted 3 lines

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.

Quoted 9 lines

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

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

Cc Ralf Baechle <[email protected]>
Cc Sam Ravnborg <[email protected]>

Applied.

Sam

#14 lore raw

Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong
Quoted 5 lines · WANG Cong
Quoted 3 lines
Quoted 1 line

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 <[email protected]>
Date: Wed, 2 Jan 2008 14:21:36 +0800
Subject: [PATCH] [MIPS] Lasat: Fix built in separate object directory.

[Ralf: The LDSCRIPT script needed fixing, too]

arch/mips/lasat/image/Makefile +3 -3
index 5332449..7ccd40d 100644
@@ -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
 
#15 lore raw

Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 6 lines · Ralf Baechle
Quoted 4 lines · WANG Cong
Quoted 3 lines
Quoted 1 line

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).

Quoted 6 lines
Quoted 1 line

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

Quoted 18 lines

Ralf

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

[Ralf: The LDSCRIPT script needed fixing, too]

arch/mips/lasat/image/Makefile +0 -0
index 5332449..7ccd40d 100644

arch/mips/lasat/image/Makefile endif · line 19

Quoted 10 lines
arch/mips/lasat/image/Makefile +2 -2
@@ -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:

arch/mips/lasat/image/Makefile endif · line 20

Quoted 1 line
arch/mips/lasat/image/Makefile +1 -0
+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).

Quoted 12 lines
arch/mips/lasat/image/Makefile +1 -1
 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
 
author
#16 lore raw

Re: (Try #3) [Patch 2/8] MIPS: Remove 'TOPDIR' from Makefiles

Quoted 51 lines · Sam Ravnborg
Quoted 6 lines · Ralf Baechle
Quoted 4 lines · WANG Cong
Quoted 3 lines
Quoted 1 line

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).

Quoted 6 lines
Quoted 1 line

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

Quoted 18 lines

Ralf

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

[Ralf: The LDSCRIPT script needed fixing, too]

arch/mips/lasat/image/Makefile +0 -0
index 5332449..7ccd40d 100644

arch/mips/lasat/image/Makefile endif · line 19

Quoted 10 lines
arch/mips/lasat/image/Makefile +2 -2
@@ -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:

Quoted 5 lines

arch/mips/lasat/image/Makefile endif · line 20

Quoted 1 line
arch/mips/lasat/image/Makefile +1 -0
+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!

author
#17 lore raw

PATCH 3/8 S390: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc Martin Schwidefsky <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/s390/kernel/Makefile +1 -1
index 56cb710..a753a71 100644
@@ -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
#18 lore raw

Re: [Patch 3/8] S390: Remove 'TOPDIR' from Makefiles

Quoted 15 lines · WANG Cong

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

Cc Martin Schwidefsky <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/s390/kernel/Makefile +0 -0
index 56cb710..a753a71 100644

arch/s390/kernel/Makefile obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS) · line 37

Quoted 5 lines
arch/s390/kernel/Makefile +1 -1
@@ -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

author
#19 lore raw

(Try #2) [Patch 3/8] S390: Tiny fixes for Makefile

Quoted 6 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
-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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

----

arch/s390/kernel/Makefile +2 -2
index 56cb710..4accf27 100644
@@ -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
#20 lore raw

Re: (Try #2) [Patch 3/8] S390: Tiny fixes for Makefile

Quoted 37 lines · WANG Cong
Quoted 6 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
-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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

----

arch/s390/kernel/Makefile +1 -1
index 56cb710..4accf27 100644
@@ -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

arch/s390/kernel/Makefile obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS) · line 37

Quoted 5 lines
arch/s390/kernel/Makefile +1 -1
@@ -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

author
#21 lore raw

(Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile

Quoted 10 lines

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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/s390/kernel/Makefile +0 -4
index 56cb710..b3b650a 100644
@@ -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
#22 lore raw

Re: (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile

arch/s390/kernel/Makefile S390_KEXEC_OBJS := machine_kexec.o crash.o · line 37

Quoted 13 lines · WANG Cong
arch/s390/kernel/Makefile +0 -4
index 56cb710..b3b650a 100644
@@ -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.

Signature · 4 lines
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.
#23 lore raw

Re: (Try #3) [Patch 3/8] S390: Remove 'TOPDIR' from Makefile

Quoted 10 lines · Martin Schwidefsky
Quoted 9 lines · WANG Cong
arch/s390/kernel/Makefile +0 -0
index 56cb710..b3b650a 100644
@@ -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)
Quoted 6 lines

arch/s390/kernel/Makefile S390_KEXEC_OBJS := machine_kexec.o crash.o · line 37

Quoted 4 lines
arch/s390/kernel/Makefile +0 -4
-#
-# 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

author
#24 lore raw

PATCH 4/8 CRIS: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc Mikael Starvik <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/cris/arch-v32/boot/compressed/Makefile +1 -1
index 9f77eda..8586922 100644
@@ -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
#25 lore raw

Re: [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles

Quoted 15 lines · WANG Cong

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

Cc Mikael Starvik <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/cris/arch-v32/boot/compressed/Makefile +0 -0
index 9f77eda..8586922 100644

arch/cris/arch-v32/boot/compressed/Makefile line 10

Quoted 5 lines
arch/cris/arch-v32/boot/compressed/Makefile +1 -1
@@ -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:

arch/cris/arch-v32/boot/compressed/Makefile line 11

Quoted 1 line
arch/cris/arch-v32/boot/compressed/Makefile +1 -0
+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

author
#26 lore raw

(Try #2) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles

Quoted 9 lines

Review

Quoted 3 lines
(quoted diff) +1 -1
-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:

Quoted 1 line

+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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/cris/arch-v32/boot/compressed/Makefile +1 -1
index 9f77eda..27e9f15 100644
@@ -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
author
#27 lore raw

(Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles

Refine it as suggested by Andreas.

-------->

This patch removes TOPDIR from Cris Makefiles.

Cc Mikael Starvik <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Andreas Schwab <[email protected]>

---

arch/cris/arch-v32/boot/compressed/Makefile +1 -1
index 9f77eda..609692f 100644
@@ -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
#29 lore raw

Re: (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles

Quoted 7 lines · Sam Ravnborg
Quoted 6 lines · WANG Cong

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.

Quoted 6 lines
Quoted 4 lines
Cc Mikael Starvik <[email protected]>
Cc Sam Ravnborg <[email protected]>
Cc Andreas Schwab <[email protected]>

Added Jesper to Cc and applied.

Thanks!

Quoted 1 line

Sam

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]

Tested-by Jesper Nilsson
#30 lore raw

Re: (Try #3) [Patch 4/8] CRIS: Remove 'TOPDIR' from Makefiles

Quoted 5 lines · Jesper Nilsson
Quoted 4 lines · Sam Ravnborg
Quoted 3 lines · WANG Cong

Refine it as suggested by Andreas.

Quoted 7 lines
Quoted 3 lines
Quoted 3 lines

-------->

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:

Sam

author
#31 lore raw

PATCH 5/8 INFINIBAND: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc Sam Ravnborg <[email protected]>
Cc Roland Dreier <[email protected]>
Cc Sean Hefty <[email protected]>
Cc Hal Rosenstock <[email protected]>

---

drivers/infiniband/hw/cxgb3/Makefile +2 -2
index 36b9898..b82286a 100644
@@ -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
 
#32 lore raw

Re: [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles

Quoted 17 lines · WANG Cong

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

Cc Sam Ravnborg <[email protected]>
Cc Roland Dreier <[email protected]>
Cc Sean Hefty <[email protected]>
Cc Hal Rosenstock <[email protected]>

---

drivers/infiniband/hw/cxgb3/Makefile +0 -0
index 36b9898..b82286a 100644

drivers/infiniband/hw/cxgb3/Makefile line 2

Quoted 4 lines
drivers/infiniband/hw/cxgb3/Makefile +1 -2
@@ -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:

drivers/infiniband/hw/cxgb3/Makefile line 5

Quoted 3 lines
drivers/infiniband/hw/cxgb3/Makefile +2 -0
+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

author
#33 lore raw

(Try #2) [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles

Quoted 11 lines

Review

Quoted 5 lines
(quoted diff) +1 -2
-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:

Review

Quoted 3 lines
(quoted diff) +2 -0
+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 <[email protected]>
Cc Roland Dreier <[email protected]>
Cc Sean Hefty <[email protected]>
Cc Hal Rosenstock <[email protected]>

---

drivers/infiniband/hw/cxgb3/Makefile +1 -2
index 36b9898..7e7b5a6 100644
@@ -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
 
Applied
#34 lore raw

Re: (Try #2) [Patch 5/8] INFINIBAND: Remove 'TOPDIR' from Makefiles

Quoted 16 lines · WANG Cong
Quoted 11 lines

drivers/infiniband/hw/cxgb3/Makefile

Quoted 5 lines
drivers/infiniband/hw/cxgb3/Makefile +1 -2
-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:

Review

Quoted 3 lines
(quoted diff) +2 -0
+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.

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

Quoted 7 lines

This patch removes TOPDIR from infiniband Makefiles.

Cc Sam Ravnborg <[email protected]>
Cc Roland Dreier <[email protected]>
Cc Sean Hefty <[email protected]>
Cc Hal Rosenstock <[email protected]>

Applied.

Sam

author
#35 lore raw

PATCH 6/8 FRV: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc David Howells <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/frv/boot/Makefile +4 -4
index dc6f038..d93f768 100644
@@ -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
#36 lore raw

Re: [Patch 6/8] FRV: Remove 'TOPDIR' from Makefiles

Quoted 33 lines · WANG Cong

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

Cc David Howells <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/frv/boot/Makefile +2 -2
index dc6f038..d93f768 100644
@@ -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

arch/frv/boot/Makefile initrd: · line 65

Quoted 9 lines
arch/frv/boot/Makefile +2 -2
@@ -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

author
#37 lore raw

(Try #2) [Patch 6/8] FRV: Drop 'TOPDIR' from Makefiles

Quoted 3 lines

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 <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

arch/frv/boot/Makefile +4 -4
index dc6f038..6ae3254 100644
@@ -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
Applied
#38 lore raw

Re: (Try #2) [Patch 6/8] FRV: Drop 'TOPDIR' from Makefiles

Quoted 6 lines · WANG Cong
Quoted 3 lines

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

Thanks!

Quoted 8 lines

-------->

This patch drops TOPDIR from frv Makefiles.

Cc David Howells <[email protected]>
Cc Sam Ravnborg <[email protected]>

Applied.

Sam

author
#39 lore raw

PATCH 7/8 FS: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

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

Cc Alexander Viro <[email protected]>
Cc Tim Shimmin <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

fs/smbfs/Makefile +1 -1
index 6673ee8..9b5e92b 100644
@@ -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
fs/xfs/Makefile +1 -1
index 49e3e7e..d1d3d49 100644
@@ -1 +1 @@
-include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
+include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
#40 lore raw

Re: [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles

Quoted 27 lines · WANG Cong

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

Cc Alexander Viro <[email protected]>
Cc Tim Shimmin <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

fs/smbfs/Makefile +1 -1
index 6673ee8..9b5e92b 100644
@@ -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
fs/xfs/Makefile +0 -0
index 49e3e7e..d1d3d49 100644

fs/xfs/Makefile line 1

Quoted 2 lines
fs/xfs/Makefile +1 -1
@@ -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

author
#41 lore raw

(Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code

Quoted 4 lines

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 <[email protected]>
Cc Tim Shimmin <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

fs/smbfs/Makefile +0 -20
index 6673ee8..4faf8c4 100644
@@ -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
fs/xfs/Makefile +1 -1
index 49e3e7e..d1d3d49 100644
@@ -1 +1 @@
-include $(TOPDIR)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
+include $(objtree)/fs/xfs/Makefile-linux-$(VERSION).$(PATCHLEVEL)
Applied
#42 lore raw

Re: (Try #2) [Patch 7/8] FS: Drop 'TOPDIR' from Makefiles and remove some dead code

Quoted 12 lines · WANG Cong
Quoted 4 lines

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.

--------->

Quoted 7 lines

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

Cc Alexander Viro <[email protected]>
Cc Tim Shimmin <[email protected]>
Cc Sam Ravnborg <[email protected]>

Applied.

Sam

#43 lore raw

Re: [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles

In reply to WANG Cong

fs/xfs/Makefile line 1

Quoted 10 lines · WANG Cong

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

fs/xfs/Makefile +1 -1
index 49e3e7e..d1d3d49 100644
@@ -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?

#44 lore raw

Re: [xfs-masters] [Patch 7/8] FS: Remove 'TOPDIR' from Makefiles

Quoted 4 lines · Eric Sandeen
Quoted 2 lines · WANG Cong

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

Quoted 10 lines

fs/xfs/Makefile line 1

Quoted 7 lines
fs/xfs/Makefile +1 -1
index 49e3e7e..d1d3d49 100644
@@ -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.

Quoted 5 lines

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

Quoted 4 lines

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

author
#45 lore raw

(Try #3) [Patch 7/8] FS: Remove dead code

Quoted 15 lines · Sam Ravnborg
Quoted 4 lines · Eric Sandeen
Quoted 2 lines · WANG Cong

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

Quoted 10 lines

fs/xfs/Makefile line 1

Quoted 7 lines
fs/xfs/Makefile +1 -1
index 49e3e7e..d1d3d49 100644
@@ -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:

Quoted 1 line

Good - I will ignore the xfs bits.

Thanks. I will drop the xfs part.

------->

Remove dead code in smbfs makefile.

Cc Alexander Viro <[email protected]>
Cc Tim Shimmin <[email protected]>
Cc Sam Ravnborg <[email protected]>

---

fs/smbfs/Makefile +0 -20
index 6673ee8..4faf8c4 100644
@@ -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
author
#46 lore raw

PATCH 8/8 Remove 'TOPDIR' from the Top Makefile

In reply to WANG Cong

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

Cc Sam Ravnborg <[email protected]>

---

Makefile +1 -3
index fbb8dfc..c892d14 100644
@@ -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
#47 lore raw
In reply to WANG Cong
Quoted 2 lines · WANG Cong

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

#48 lore raw
In reply to WANG Cong
Quoted 9 lines · WANG Cong

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

author
#49 lore raw
Quoted 10 lines

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.

Quoted 4 lines

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

Sam

Thanks, Sam!

Cong