]> git.sur5r.net Git - u-boot/blobdiff - cpu/arm920t/at91rm9200/Makefile
Add support for a saving build objects in a separate directory.
[u-boot] / cpu / arm920t / at91rm9200 / Makefile
index aec9cb640935548a30e24da6f828fa0810d5fc03..26b0b94f2b95a0148a3567301e2a172005800247 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2000-2005
+# (C) Copyright 2000-2006
 # Wolfgang Denk, DENX Software Engineering, wd@denx.de.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(SOC).a
+LIB    = $(obj)lib$(SOC).a
 
-OBJS   = bcm5221.o dm9161.o ether.o i2c.o interrupts.o \
+COBJS  = bcm5221.o dm9161.o ether.o i2c.o interrupts.o \
          lxt972.o serial.o usb_ohci.o
 SOBJS  = lowlevel_init.o
 
-all:   .depend $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(SOBJS) $(COBJS))
 
-$(LIB):        $(OBJS) $(SOBJS)
-       $(AR) crv $@ $(OBJS) $(SOBJS)
+all:   $(obj).depend $(LIB)
+
+$(LIB):        $(OBJS)
+       $(AR) crv $@ $(OBJS)
 
 #########################################################################
 
-.depend:       Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################