[U-Boot] [PATCH] Fix up rsk7203 target for out of tree build
Kieran Bingham
kbingham at mpc-data.co.uk
Tue Dec 30 01:42:44 CET 2008
Fix up rsk7203 target to build successfully using out-of-tree build.
Signed-off-by: Kieran Bingham <kbingham at mpc-data.co.uk>
---
Makefile | 6 +++---
board/renesas/rsk7203/Makefile | 11 ++++++++---
cpu/sh2/Makefile | 21 +++++++++++++--------
3 files changed, 24 insertions(+), 14 deletions(-)
diff --git a/Makefile b/Makefile
index d6cd91a..a7cb9bc 100644
--- a/Makefile
+++ b/Makefile
@@ -3200,9 +3200,9 @@ mimc200_config : unconfig
## sh2 (Renesas SuperH)
#########################################################################
rsk7203_config: unconfig
- @ >include/config.h
- @echo "#define CONFIG_RSK7203 1" >> include/config.h
- @$(MKCONFIG) -a $(@:_config=) sh sh2 rsk7203 renesas
+ @mkdir -p $(obj)include
+ echo "#define CONFIG_RSK7203 1" > $(obj)/include/config.h
+ $(MKCONFIG) -a $(@:_config=) sh sh2 rsk7203 renesas
#########################################################################
## sh3 (Renesas SuperH)
diff --git a/board/renesas/rsk7203/Makefile b/board/renesas/rsk7203/Makefile
index 7365d19..a404e73 100644
--- a/board/renesas/rsk7203/Makefile
+++ b/board/renesas/rsk7203/Makefile
@@ -21,10 +21,15 @@
include $(TOPDIR)/config.mk
-LIB = lib$(BOARD).a
+LIB-y = lib$(BOARD).a
+
+COBJS-y := rsk7203.o
+SOBJS-y := lowlevel_init.o
+
+OBJS := $(addprefix $(obj),$(COBJS-y))
+SOBJS := $(addprefix $(obj),$(SOBJS-y))
+LIB := $(addprefix $(obj),$(LIB-y))
-OBJS := rsk7203.o
-SOBJS := lowlevel_init.o
$(LIB): $(obj).depend $(OBJS) $(SOBJS)
$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
diff --git a/cpu/sh2/Makefile b/cpu/sh2/Makefile
index e33ba0f..346d328 100644
--- a/cpu/sh2/Makefile
+++ b/cpu/sh2/Makefile
@@ -28,18 +28,23 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(CPU).a
-START = start.o
-OBJS = cpu.o interrupts.o watchdog.o
+SOBJS = start.o
+COBJS = cpu.o interrupts.o watchdog.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 $(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
--
1.6.1
More information about the U-Boot
mailing list