All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 04/34] board: samsung: refactor host programs
Date: Wed, 11 Dec 2013 20:01:26 +0900	[thread overview]
Message-ID: <1386759716-5322-5-git-send-email-yamada.m@jp.panasonic.com> (raw)
In-Reply-To: <1386759716-5322-1-git-send-email-yamada.m@jp.panasonic.com>

Some Samsung boards have their own tools under board/samsung/<board>/tools/.
This commit refactor more makefiles with "hostprogs-y".

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Note1:
Samsung boards have tools under board/samsung/<board>/tools/
and have tools/mkexynosspl.c too.
It is inconsistent, so we should choose the appropriate
directory in which Samsung-specific tools are stored.

Note2:

I marded TODO item in board/samsung/origen/Makefile.

Samsung engineers, I hope you will fix the root cause of the warning.

 # omit -O2 option to suppress
 #   warning: dereferencing type-punned pointer will break strict-aliasing rules
 #
 # TODO:
 # Fix the root cause in tools/mkorigenspl.c and delete the following work-around
 $(obj)/tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))


 Makefile                                             |  1 +
 board/samsung/origen/Makefile                        | 20 ++++++++++----------
 .../origen/tools/{mkv310_image.c => mkorigenspl.c}   |  0
 board/samsung/smdkv310/Makefile                      | 15 ++++-----------
 .../tools/{mkv310_image.c => mksmdkv310spl.c}        |  0
 spl/Makefile                                         |  4 ++--
 6 files changed, 17 insertions(+), 23 deletions(-)
 rename board/samsung/origen/tools/{mkv310_image.c => mkorigenspl.c} (100%)
 rename board/samsung/smdkv310/tools/{mkv310_image.c => mksmdkv310spl.c} (100%)

diff --git a/Makefile b/Makefile
index 9479788..cedec69 100644
--- a/Makefile
+++ b/Makefile
@@ -781,6 +781,7 @@ clean:
 	       $(obj)tools/proftool
 	@rm -f $(obj)board/cray/L1/{bootscript.c,bootscript.image}	  \
 	       $(obj)board/matrix_vision/*/bootscript.img		  \
+	       $(obj)spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl	  \
 	       $(obj)u-boot.lds						  \
 	       $(obj)arch/blackfin/cpu/init.{lds,elf}
 	@rm -f $(obj)include/bmp_logo.h
diff --git a/board/samsung/origen/Makefile b/board/samsung/origen/Makefile
index e8818bf..31e88f4 100644
--- a/board/samsung/origen/Makefile
+++ b/board/samsung/origen/Makefile
@@ -4,16 +4,16 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y	+= origen.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
+hostprogs-y := tools/mkorigenspl
+always := $(hostprogs-y)
 
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:	tools/mkv310_image.c
-	$(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+# omit -O2 option to suppress
+#   warning: dereferencing type-punned pointer will break strict-aliasing rules
+#
+# TODO:
+# Fix the root cause in tools/mkorigenspl.c and delete the following work-around
+$(obj)tools/mkorigenspl: HOSTCFLAGS:=$(filter-out -O2,$(HOSTCFLAGS))
+else
+obj-y	+= origen.o
 endif
diff --git a/board/samsung/origen/tools/mkv310_image.c b/board/samsung/origen/tools/mkorigenspl.c
similarity index 100%
rename from board/samsung/origen/tools/mkv310_image.c
rename to board/samsung/origen/tools/mkorigenspl.c
diff --git a/board/samsung/smdkv310/Makefile b/board/samsung/smdkv310/Makefile
index dbc621b..9e37b4e 100644
--- a/board/samsung/smdkv310/Makefile
+++ b/board/samsung/smdkv310/Makefile
@@ -4,16 +4,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-ifndef CONFIG_SPL_BUILD
-obj-y	+= smdkv310.o
-endif
-
 ifdef CONFIG_SPL_BUILD
-all: $(OBJTREE)/tools/mk$(BOARD)spl
-endif
-
-# Fix ME after we implement hostprogs-y.
-ifdef CONFIG_SPL_BUILD
-$(OBJTREE)/tools/mk$(BOARD)spl:	tools/mkv310_image.c
-	$(HOSTCC) tools/mkv310_image.c -o $(OBJTREE)/tools/mk$(BOARD)spl
+hostprogs-y := tools/mksmdkv310spl
+always := $(hostprogs-y)
+else
+obj-y	+= smdkv310.o
 endif
diff --git a/board/samsung/smdkv310/tools/mkv310_image.c b/board/samsung/smdkv310/tools/mksmdkv310spl.c
similarity index 100%
rename from board/samsung/smdkv310/tools/mkv310_image.c
rename to board/samsung/smdkv310/tools/mksmdkv310spl.c
diff --git a/spl/Makefile b/spl/Makefile
index b23ade8..a3253ba 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -156,8 +156,8 @@ all:	$(ALL-y)
 
 ifdef CONFIG_SAMSUNG
 $(obj)$(BOARD)-spl.bin: $(obj)u-boot-spl.bin
-	$(if $(wildcard $(OBJTREE)/tools/mk$(BOARD)spl),\
-	$(OBJTREE)/tools/mk$(BOARD)spl,\
+	$(if $(wildcard $(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl),\
+	$(OBJTREE)/spl/board/samsung/$(BOARD)/tools/mk$(BOARD)spl,\
 	$(OBJTREE)/tools/mkexynosspl) $< $@
 endif
 
-- 
1.8.3.2

  parent reply	other threads:[~2013-12-11 11:01 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 11:01 [U-Boot] [PATCH 0/34] Switch over to real Kbuild Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 01/34] .gitignore: ingore files generated by Kbuild Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 02/34] Makefile.host.tmp: add a new script to refactor tools Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 03/34] tools: convert makefiles to kbuild style Masahiro Yamada
2013-12-11 11:01 ` Masahiro Yamada [this message]
2013-12-11 11:01 ` [U-Boot] [PATCH 05/34] examples: Use scripts/Makefile.build Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 06/34] nand-spl: " Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 07/34] Makfile: move suffix rules to Makefile.build Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 08/34] Makefile: move some variable definitions to the top Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 09/34] Makefile: move BFD_ROOT_DIR to tools/gdb/Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 10/34] Kbuild: import Kbuild.include from linux v3.12 tag Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 11/34] Kbuild: Use Kbuild.include Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 12/34] Makefile: move more flags to the top Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 13/34] Makefile: refactor include path settings Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 14/34] Makefile: move more stuff to top Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 15/34] Makefile: move some flags to spl/Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 16/34] Makefile: move some flags to examples makefiles Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 17/34] Kbuild: change out-of-tree building Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 18/34] Kbuild: add dummy obj-y to create built-in.o Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 19/34] Makefile: rename scripts/Makefile.build to scripts/Makefile.build.tmp Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 20/34] Kbuild: import more build scripts from Linux v3.12 tag Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 21/34] Kbuild: use Linux Kernel build scripts Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 22/34] Kbuild: delete temporary " Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 23/34] Kbuild: move some lines to more suitable place Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 24/34] Kbuild: convert some make rules to Kbuild style Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 25/34] Kbuild: move include directives of board configuration files Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 26/34] Kbuild: generate {spl, tpl}-autoconf.mk only when it is necessary Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 27/34] Makefile: remove a cleaning target "tidy" Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 28/34] Kbuild: change the top Makefile to more Kbuild-ish structure Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 29/34] examples: move api/ and standalone/ to examples/Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 30/34] Kbuild: refactor Makefile and spl/Makefile more Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 31/34] Makefile: Do not pass MTD_VERSION from the top Makefile Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 32/34] Makefile: refactor tools-all targets Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 33/34] Kbuild: use scripts/Makefile.clean Masahiro Yamada
2013-12-11 11:01 ` [U-Boot] [PATCH 34/34] Kbuild: support simultaneous board configuration and "make all" Masahiro Yamada
2013-12-11 19:21 ` [U-Boot] [PATCH 0/34] Switch over to real Kbuild Simon Glass
2013-12-12  2:53   ` Masahiro Yamada
2013-12-12 23:39     ` Simon Glass
2013-12-13 22:35       ` Simon Glass
2013-12-16  9:42         ` Masahiro Yamada
2013-12-18 16:21           ` Simon Glass
2013-12-16 11:01         ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1386759716-5322-5-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.