Re: [PATCH/take 2] ppc: fix build with O=$(output_dir)

From: Sam Ravnborg
Date: Sun Oct 31 2004 - 16:53:22 EST


On Tue, Oct 19, 2004 at 11:29:28AM -0700, Tom Rini wrote:

> This misses the bit to invoke the checker as well (when I first thought
> this up I poked Al Viro about the general question of checker on boot
> code, and he wanted it, so...). And having 2 'magic' rules not just 1
> is why I don't like this too much and was hoping Sam would have some
> idea of a good fix.

Hi Tom.

Finally took a look.
The best approach is to grab a copy of the .c file and compile
that in this dir.
In this way we avoid unessesary recompile etc. but waste a bit disk space.
I do not like symlinks in general and made a copy. (note: uses cat to give
appropriate permission)

If you are OK with this let me know if you want me to push it to linus
or you go via the ppc tree.

PS: Had troubles with kbd so commented out.

Sam

===== Makefile 1.11 vs edited =====
--- 1.11/arch/ppc/boot/lib/Makefile 2004-10-25 21:47:48 +02:00
+++ edited/Makefile 2004-10-31 23:37:23 +01:00
@@ -2,9 +2,22 @@
# Makefile for some libs needed by zImage.
#

-CFLAGS_kbd.o += -Idrivers/char
+CFLAGS_kbd.o := -Idrivers/char
+CFLAGS_vreset.o := -I$(srctree)/arch/ppc/boot/include

-lib-y := $(addprefix ../../../../lib/zlib_inflate/, \
- infblock.o infcodes.o inffast.o inflate.o inftrees.o infutil.o)
-lib-y += div64.o
-lib-$(CONFIG_VGA_CONSOLE) += vreset.o kbd.o
+zlib := infblock.c infcodes.c inffast.c inflate.c inftrees.c infutil.c
+
+lib-y += $(zlib:.c=.o) div64.o
+lib-$(CONFIG_VGA_CONSOLE) += vreset.o #kbd.o
+
+
+# zlib files needs header from their original place
+EXTRA_CFLAGS += -Ilib/zlib_inflate
+
+quiet_cmd_copy_zlib = COPY $@
+ cmd_copy_zlib = cat $< > $@
+
+$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
+ $(call cmd,copy_zlib)
+
+clean-files := $(zlib)
-
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/