Skip to contentSkip to conversation

[U-Boot] [PATCH 0/2]

PATCH New Masahiro Yamada 3 participants 7 messages Mar 3, 2014 – Mar 4, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

cover [U-Boot] [PATCH 0/2]

Kbuild: fix tools build

Masahiro Yamada (2):
kbuild: fix "tools-all" target
kbuild: add "cross_tools" target to build tools for the target

 Makefile       |  5 ++++-
 tools/Makefile | 12 ++++++++++++
 2 files changed, 16 insertions(+), 1 deletion(-)
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/2 kbuild: fix "tools-all" target

The top Makefile must export HOST_TOOLS_ALL to use it in tools/Makefile.

---

 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index e49a240..3647804 100644
@@ -1142,7 +1142,7 @@ checkarmreloc: u-boot
 env: scripts_basic
 	$(Q)$(MAKE) $(build)=tools/$@
 
-tools-all: HOST_TOOLS_ALL=y
+tools-all: export HOST_TOOLS_ALL=y
 tools-all: env tools ;
 
 .PHONY : CHANGELOG
Signature · 1 line
1.8.3.2
#2 lore raw

PATCH 1/2 kbuild: fix "tools-all" target

Hello Masahiro,

Am 03.03.2014 03:06, schrieb Masahiro Yamada:

Quoted 8 lines

The top Makefile must export HOST_TOOLS_ALL to use it in tools/Makefile.

---

  Makefile | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

(on the IDS8247 and upcoming ids8313 board)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH 1/2 kbuild: fix "tools-all" target

In reply to Masahiro Yamada
Quoted 6 lines · Masahiro Yamada

The top Makefile must export HOST_TOOLS_ALL to use it in tools/Makefile.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140304/f3baa045/attachment.pgp>
#4 lore raw

PATCH 2/2 kbuild: add "cross_tools" target to build tools for the target

In reply to Masahiro Yamada

Programs in tools/ directory are usually built for the host. But some of them (mkimage, dumpimge, gen_eth_addr, etc.) are useful on the target OS too.

Actually, prior to Kbuild, U-Boot could build tools for the target like follows:

  $ make <target_board>_config
  $ export CROSS_COMPILE=<cross_gcc_prefix>
  $ make HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip tools

In Kbuild, we can no longer replace HOSTCC at the command line.

In order to get back that feature, this commit adds "cross-tools" target.

Usage:

Build tools for the host

  $ make CROSS_COMPILE=<cross_gcc_prefix> tools

Build tools for the target

  $ make CROSS_COMPILE=<cross_gcc_prefix> cross_tools

Besides, "make cross_tools" strip tools programs because we generally expect smaller storages on embedded systems.

---

 Makefile       |  3 +++
 tools/Makefile | 12 ++++++++++++
 2 files changed, 15 insertions(+)
Makefile +3 -0
index 3647804..ea4a362 100644
@@ -1145,6 +1145,9 @@ env: scripts_basic
 tools-all: export HOST_TOOLS_ALL=y
 tools-all: env tools ;
 
+cross_tools: export CROSS_BUILD_TOOLS=y
+cross_tools: tools ;
+
 .PHONY : CHANGELOG
 CHANGELOG:
 	git log --no-merges U-Boot-1_1_5.. | \
tools/Makefile +12 -0
index dcd49f8..8fccc65 100644
@@ -191,3 +191,15 @@ $(LOGO_DATA_H):	$(obj)/bmp_logo $(LOGO_BMP)
 
 # Let clean descend into subdirs
 subdir- += env
+
+ifneq ($(CROSS_BUILD_TOOLS),)
+HOSTCC = $(CC)
+
+quiet_cmd_crosstools_strip = STRIP   $^
+      cmd_crosstools_strip = $(STRIP) $^; touch $@
+$(obj)/.strip: $(call objectify,$(filter $(always),$(hostprogs-y)))
+	$(call cmd,crosstools_strip)
+
+always += .strip
+endif
+clean-files += .strip
Signature · 1 line
1.8.3.2
#5 lore raw

PATCH 2/2 kbuild: add "cross_tools" target to build tools for the target

Hello Masahiro,

Am 03.03.2014 03:06, schrieb Masahiro Yamada:

Quoted 30 lines

Programs in tools/ directory are usually built for the host. But some of them (mkimage, dumpimge, gen_eth_addr, etc.) are useful on the target OS too.

Actually, prior to Kbuild, U-Boot could build tools for the target like follows:

   $ make<target_board>_config
   $ export CROSS_COMPILE=<cross_gcc_prefix>
   $ make HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip tools

In Kbuild, we can no longer replace HOSTCC at the command line.

In order to get back that feature, this commit adds "cross-tools" target.

Usage:

Build tools for the host

   $ make CROSS_COMPILE=<cross_gcc_prefix>  tools

Build tools for the target

   $ make CROSS_COMPILE=<cross_gcc_prefix>  cross_tools

Besides, "make cross_tools" strip tools programs because we generally expect smaller storages on embedded systems.

Quoted 5 lines

---

  Makefile       |  3 +++
  tools/Makefile | 12 ++++++++++++
  2 files changed, 15 insertions(+)

(on the IDS8247 and upcoming ids8313 board)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw

PATCH 2/2 kbuild: add "cross_tools" target to build tools for the target

In reply to Masahiro Yamada
Quoted 26 lines · Masahiro Yamada

Programs in tools/ directory are usually built for the host. But some of them (mkimage, dumpimge, gen_eth_addr, etc.) are useful on the target OS too.

Actually, prior to Kbuild, U-Boot could build tools for the target like follows:

  $ make <target_board>_config
  $ export CROSS_COMPILE=<cross_gcc_prefix>
  $ make HOSTCC=${CROSS_COMPILE}gcc HOSTSTRIP=${CROSS_COMPILE}strip tools

In Kbuild, we can no longer replace HOSTCC at the command line.

In order to get back that feature, this commit adds "cross-tools" target.

Usage:

Build tools for the host

  $ make CROSS_COMPILE=<cross_gcc_prefix> tools

Build tools for the target

  $ make CROSS_COMPILE=<cross_gcc_prefix> cross_tools

Besides, "make cross_tools" strip tools programs because we generally expect smaller storages on embedded systems.

Quoted 6 lines

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140304/81b9dbb5/attachment.pgp>