[PATCH] ppc: fix build with O=$(output_dir)

From: Roland Dreier
Date: Tue Oct 19 2004 - 01:52:08 EST


Recent changes to arch/ppc/boot/lib/Makefile cause

CC arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o
Assembler messages:
FATAL: can't create arch/ppc/boot/lib/../../../../lib/zlib_inflate/infblock.o: No such file or directory

when building a ppc kernel using O=$(output_dir) with CONFIG_ZLIB_INFLATE=n,
because the $(output_dir)/lib/zlib_inflate directory doesn't get created.

This patch, which makes arch/ppc/boot/lib/Makefile create the
directory if needed, is one fix for the problem.

Signed-off-by: Roland Dreier <roland@xxxxxxxxxxx>

Index: linux-2.6.9/arch/ppc/boot/lib/Makefile
===================================================================
--- linux-2.6.9.orig/arch/ppc/boot/lib/Makefile 2004-10-18 14:54:55.000000000 -0700
+++ linux-2.6.9/arch/ppc/boot/lib/Makefile 2004-10-18 23:41:28.000000000 -0700
@@ -4,7 +4,13 @@

CFLAGS_kbd.o += -Idrivers/char

-lib-y := $(addprefix ../../../../lib/zlib_inflate/, \
+ZLIB_DIR := ../../../../lib/zlib_inflate/
+
+lib-y := $(addprefix $(ZLIB_DIR), \
infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o)
lib-y += div64.o
lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+
+ifneq ($(KBUILD_SRC),)
+_make_zlib_dir := $(shell [ -d $(obj)/$(ZLIB_DIR) ] || mkdir -p $(obj)/$(ZLIB_DIR) )
+endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/