]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/kb9202/Makefile
Add support for a saving build objects in a separate directory.
[people/ms/u-boot.git] / board / kb9202 / Makefile
index f36d88dc3f56da1e52c4e0d57f216112eb547f27..2adcb587adf6b62eecbf415e5428ab21a3048094 100644 (file)
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2003
+# (C) Copyright 2003-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$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := kb9202.o
+COBJS  := kb9202.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)
+       $(AR) crv $@ $(OBJS)
 
 clean:
        rm -f $(SOBJS) $(OBJS)
@@ -41,9 +45,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
 
 #########################################################################