Skip to contentSkip to conversation

Fix for 2.6.6 Makefiles to get KBUILD_OUTPUT working

PATCH In review Mathieu Chouquet-Stringer 2 participants 4 messages May 16, 2004 – May 18, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix for 2.6.6 Makefiles to get KBUILD_OUTPUT working

	Hi,

if you use O=/someotherdir or KBUILD_OUTPUT=/someotherdir on the following
architectures: alpha, mips, sh and cris, the build process is probably going to fail at one point or another, depending on the target you used, because make can't find scripts/Makefile.build or scripts/Makefile.clean.

The following patch (which should apply cleanly to the latest 2.6.6 bk tree) fixes this, I greped the whole tree and these four were the only "offenders" I found.

PS: Andrew I mailed you because I couldn't find the maintainer for the sh
port and you're the last who touched arch/sh/Makefile

alpha/Makefile renamed from alpha/Makefile.orig +3 -3
@@ -106,10 +106,10 @@ boot := arch/alpha/boot
 all boot: $(boot)/vmlinux.gz
 
 $(boot)/vmlinux.gz: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $@
+	$(Q)$(MAKE) $(build)=$(boot) $@
 
 bootimage bootpfile bootpzfile: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $(boot)/$@
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 
 prepare: include/asm-$(ARCH)/asm_offsets.h
@@ -121,7 +121,7 @@ include/asm-$(ARCH)/asm_offsets.h: arch/
 	$(call filechk,gen-asm-offsets)
 
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
+	$(Q)$(MAKE) $(clean)=$(boot)
 
 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
 
mips/Makefile renamed from mips/Makefile.orig +4 -4
@@ -686,7 +686,7 @@ vmlinux.64: vmlinux
 		--change-addresses=0xa800000080000000 $< $@
 endif
 
-makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/mips/boot $(1)
+makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1)
 
 ifdef CONFIG_SGI_IP27
 all:	vmlinux.64
@@ -708,9 +708,9 @@ CLEAN_FILES += vmlinux.ecoff \
 	       vmlinux.rm200
 
 archclean:
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/boot
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/baget
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/lasat
+	@$(MAKE) $(clean)=arch/mips/boot
+	@$(MAKE) $(clean)=arch/mips/baget
+	@$(MAKE) $(clean)=arch/mips/lasat
 
 # Generate <asm/offset.h 
 #
sh/boot/Makefile renamed from sh/boot/Makefile.orig +1 -1
@@ -16,5 +16,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux
 	@echo 'Kernel: $@ is ready'
 
 $(obj)/compressed/vmlinux: FORCE
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
cris/Makefile renamed from cris/Makefile.orig +1 -1
@@ -81,7 +81,7 @@ compressed: zImage
 
 archmrproper:
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot	
+	$(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot	
 	rm -f timage vmlinux.bin cramfs.img
 	rm -rf $(LD_SCRIPT).tmp
 
Signature · 4 lines
Mathieu Chouquet-Stringer                 E-Mail: [email protected]
       Never attribute to malice that which can be adequately
                    explained by stupidity.
                     -- Hanlon's Razor --
#1 lore raw
Quoted 10 lines · Mathieu Chouquet-Stringer
	Hi,

if you use O=/someotherdir or KBUILD_OUTPUT=/someotherdir on the following
architectures: alpha, mips, sh and cris, the build process is probably going to fail at one point or another, depending on the target you used, because make can't find scripts/Makefile.build or scripts/Makefile.clean.

The following patch (which should apply cleanly to the latest 2.6.6 bk tree) fixes this, I greped the whole tree and these four were the only "offenders" I found.

Thanks, it has been on my todo for a while.
A few comments though.

mips/Makefile vmlinux.64: vmlinux · line 689

Quoted 5 lines
mips/Makefile renamed from mips/Makefile.orig +1 -1
 
-makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/mips/boot $(1)
+makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1)

Please get rid of makeboot. Use $(Q)$(MAKE) ... instead.
Hereby the '+' sign is no longer needed (used today where makeboot is used.

mips/Makefile CLEAN_FILES += vmlinux.ecoff \ · line 713

Quoted 7 lines

archclean:

mips/Makefile renamed from mips/Makefile.orig +3 -3
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/boot
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/baget
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/lasat
+	@$(MAKE) $(clean)=arch/mips/boot
+	@$(MAKE) $(clean)=arch/mips/baget
+	@$(MAKE) $(clean)=arch/mips/lasat

Please use $(Q)$(MAKE), so command is expanded with make V=1, and to make it look like all other usages.

cris/Makefile

Quoted 2 lines
cris/Makefile renamed from cris/Makefile.orig +0 -0

OK.

But this file in general looks strange. There seems to be no way to descend into arch-v10?
Mikael - any pending patches for this file / architecture?

Mathieu, could you please update the patch and send onwards to Andrew. Do not touch the cris Makefile more than you did, the maintainer needs to clean it up.

Thanks,
Sam

#2 lore raw
Quoted 8 lines · Sam Ravnborg

mips/Makefile

Quoted 5 lines
mips/Makefile renamed from mips/Makefile.orig +1 -1
 
-makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/mips/boot $(1)
+makeboot =$(Q)$(MAKE) $(build)=arch/mips/boot $(1)

Please get rid of makeboot. Use $(Q)$(MAKE) ... instead.
Hereby the '+' sign is no longer needed (used today where makeboot is used.

Ok, I applied the changes you requested, please check the diff for mips as I had to modify some other lines too.

alpha/Makefile renamed from alpha/Makefile.orig +11 -13
@@ -106,10 +106,10 @@ boot := arch/alpha/boot
 all boot: $(boot)/vmlinux.gz
 
 $(boot)/vmlinux.gz: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $@
+	$(Q)$(MAKE) $(build)=$(boot) $@
 
 bootimage bootpfile bootpzfile: vmlinux
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(boot) $(boot)/$@
+	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
 
 
 prepare: include/asm-$(ARCH)/asm_offsets.h
@@ -121,8 +121,8 @@ include/asm-$(ARCH)/asm_offsets.h: arch/
 	$(call filechk,gen-asm-offsets)
 
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=$(boot)
+	$(Q)$(MAKE) $(clean)=$(boot)
 
 CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h
 
--- arch/mips/Makefile.orig	2004-05-15 20:48:52.000000000 -0400
+++ arch/mips/Makefile	2004-05-17 11:11:57.000000000 -0400
@@ -686,8 +686,6 @@ vmlinux.64: vmlinux
 		--change-addresses=0xa800000080000000 $< $@
 endif
 
-makeboot =$(Q)$(MAKE) -f scripts/Makefile.build obj=arch/mips/boot $(1)
-
 ifdef CONFIG_SGI_IP27
 all:	vmlinux.64
 endif
@@ -697,10 +695,10 @@ all:	vmlinux.ecoff
 endif
 
 vmlinux.ecoff vmlinux.rm200: vmlinux
-	+@$(call makeboot,$@)
+	$(Q)$(MAKE) $(build)=arch/mips/boot $@
 
 vmlinux.srec: vmlinux
-	+@$(call makeboot,$@)
+	$(Q)$(MAKE) $(build)=arch/mips/boot $@
 
 CLEAN_FILES += vmlinux.ecoff \
 	       vmlinux.srec \
@@ -708,10 +706,10 @@ CLEAN_FILES += vmlinux.ecoff \
 	       vmlinux.rm200
 
 archclean:
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/boot
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/baget
-	@$(MAKE) -f scripts/Makefile.clean obj=arch/mips/lasat
+	$(Q)$(MAKE) $(clean)=arch/mips/boot
+	$(Q)$(MAKE) $(clean)=arch/mips/baget
+	$(Q)$(MAKE) $(clean)=arch/mips/lasat
 
 # Generate <asm/offset.h 
 #
--- arch/sh/boot/Makefile.orig	2004-05-15 20:50:11.000000000 -0400
+++ arch/sh/boot/Makefile	2004-05-15 20:50:41.000000000 -0400
@@ -16,5 +16,5 @@ $(obj)/zImage: $(obj)/compressed/vmlinux
 	@echo 'Kernel: $@ is ready'
 
 $(obj)/compressed/vmlinux: FORCE
-	$(Q)$(MAKE) -f scripts/Makefile.build obj=$(obj)/compressed $@
+	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
cris/Makefile renamed from cris/Makefile.orig +1 -1
@@ -81,7 +81,7 @@ compressed: zImage
 
 archmrproper:
 archclean:
-	$(Q)$(MAKE) -f scripts/Makefile.clean obj=arch/$(ARCH)/boot	
+	$(Q)$(MAKE) $(clean)=arch/$(ARCH)/boot	
 	rm -f timage vmlinux.bin cramfs.img
 	rm -rf $(LD_SCRIPT).tmp
 
Signature · 4 lines
Mathieu Chouquet-Stringer                 E-Mail: [email protected]
       Never attribute to malice that which can be adequately
                    explained by stupidity.
                     -- Hanlon's Razor --
#3 lore raw
Quoted 4 lines
Quoted 1 line

Hereby the '+' sign is no longer needed (used today where makeboot is used.

Ok, I applied the changes you requested, please check the diff for mips as I had to modify some other lines too.

Looks goood, but the cris part is missing?
Please pass on current patch to Andrew with a nice changelog entry. The cris part we can take later if Mikael does not surface.

Sam