make-tips.adoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. [[make-tips]]
  4. === 'make' tips
  5. This is a collection of tips that help you make the most of Buildroot.
  6. .Display all commands executed by make:
  7. ----
  8. $ make V=1 <target>
  9. ----
  10. .Display the list of boards with a defconfig:
  11. ----
  12. $ make list-defconfigs
  13. ----
  14. .Display all available targets:
  15. ----
  16. $ make help
  17. ----
  18. Not all targets are always available,
  19. some settings in the +.config+ file may hide some targets:
  20. * +busybox-menuconfig+ only works when +busybox+ is enabled;
  21. * +linux-menuconfig+ and +linux-savedefconfig+ only work when
  22. +linux+ is enabled;
  23. * +uclibc-menuconfig+ is only available when the uClibc C library is
  24. selected in the internal toolchain backend;
  25. * +barebox-menuconfig+ and +barebox-savedefconfig+ only work when the
  26. +barebox+ bootloader is enabled.
  27. * +uboot-menuconfig+ and +uboot-savedefconfig+ only work when the
  28. +U-Boot+ bootloader is enabled and the +uboot+ build system is set
  29. to +Kconfig+.
  30. .Cleaning:
  31. Explicit cleaning is required when any of the architecture or toolchain
  32. configuration options are changed.
  33. To delete all build products (including build directories, host, staging
  34. and target trees, the images and the toolchain):
  35. ----
  36. $ make clean
  37. ----
  38. .Generating the manual:
  39. The present manual sources are located in the 'docs/manual' directory.
  40. To generate the manual:
  41. ----
  42. $ make manual-clean
  43. $ make manual
  44. ----
  45. The manual outputs will be generated in 'output/docs/manual'.
  46. .Notes
  47. - A few tools are required to build the documentation (see:
  48. xref:requirement-optional[]).
  49. .Resetting Buildroot for a new target:
  50. To delete all build products as well as the configuration:
  51. ----
  52. $ make distclean
  53. ----
  54. .Notes
  55. If +ccache+ is enabled, running +make clean+ or +distclean+ does
  56. not empty the compiler cache used by Buildroot. To delete it, refer
  57. to xref:ccache[].
  58. .Dumping the internal make variables:
  59. One can dump the variables known to make, along with their values:
  60. ----
  61. $ make -s printvars VARS='VARIABLE1 VARIABLE2'
  62. VARIABLE1=value_of_variable
  63. VARIABLE2=value_of_variable
  64. ----
  65. It is possible to tweak the output using some variables:
  66. - +VARS+ will limit the listing to variables which names match the
  67. specified make-patterns - this must be set else nothing is printed
  68. - +QUOTED_VARS+, if set to +YES+, will single-quote the value
  69. - +RAW_VARS+, if set to +YES+, will print the unexpanded value
  70. For example:
  71. ----
  72. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES
  73. BUSYBOX_DEPENDENCIES=skeleton toolchain
  74. BUSYBOX_FINAL_ALL_DEPENDENCIES=skeleton toolchain
  75. BUSYBOX_FINAL_DEPENDENCIES=skeleton toolchain
  76. BUSYBOX_FINAL_PATCH_DEPENDENCIES=
  77. BUSYBOX_RDEPENDENCIES=ncurses util-linux
  78. ----
  79. ----
  80. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES QUOTED_VARS=YES
  81. BUSYBOX_DEPENDENCIES='skeleton toolchain'
  82. BUSYBOX_FINAL_ALL_DEPENDENCIES='skeleton toolchain'
  83. BUSYBOX_FINAL_DEPENDENCIES='skeleton toolchain'
  84. BUSYBOX_FINAL_PATCH_DEPENDENCIES=''
  85. BUSYBOX_RDEPENDENCIES='ncurses util-linux'
  86. ----
  87. ----
  88. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES RAW_VARS=YES
  89. BUSYBOX_DEPENDENCIES=skeleton toolchain
  90. BUSYBOX_FINAL_ALL_DEPENDENCIES=$(sort $(BUSYBOX_FINAL_DEPENDENCIES) $(BUSYBOX_FINAL_PATCH_DEPENDENCIES))
  91. BUSYBOX_FINAL_DEPENDENCIES=$(sort $(BUSYBOX_DEPENDENCIES))
  92. BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
  93. BUSYBOX_RDEPENDENCIES=ncurses util-linux
  94. ----
  95. The output of quoted variables can be reused in shell scripts, for example:
  96. ----
  97. $ eval $(make -s printvars VARS=BUSYBOX_DEPENDENCIES QUOTED_VARS=YES)
  98. $ echo $BUSYBOX_DEPENDENCIES
  99. skeleton toolchain
  100. ----