]> git.sur5r.net Git - u-boot/blobdiff - board/tqm834x/Makefile
Add support for a saving build objects in a separate directory.
[u-boot] / board / tqm834x / Makefile
index 3ecc7d090e2541c82c52d4d62a2b02b3088f19c8..6991cfbf28a3f94ad812d2f1c11ac0de2c7e654e 100644 (file)
@@ -1,4 +1,7 @@
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+# 
 # Copyright 2004 Freescale Semiconductor, Inc.
 #
 # See file CREDITS for list of people who contributed to this
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   = $(BOARD).o pci.o
+COBJS  = $(BOARD).o pci.o
 
-$(LIB):        $(OBJS) $(SOBJS)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
+$(LIB):        $(obj).depend $(OBJS)
        $(AR) crv $@ $(OBJS)
 
 clean:
@@ -37,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
 
 #########################################################################