]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/mx1ads/Makefile
Add support for a saving build objects in a separate directory.
[people/ms/u-boot.git] / board / mx1ads / Makefile
index 3e805feb404aaeefc70c1b11a2c87dc57d50779e..96e5be505376056402636bd7f096586fa06f58f5 100644 (file)
@@ -1,6 +1,9 @@
 #
 # board/mx1ads/Makefile
 #
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
+#
 # (c) Copyright 2004
 # Techware Information Technology, Inc.
 # http://www.techware.com.tw/
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
-OBJS   := mx1ads.o syncflash.o
+COBJS  := mx1ads.o syncflash.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
 
 #########################################################################