summaryrefslogtreecommitdiff
path: root/cpu/sh3
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-07-02 23:38:50 +0200
committerWolfgang Denk <wd@denx.de>2008-07-02 23:38:50 +0200
commita30cc5a340e7f8f5f85a0e08e7f6c4106ce117c4 (patch)
treed01afe0202765ea80f5b260cf3df0a86ba0ce1fa /cpu/sh3
parent461fa68d20861811487944d22291db5a13410e20 (diff)
Cleanup: fix out-of-tree building for some boards
Signed-off-by: Wolfgang Denk <wd@denx.de>
Diffstat (limited to 'cpu/sh3')
-rw-r--r--cpu/sh3/Makefile22
1 files changed, 15 insertions, 7 deletions
diff --git a/cpu/sh3/Makefile b/cpu/sh3/Makefile
index 1fdeb3cf34..441c765bb1 100644
--- a/cpu/sh3/Makefile
+++ b/cpu/sh3/Makefile
@@ -31,19 +31,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
#########################################################################