]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - cpu/sh4/Makefile
sh: Fix SH-boards compile error
[people/ms/u-boot.git] / cpu / sh4 / Makefile
index 1bb8bd7729e88341e52a577048df7e1532875855..d3c5eef6be205397b669d84f51fc85938e49c12f 100644 (file)
@@ -28,19 +28,27 @@ include $(TOPDIR)/config.mk
 
 LIB    = $(obj)lib$(CPU).a
 
-START  = start.o
-OBJS   = cpu.o interrupts.o watchdog.o time.o cache.o
+SOBJS  = start.o
+COBJS  = 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) crv $@ $(OBJS)
+$(LIB):        $(OBJS) $(SOBJS)
+       $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
+
+clean:
+       rm -f $(SOBJS) $(OBJS)
+
+distclean:     clean
+       rm -f $(LIB) core *.bak $(obj).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
 
 #########################################################################