summaryrefslogtreecommitdiffstats
path: root/tools/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-03-03 11:06:19 +0900
committerTom Rini <trini@ti.com>2014-03-04 12:15:31 -0500
commitdb5b339cca2f7b7824372f02932c3d7c24a34ed3 (patch)
tree379ea078c1df300b6710fbf82f29afe53c9c9ed0 /tools/Makefile
parent1ec8b4efce83e7739720afbbf6a19937704eb8d5 (diff)
downloadblackbird-obmc-uboot-db5b339cca2f7b7824372f02932c3d7c24a34ed3.tar.gz
blackbird-obmc-uboot-db5b339cca2f7b7824372f02932c3d7c24a34ed3.zip
kbuild: add "cross_tools" target to build tools for the target
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. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Reported-by: Heiko Schocher <hs@denx.de> Cc: Wolfgang Denk <wd@denx.de> Cc: Tom Rini <trini@ti.com> Tested-by: Heiko Schocher <hs@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
Diffstat (limited to 'tools/Makefile')
-rw-r--r--tools/Makefile12
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/Makefile b/tools/Makefile
index dcd49f8291..8fccc650cc 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -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
OpenPOWER on IntegriCloud