]> git.sur5r.net Git - u-boot/blobdiff - board/armadillo/Makefile
Add support for a saving build objects in a separate directory.
[u-boot] / board / armadillo / Makefile
index 52ea7f28d4413b83cd799a2f7d9236175ff122bf..80e1687bf68d75d1d1c9b0a36780d8da459c6625 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (C) Copyright 2002
 # Sysgo Real-Time Solutions, GmbH <www.elinos.com>
 # Marius Groeger <mgroeger@sysgo.de>
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := armadillo.o flash.o
+COBJS  := armadillo.o flash.o
 SOBJS  := lowlevel_init.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS) $(SOBJS)
        $(AR) crv $@ $(OBJS) $(SOBJS)
 
 clean:
@@ -40,9 +47,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
 
 #########################################################################