Commit 6027d602 authored by Sam Ravnborg's avatar Sam Ravnborg

ppc: fix building arch/ppc/boot/lib/ with make O=

arch/ppc/boot/lib/ reuses zlib_inflate from lib/zlib_inflate but kbuild
does not support two different places utilising the same .o file. It results
in recompile for each build because options to compiler changes etc.
So the trick used here is to make a copy of the required .c files.
Acked-by: default avatarTom Rini <trini@kernel.crashing.org>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent ab32f829
......@@ -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
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)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment