[U-Boot] [PATCH 1/3] PXA: Fix off-the-tree build problems

Marek Vasut marek.vasut at gmail.com
Sun Aug 8 02:39:49 CEST 2010


Signed-off-by: Marek Vasut <marek.vasut at gmail.com>
---
 board/colibri_pxa270/Makefile |   18 +++++++++++-------
 board/vpac270/Makefile        |   18 +++++++++++-------
 2 files changed, 22 insertions(+), 14 deletions(-)

diff --git a/board/colibri_pxa270/Makefile b/board/colibri_pxa270/Makefile
index 44d73cc..59575ca 100644
--- a/board/colibri_pxa270/Makefile
+++ b/board/colibri_pxa270/Makefile
@@ -21,13 +21,17 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	= lib$(BOARD).a
+LIB	= $(obj)lib$(BOARD).a
 
-OBJS	:= colibri_pxa270.o
+COBJS	:= colibri_pxa270.o
 SOBJS	:= lowlevel_init.o
 
-$(LIB):	$(OBJS) $(SOBJS)
-	$(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
@@ -37,9 +41,9 @@ distclean:	clean
 
 #########################################################################
 
-.depend:	Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-		$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
diff --git a/board/vpac270/Makefile b/board/vpac270/Makefile
index 0f3eacd..92fc3a0 100644
--- a/board/vpac270/Makefile
+++ b/board/vpac270/Makefile
@@ -24,13 +24,17 @@
 
 include $(TOPDIR)/config.mk
 
-LIB	= lib$(BOARD).a
+LIB	= $(obj)lib$(BOARD).a
 
-OBJS	:= vpac270.o
+COBJS	:= vpac270.o
 SOBJS	:= lowlevel_init.o
 
-$(LIB):	$(OBJS) $(SOBJS)
-	$(AR) crv $@ $(OBJS) $(SOBJS)
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
+$(LIB):	$(obj).depend $(OBJS) $(SOBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
@@ -40,9 +44,9 @@ distclean:	clean
 
 #########################################################################
 
-.depend:	Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-		$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #########################################################################
-- 
1.7.1



More information about the U-Boot mailing list