
From: Mathieu Chouquet-Stringer <mchouque@online.fr>

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 fixes this, I greped the whole tree and these four were
the only "offenders" I found.


---

 25-akpm/arch/alpha/Makefile   |    6 +++---
 25-akpm/arch/cris/Makefile    |    2 +-
 25-akpm/arch/mips/Makefile    |    8 ++++----
 25-akpm/arch/sh/boot/Makefile |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff -puN arch/alpha/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working arch/alpha/Makefile
--- 25/arch/alpha/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working	2004-05-16 00:09:23.594124912 -0700
+++ 25-akpm/arch/alpha/Makefile	2004-05-16 00:09:23.601123848 -0700
@@ -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
 
diff -puN arch/cris/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working arch/cris/Makefile
--- 25/arch/cris/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working	2004-05-16 00:09:23.595124760 -0700
+++ 25-akpm/arch/cris/Makefile	2004-05-16 00:09:23.602123696 -0700
@@ -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
 
diff -puN arch/mips/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working arch/mips/Makefile
--- 25/arch/mips/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working	2004-05-16 00:09:23.597124456 -0700
+++ 25-akpm/arch/mips/Makefile	2004-05-16 00:09:23.602123696 -0700
@@ -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 
 #
diff -puN arch/sh/boot/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working arch/sh/boot/Makefile
--- 25/arch/sh/boot/Makefile~fix-for-266-makefiles-to-get-kbuild_output-working	2004-05-16 00:09:23.598124304 -0700
+++ 25-akpm/arch/sh/boot/Makefile	2004-05-16 00:09:23.602123696 -0700
@@ -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 $@
 

_
