patch-Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Sometimes it is required to build only host U-Boot tools without building
  2. U-Boot itself for either board.
  3. For example:
  4. * In "buildroot" "uboot-tools" could be built for host just to have an ability
  5. to create uImage.
  6. * Linux distributions ship "mkimage" utility as a separate substance.
  7. This patch allows building host U-Boot tools separately from U-Boot itself and
  8. what is more important user only needs to have host compiler (gcc).
  9. To build host tools just execute:
  10. =====
  11. make tools HOST_TOOLS_ONLY=yes
  12. =====
  13. Without this patch to generate tools user needs:
  14. 1. Configure any existing board with "make XXX_config"
  15. 2. Execute tools building but still cross-compiler will be invoked and if
  16. there's no proper cross-compiler in PATH compilation will fail.
  17. Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
  18. Cc: Masahiro Yamada <yamada.m at jp.panasonic.com>
  19. Cc: Tom Rini <trini at ti.com>
  20. Cc: Simon Glass <sjg at chromium.org>
  21. --- u-boot-2014.07.orig/Makefile 2014-07-14 19:16:45.000000000 +0200
  22. +++ u-boot-2014.07/Makefile 2014-08-11 10:06:13.315946952 +0200
  23. @@ -483,9 +483,12 @@ ifeq ($(dot-config),1)
  24. # load other configuration
  25. include $(srctree)/config.mk
  26. +# Don't check for config.mk presence if building host tools only
  27. +ifneq ($(HOST_TOOLS_ONLY),yes)
  28. ifeq ($(wildcard include/config.mk),)
  29. $(error "System not configured - see README")
  30. endif
  31. +endif
  32. # If board code explicitly specified LDSCRIPT or CONFIG_SYS_LDSCRIPT, use
  33. # that (or fail if absent). Otherwise, search for a linker script in a
  34. @@ -1055,10 +1058,14 @@ ifeq ($(CONFIG_SYS_GENERIC_BOARD),y)
  35. @/bin/false
  36. endif
  37. endif
  38. +
  39. +# Don't check for ldscript presence if building host tools only
  40. +ifneq ($(HOST_TOOLS_ONLY),yes)
  41. ifeq ($(wildcard $(LDSCRIPT)),)
  42. @echo >&2 " Could not find linker script."
  43. @/bin/false
  44. endif
  45. +endif
  46. archprepare: prepare1 scripts_basic