]>
Commit | Line | Data |
---|---|---|
5e84b8b7 | 1 | // -*- mode:doc; -*- |
3edb0271 | 2 | // vim: set syntax=asciidoc: |
5e84b8b7 | 3 | |
77007ad9 | 4 | == How Buildroot works |
41c1cb44 TP |
5 | |
6 | As mentioned above, Buildroot is basically a set of Makefiles that | |
7 | download, configure, and compile software with the correct options. It | |
8 | also includes patches for various software packages - mainly the ones | |
1d989faf | 9 | involved in the cross-compilation toolchain (+gcc+, +binutils+ and |
41c1cb44 TP |
10 | +uClibc+). |
11 | ||
12 | There is basically one Makefile per software package, and they are | |
65f66c17 AVEM |
13 | named with the +.mk+ extension. Makefiles are split into many different |
14 | parts. | |
41c1cb44 | 15 | |
65f66c17 | 16 | * The +toolchain/+ directory contains the Makefiles |
41c1cb44 TP |
17 | and associated files for all software related to the |
18 | cross-compilation toolchain: +binutils+, +gcc+, +gdb+, | |
19 | +kernel-headers+ and +uClibc+. | |
20 | ||
65f66c17 AVEM |
21 | * The +arch/+ directory contains the definitions for all the processor |
22 | architectures that are supported by Buildroot. | |
41c1cb44 | 23 | |
65f66c17 AVEM |
24 | * The +package/+ directory contains the Makefiles and |
25 | associated files for all user-space tools and libraries that Buildroot | |
26 | can compile and add to the target root filesystem. There is one | |
27 | sub-directory per package. | |
28 | ||
29 | * The +linux/+ directory contains the Makefiles and associated files for | |
30 | the Linux kernel. | |
31 | ||
32 | * The +boot/+ directory contains the Makefiles and associated files for | |
33 | the bootloaders supported by Buildroot. | |
34 | ||
35 | * The +system/+ directory contains support for system integration, e.g. | |
36 | the target filesystem skeleton and the selection of an init system. | |
37 | ||
38 | * The +fs/+ directory contains the Makefiles and | |
41c1cb44 | 39 | associated files for software related to the generation of the |
65f66c17 | 40 | target root filesystem image. |
41c1cb44 TP |
41 | |
42 | Each directory contains at least 2 files: | |
43 | ||
44 | * +something.mk+ is the Makefile that downloads, configures, | |
45 | compiles and installs the package +something+. | |
46 | ||
47 | * +Config.in+ is a part of the configuration tool | |
48 | description file. It describes the options related to the | |
49 | package. | |
50 | ||
51 | The main Makefile performs the following steps (once the | |
52 | configuration is done): | |
53 | ||
54 | * Create all the output directories: +staging+, +target+, +build+, | |
e0c60677 | 55 | etc. in the output directory (+output/+ by default, |
41c1cb44 TP |
56 | another value can be specified using +O=+) |
57 | ||
cf53e15d FP |
58 | * Generate the toolchain target. When an internal toolchain is used, this |
59 | means generating the cross-compilation toolchain. When an external | |
60 | toolchain is used, this means checking the features of the external | |
61 | toolchain and importing it into the Buildroot environment. | |
41c1cb44 TP |
62 | |
63 | * Generate all the targets listed in the +TARGETS+ variable. This | |
64 | variable is filled by all the individual components' | |
65 | Makefiles. Generating these targets will trigger the compilation of | |
66 | the userspace packages (libraries, programs), the kernel, the | |
67 | bootloader and the generation of the root filesystem images, | |
68 | depending on the configuration. | |
69 |