Skip to contentSkip to conversation

sh: ms7750se: Fix "make O=" builds

PATCH New Sakae OTAKI 2 participants 2 messages Jul 5, 2008 – Jul 6, 2008 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sh: ms7750se: Fix "make O=" builds

When compiling ms7750se board with "make O=<some dir>", I got some errors. I tuned some makefiles.

---
 Makefile                |    1 +
 board/ms7750se/Makefile |   13 ++++++++-----
 cpu/sh4/Makefile        |   16 ++++++++++------
 3 files changed, 19 insertions(+), 11 deletions(-)
Makefile +1 -0
index 8bfc891..8835ba6 100644
@@ -2922,6 +2922,7 @@ ms7720se_config: unconfig
 ## sh4 (Renesas SuperH)
 #########################################################################
 ms7750se_config: unconfig
+	@mkdir -p $(obj)include
 	@echo "#define CONFIG_MS7750SE 1" > $(obj)include/config.h
 	@$(MKCONFIG) -a $(@:_config=) sh sh4 ms7750se
 
board/ms7750se/Makefile +8 -5
index f81d56c..9350775 100644
@@ -19,11 +19,15 @@
 #
 include $(TOPDIR)/config.mk
 
-LIB	= lib$(BOARD).a
+LIB	= $(obj)lib$(BOARD).a
 
-OBJS	:= ms7750se.o
+COBJS	:= ms7750se.o
 SOBJS	:= lowlevel_init.o
 
+SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+SOBJS	:= $(addprefix $(obj),$(SOBJS))
+
 $(LIB):	$(OBJS) $(SOBJS)
 	$(AR) crv $@ $(OBJS) $(SOBJS)
 
@@ -35,9 +39,8 @@ distclean:	clean
 
 #################################################################
 
-.depend:	Makefile $(SOBJS:.o=.S) $(OBJS:.o=.c)
-	$(CC) -M $(CPPFLAGS) $(SOBJS:.o=.S) $(OBJS:.o=.c) > $@
+include $(SRCTREE)/rules.mk
 
--include .depend
+sinclude $(obj).depend
 
 #################################################################
cpu/sh4/Makefile +10 -6
index 1bb8bd7..1353dbb 100644
@@ -29,18 +29,22 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).a
 
 START	= start.o
-OBJS	= cpu.o interrupts.o watchdog.o time.o cache.o
+COBJS	= cpu.o interrupts.o watchdog.o time.o cache.o
 
-all:	.depend $(START) $(LIB)
+SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+START	:= $(addprefix $(obj),$(START))
+
+all:	$(obj).depend $(START) $(LIB)
 
 $(LIB):	$(OBJS)
-	$(AR) crv $@ $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
 
 #########################################################################
 
-.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
 
 #########################################################################
Signature · 1 line
1.5.2.5
#1 lore raw

PATCH 1/1 sh: ms7750se: Fix "make O=" builds

Quoted 2 lines · In message <[email protected]> you…

When compiling ms7750se board with "make O=<some dir>", I got some errors. I tuned some makefiles.

Thanks for pointing this out; but you fix only one board, leaving all the others that have the same problem unfixed. Other parts of your patch were already fixed in the current code.

Please have a look at the posting "[PATCH] SH: fix out of tree building" which I just submitted.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man did not weave the web of life; he  is  merely  a  strand  in  it.
Whatever he does to the web, he does to himself.     - Seattle [1854]