common-usage.txt 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. Daily use
  4. ---------
  5. include::rebuilding-packages.txt[]
  6. Offline builds
  7. ~~~~~~~~~~~~~~
  8. If you intend to do an offline build and just want to download
  9. all sources that you previously selected in the configurator
  10. ('menuconfig', 'xconfig' or 'gconfig'), then issue:
  11. --------------------
  12. $ make source
  13. --------------------
  14. You can now disconnect or copy the content of your +dl+
  15. directory to the build-host.
  16. Building out-of-tree
  17. ~~~~~~~~~~~~~~~~~~~~
  18. As default, everything built by Buildroot is stored in the directory
  19. +output+ in the Buildroot tree.
  20. Buildroot also supports building out of tree with a syntax similar to
  21. the Linux kernel. To use it, add +O=<directory>+ to the make command
  22. line:
  23. --------------------
  24. $ make O=/tmp/build
  25. --------------------
  26. Or:
  27. --------------------
  28. $ cd /tmp/build; make O=$PWD -C path/to/buildroot
  29. --------------------
  30. All the output files will be located under +/tmp/build+.
  31. When using out-of-tree builds, the Buildroot +.config+ and temporary
  32. files are also stored in the output directory. This means that you can
  33. safely run multiple builds in parallel using the same source tree as
  34. long as they use unique output directories.
  35. For ease of use, Buildroot generates a Makefile wrapper in the output
  36. directory - so after the first run, you no longer need to pass +O=..+
  37. and +-C ..+, simply run (in the output directory):
  38. --------------------
  39. $ make <target>
  40. --------------------
  41. [[env-vars]]
  42. Environment variables
  43. ~~~~~~~~~~~~~~~~~~~~~
  44. Buildroot also honors some environment variables, when they are passed
  45. to +make+ or set in the environment:
  46. * +HOSTCXX+, the host C++ compiler to use
  47. * +HOSTCC+, the host C compiler to use
  48. * +UCLIBC_CONFIG_FILE=<path/to/.config>+, path to
  49. the uClibc configuration file, used to compile uClibc, if an
  50. internal toolchain is being built.
  51. +
  52. Note that the uClibc configuration file can also be set from the
  53. configuration interface, so through the Buildroot +.config+ file; this
  54. is the recommended way of setting it.
  55. +
  56. * +BUSYBOX_CONFIG_FILE=<path/to/.config>+, path to
  57. the Busybox configuration file.
  58. +
  59. Note that the Busybox configuration file can also be set from the
  60. configuration interface, so through the Buildroot +.config+ file; this
  61. is the recommended way of setting it.
  62. +
  63. * +BUILDROOT_DL_DIR+ to override the directory in which
  64. Buildroot stores/retrieves downloaded files
  65. +
  66. Note that the Buildroot download directory can also be set from the
  67. configuration interface, so through the Buildroot +.config+ file; this
  68. is the recommended way of setting it.
  69. An example that uses config files located in the toplevel directory and
  70. in your $HOME:
  71. --------------------
  72. $ make UCLIBC_CONFIG_FILE=uClibc.config BUSYBOX_CONFIG_FILE=$HOME/bb.config
  73. --------------------
  74. If you want to use a compiler other than the default +gcc+
  75. or +g+++ for building helper-binaries on your host, then do
  76. --------------------
  77. $ make HOSTCXX=g++-4.3-HEAD HOSTCC=gcc-4.3-HEAD
  78. --------------------