]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - board/ms7720se/Makefile
Cleanup: fix out-of-tree building for some boards
[people/ms/u-boot.git] / board / ms7720se / Makefile
index 236959c15d6261f863bb551952c29968ac68c058..0288bede3ed021df96a9893306a2c0564471fb90 100644 (file)
 
 include $(TOPDIR)/config.mk
 
-LIB    = lib$(BOARD).a
+LIB    = $(obj)lib$(BOARD).a
 
 OBJS   := ms7720se.o
 SOBJS  := lowlevel_init.o
 
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
+
 $(LIB):        $(OBJS) $(SOBJS)
        $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
@@ -43,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
 
 #########################################################################