[U-Boot-Users] [PATCH] Fix 8xx build to conditionally compile fdt.o

Jerry Van Baren gvb.uboot at gmail.com
Sun Mar 30 04:06:31 CEST 2008


Change to COBJS-y method so that the fdt.o library can be properly
conditionally compiled.  Without this change, the mpc8xx boards that
don't use CONFIG_OF_LIBFDT still build the fdt.o, causing code bloat
and compile warnings.

Signed-off-by: Gerald Van Baren <vanbaren at cideas.com>
---

Hi Wolfgang, 

Commit a6f5f317cd074bbbfa2aab4fca05904c811c19fb added fdt.o unconditionally.
    8xx : Add OF support to Adder875 board port - resubmit

I don't have any 8xx boards (especially no Adder boards) so I cannot
verify the patch doesn't break the boards, but it does compile cleanly
both with and w/o CONFIG_OF_LIBFDT.

Best regards,
gvb

 cpu/mpc8xx/Makefile |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/cpu/mpc8xx/Makefile b/cpu/mpc8xx/Makefile
index dbdc2e0..a800210 100644
--- a/cpu/mpc8xx/Makefile
+++ b/cpu/mpc8xx/Makefile
@@ -28,14 +28,28 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o kgdb.o
-COBJS	= bedbug_860.o commproc.o cpu.o cpu_init.o	\
-	  fec.o fdt.o i2c.o interrupts.o lcd.o scc.o	\
-	  serial.o speed.o spi.o \
-	  traps.o upatch.o video.o
+
+COBJS-y	+= bedbug_860.o
+COBJS-y	+= commproc.o
+COBJS-y	+= cpu.o
+COBJS-y	+= cpu_init.o
+COBJS-y	+= fec.o
+COBJS-y	+= i2c.o
+COBJS-y	+= lcd.o
+COBJS-y	+= interrupts.o
+COBJS-y	+= scc.o
+COBJS-y	+= serial.o
+COBJS-y	+= speed.o
+COBJS-y	+= spi.o
+COBJS-y	+= traps.o
+COBJS-y	+= upatch.o
+COBJS-y	+= video.o
+COBJS-$(CONFIG_OF_LIBFDT) += fdt.o
+
 SOBJS	= plprcr_write.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS-y))
 START	:= $(addprefix $(obj),$(START))
 
 all:	$(obj).depend $(START) $(LIB)
-- 
1.5.4.1





More information about the U-Boot mailing list