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

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Mar 31 03:43:37 CEST 2014


Hi Alexey,


> >
> > 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
> 
> It looks not that relevant to me.
> For example even before switching U-Boot to Kbuild it was not possible
> to build host tools simply without patching sources/headers or
> configuring real target. Or I might be missing something here.

Sorry, I should have explained it more exactly.

What I wanted you to refer is Wolfgang's comment in that thread.

This part:
Wolfgang wrote:
> I'm not really hapy with the additional CROSS_BUILD_TOOLS paramert - 
> but this may be a matter of taste, so the following is just a thought 
> and a question: 
> 
> Would it make more sense to provide a sparate make target instead? 
> 
> Say, something like this: 
> 
>         Build tools for host 
>                 make  CROSS_COMPILE=<your_gcc_prefix tools 
>         Build tools for target 
>                 make  CROSS_COMPILE=<your_gcc_prefix cross_tools 
>         
> ? 

And then we chose a new make target "cross_tools"
rather than a new option "CROSS_BUILD_TOOLS=1".


That is similar to what is happening here.

I wanted to show retionale why a make target "tools-only" is better
than "HOST_TOOLS_ONLY=yes".



> 
> Doesn't work for me:
> ========
> $ make tools-only
>   HOSTCC  scripts/basic/fixdep
>   HOSTCC  tools/aisimage.o
>   HOSTCC  tools/crc32.o
>   HOSTCC  tools/default_image.o
>   HOSTCC  tools/dumpimage.o
> In file included from include/version.h:11:0,
>                  from tools/dumpimage.c:11:
> include/timestamp.h:11:47: fatal error:
> generated/timestamp_autogenerated.h: No such file or directory
>  #include "generated/timestamp_autogenerated.h"
>                                                ^
> compilation terminated.
> make[1]: *** [tools/dumpimage.o] Error 1
> make: *** [tools-only] Error 2
> ========



Oops - My bad.
I was disabling timestamp.


Could you fix like this?

tools-only: scripts_basic $(version_h) $(timestamp_h)
	$(Q)$(MAKE) $(build)=tools



It worked for me.

$ make  tools-only
  HOSTCC  scripts/basic/fixdep
  CHK     include/config/uboot.release
  UPD     include/config/uboot.release
  CHK     include/generated/version_autogenerated.h
  UPD     include/generated/version_autogenerated.h
  CHK     include/generated/timestamp_autogenerated.h
  UPD     include/generated/timestamp_autogenerated.h
  HOSTCC  tools/aisimage.o
  HOSTCC  tools/crc32.o
  HOSTCC  tools/default_image.o
  HOSTCC  tools/dumpimage.o
  HOSTCC  tools/fdt.o
  HOSTCC  tools/fdt_ro.o
  HOSTCC  tools/fdt_rw.o
  HOSTCC  tools/fdt_strerror.o
  HOSTCC  tools/fdt_wip.o
  HOSTCC  tools/fit_image.o
  HOSTCC  tools/image-fit.o
  HOSTCC  tools/image-host.o
  HOSTCC  tools/image.o
  HOSTCC  tools/imagetool.o
  HOSTCC  tools/imximage.o
  HOSTCC  tools/kwbimage.o
  HOSTCC  tools/md5.o
  HOSTCC  tools/mkenvimage.o
  HOSTCC  tools/mkimage.o
  HOSTCC  tools/mxsimage.o
  HOSTCC  tools/omapimage.o
  HOSTCC  tools/os_support.o
  HOSTCC  tools/pblimage.o
  HOSTCC  tools/sha1.o
  HOSTCC  tools/ublimage.o
  HOSTLD  tools/mkenvimage
  HOSTLD  tools/dumpimage
  HOSTLD  tools/mkimage
  HOSTCC  tools/proftool


Best Regards
Masahiro Yamada



More information about the U-Boot mailing list