]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cpu/sh4/Makefile
Cleanup: fix out-of-tree building for some boards
[people/ms/u-boot.git] / cpu / sh4 / Makefile
index aaaaf1fb4cea51d809ca61fb65b633191ce3bd96..61929131dc56c9f3c13a8aa206a00a7beac5f216 100644 (file)
@@ -28,19 +28,27 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(CPU).a
 
-START  = start.o
+SOBJS  = start.o
 OBJS   = cpu.o interrupts.o watchdog.o time.o cache.o
 
-all:   .depend $(START) $(LIB)
+SRCS   := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS   := $(addprefix $(obj),$(COBJS))
+SOBJS  := $(addprefix $(obj),$(SOBJS))
 
-$(LIB):        $(OBJS)
-       $(AR) $(ARFLAGS) $@ $(OBJS)
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak .depend
 
 #########################################################################
 
-.depend:       Makefile $(START:.o=.S) $(OBJS:.o=.c)
-               $(CC) -M $(CFLAGS) $(START:.o=.S) $(OBJS:.o=.c) > $@
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
 
-sinclude .depend
+sinclude $(obj).depend
 
 #########################################################################