[U-Boot] [PATCH] kbuild/makefile: allow building host tools separately

Masahiro Yamada yamada.m at jp.panasonic.com
Fri Mar 28 07:36:34 CET 2014


Hi Alexey,


> Sometimes it is required to build only host U-Boot tools without building
> U-Boot itself for either board.
> 
> For example:
>  * In "buildroot" "uboot-tools" could be built for host just to have an ability
>    to create uImage.
>  * Linux distributions ship "mkimage" utility as a separate substance.
> 
> This patch allows building host U-Boot tools separately from U-Boot itself and
> what is more important user only needs to have host compiler (gcc).
> 
> To build host tools just execute:
> =====
> make tools HOST_TOOLS_ONLY=yes
> =====



This may be the similar discussion to
http://u-boot.10912.n7.nabble.com/U-Boot-could-not-cross-compile-u-boot-tools-td174911.html
Providing a separate make target seems preferable.

Maybe like this?

To build host tools just execute:
=====
make tools-only
=====

And I am not happy about adding ifdef to everywhere.


So, how about a patch like this?




diff --git a/Makefile b/Makefile
index c744718..12e1075 100644
--- a/Makefile
+++ b/Makefile
@@ -409,7 +409,7 @@ timestamp_h := include/generated/timestamp_autogenerated.h
 
 no-dot-config-targets := clean clobber mrproper distclean \
                         help %docs check% coccicheck \
-                        ubootversion backup
+                        ubootversion backup tools-only
 
 config-targets := 0
 mixed-targets  := 0
@@ -1128,6 +1128,9 @@ checkarmreloc: u-boot
 env: scripts_basic
        $(Q)$(MAKE) $(build)=tools/$@
 
+tools-only: scripts_basic
+       $(Q)$(MAKE) $(build)=tools
+
 tools-all: export HOST_TOOLS_ALL=y
 tools-all: env tools ;
 





Best Regards
Masahiro Yamada



More information about the U-Boot mailing list