make-tips.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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.
  29. .Cleaning:
  30. Explicit cleaning is required when any of the architecture or toolchain
  31. configuration options are changed.
  32. To delete all build products (including build directories, host, staging
  33. and target trees, the images and the toolchain):
  34. --------------------
  35. $ make clean
  36. --------------------
  37. .Generating the manual:
  38. The present manual sources are located in the 'docs/manual' directory.
  39. To generate the manual:
  40. ---------------------------------
  41. $ make manual-clean
  42. $ make manual
  43. ---------------------------------
  44. The manual outputs will be generated in 'output/docs/manual'.
  45. .Notes
  46. - A few tools are required to build the documentation (see:
  47. xref:requirement-optional[]).
  48. .Resetting Buildroot for a new target:
  49. To delete all build products as well as the configuration:
  50. --------------------
  51. $ make distclean
  52. --------------------
  53. .Notes
  54. If +ccache+ is enabled, running +make clean+ or +distclean+ does
  55. not empty the compiler cache used by Buildroot. To delete it, refer
  56. to xref:ccache[].
  57. .Dumping the internal make variables:
  58. One can dump the variables known to make, along with their values:
  59. ----
  60. $ make -s printvars VARS='VARIABLE1 VARIABLE2'
  61. VARIABLE1=value_of_variable
  62. VARIABLE2=value_of_variable
  63. ----
  64. It is possible to tweak the output using some variables:
  65. - +VARS+ will limit the listing to variables which names match the
  66. specified make-patterns - this must be set else nothing is printed
  67. - +QUOTED_VARS+, if set to +YES+, will single-quote the value
  68. - +RAW_VARS+, if set to +YES+, will print the unexpanded value
  69. For example:
  70. ----
  71. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES
  72. BUSYBOX_DEPENDENCIES=skeleton toolchain
  73. BUSYBOX_FINAL_ALL_DEPENDENCIES=skeleton toolchain
  74. BUSYBOX_FINAL_DEPENDENCIES=skeleton toolchain
  75. BUSYBOX_FINAL_PATCH_DEPENDENCIES=
  76. BUSYBOX_RDEPENDENCIES=ncurses util-linux
  77. ----
  78. ----
  79. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES QUOTED_VARS=YES
  80. BUSYBOX_DEPENDENCIES='skeleton toolchain'
  81. BUSYBOX_FINAL_ALL_DEPENDENCIES='skeleton toolchain'
  82. BUSYBOX_FINAL_DEPENDENCIES='skeleton toolchain'
  83. BUSYBOX_FINAL_PATCH_DEPENDENCIES=''
  84. BUSYBOX_RDEPENDENCIES='ncurses util-linux'
  85. ----
  86. ----
  87. $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES RAW_VARS=YES
  88. BUSYBOX_DEPENDENCIES=skeleton toolchain
  89. BUSYBOX_FINAL_ALL_DEPENDENCIES=$(sort $(BUSYBOX_FINAL_DEPENDENCIES) $(BUSYBOX_FINAL_PATCH_DEPENDENCIES))
  90. BUSYBOX_FINAL_DEPENDENCIES=$(sort $(BUSYBOX_DEPENDENCIES))
  91. BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
  92. BUSYBOX_RDEPENDENCIES=ncurses util-linux
  93. ----
  94. The output of quoted variables can be reused in shell scripts, for example:
  95. ----
  96. $ eval $(make -s printvars VARS=BUSYBOX_DEPENDENCIES QUOTED_VARS=YES)
  97. $ echo $BUSYBOX_DEPENDENCIES
  98. skeleton toolchain
  99. ----