summaryrefslogtreecommitdiffstats
path: root/docs/manual/make-tips.txt
blob: ea1d825bef59b71b03fcff8181f1583294621b36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// -*- mode:doc; -*-
// vim: set syntax=asciidoc:

[[make-tips]]
=== 'make' tips

This is a collection of tips that help you make the most of Buildroot.

.Display all commands executed by make:

--------------------
 $ make V=1 <target>
--------------------

.Display the list of boards with a defconfig:

--------------------
 $ make list-defconfigs
--------------------

.Display all available targets:

--------------------
 $ make help
--------------------

Not all targets are always available,
some settings in the +.config+ file may hide some targets:

* +busybox-menuconfig+ only works when +busybox+ is enabled;
* +linux-menuconfig+ and +linux-savedefconfig+ only work when
  +linux+ is enabled;
* +uclibc-menuconfig+ is only available when the uClibc C library is
  selected in the internal toolchain backend;
* +barebox-menuconfig+ and +barebox-savedefconfig+ only work when the
  +barebox+ bootloader is enabled.
* +uboot-menuconfig+ and +uboot-savedefconfig+ only work when the
  +U-Boot+ bootloader is enabled.

.Cleaning:

Explicit cleaning is required when any of the architecture or toolchain
configuration options are changed.

To delete all build products (including build directories, host, staging
and target trees, the images and the toolchain):

--------------------
 $ make clean
--------------------

.Generating the manual:

The present manual sources are located in the 'docs/manual' directory.
To generate the manual:

---------------------------------
 $ make manual-clean
 $ make manual
---------------------------------

The manual outputs will be generated in 'output/docs/manual'.

.Notes
- A few tools are required to build the documentation (see:
  xref:requirement-optional[]).

.Resetting Buildroot for a new target:

To delete all build products as well as the configuration:

--------------------
 $ make distclean
--------------------

.Notes
If +ccache+ is enabled, running +make clean+ or +distclean+ does
not empty the compiler cache used by Buildroot. To delete it, refer
to xref:ccache[].

.Dumping the internal make variables:

One can dump all the variables known to make, along with their values:

----
 $ make -s printvars
 VARIABLE=value_of_variable
 ...
----

It is possible to tweak the output using some variables:

- +VARS+ will limit the listing to variables which names match the
  specified make-pattern
- +QUOTED_VARS+, if set to +YES+, will single-quote the value
- +RAW_VARS+, if set to +YES+, will print the unexpanded value

For example:

----
 $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES
 BUSYBOX_DEPENDENCIES=skeleton toolchain
 BUSYBOX_FINAL_ALL_DEPENDENCIES=skeleton toolchain
 BUSYBOX_FINAL_DEPENDENCIES=skeleton toolchain
 BUSYBOX_FINAL_PATCH_DEPENDENCIES=
 BUSYBOX_RDEPENDENCIES=ncurses util-linux
----

----
 $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES QUOTED_VARS=YES
 BUSYBOX_DEPENDENCIES='skeleton toolchain'
 BUSYBOX_FINAL_ALL_DEPENDENCIES='skeleton toolchain'
 BUSYBOX_FINAL_DEPENDENCIES='skeleton toolchain'
 BUSYBOX_FINAL_PATCH_DEPENDENCIES=''
 BUSYBOX_RDEPENDENCIES='ncurses util-linux'
----

----
 $ make -s printvars VARS=BUSYBOX_%DEPENDENCIES RAW_VARS=YES
 BUSYBOX_DEPENDENCIES=skeleton toolchain
 BUSYBOX_FINAL_ALL_DEPENDENCIES=$(sort $(BUSYBOX_FINAL_DEPENDENCIES) $(BUSYBOX_FINAL_PATCH_DEPENDENCIES))
 BUSYBOX_FINAL_DEPENDENCIES=$(sort $(BUSYBOX_DEPENDENCIES))
 BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
 BUSYBOX_RDEPENDENCIES=ncurses util-linux
----

The output of quoted variables can be reused in shell scripts, for example:

----
 $ eval $(make -s printvars VARS=BUSYBOX_DEPENDENCIES QUOTED_VARS=YES)
 $ echo $BUSYBOX_DEPENDENCIES
 skeleton toolchain
----
OpenPOWER on IntegriCloud