]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/mcc200/Makefile
Add support for a saving build objects in a separate directory.
[people/ms/u-boot.git] / board / mcc200 / Makefile
index 7fdc088e9c178724169c71dcc4f892d7305fd047..4b2bbe27d20d536a6b91e90ae0a328f623515dde 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := $(BOARD).o
+COBJS  := $(BOARD).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:
@@ -38,9 +42,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
 
 #########################################################################