common-usage.txt 2.9 KB

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