2013-02-13 13:59:02 +01:00
|
|
|
// -*- mode:doc; -*-
|
|
|
|
// vim: set syntax=asciidoc:
|
2012-11-11 04:14:49 +01:00
|
|
|
|
|
|
|
[[make-tips]]
|
2014-08-19 21:41:47 +02:00
|
|
|
=== 'make' tips
|
2012-11-11 04:14:49 +01:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
This is a collection of tips that help you make the most of Buildroot.
|
2012-11-11 04:14:49 +01:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
.Display all commands executed by make:
|
2012-11-11 04:14:49 +01:00
|
|
|
|
|
|
|
--------------------
|
2012-11-27 12:59:16 +01:00
|
|
|
$ make V=1 <target>
|
2012-11-11 04:14:49 +01:00
|
|
|
--------------------
|
|
|
|
|
2015-03-21 20:49:46 +01:00
|
|
|
.Display the list of boards with a defconfig:
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make list-defconfigs
|
|
|
|
--------------------
|
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
.Display all available targets:
|
2012-11-11 04:14:49 +01:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make help
|
|
|
|
--------------------
|
|
|
|
|
2013-08-09 12:16:48 +02:00
|
|
|
Not all targets are always available,
|
2012-11-27 12:59:16 +01:00
|
|
|
some settings in the +.config+ file may hide some targets:
|
|
|
|
|
2014-05-31 09:33:10 +02:00
|
|
|
* +busybox-menuconfig+ only works when +busybox+ is enabled;
|
2012-11-27 12:59:16 +01:00
|
|
|
* +linux-menuconfig+ and +linux-savedefconfig+ only work when
|
|
|
|
+linux+ is enabled;
|
2014-02-23 16:04:37 +01:00
|
|
|
* +uclibc-menuconfig+ is only available when the uClibc C library is
|
|
|
|
selected in the internal toolchain backend;
|
2012-11-27 12:59:16 +01:00
|
|
|
* +barebox-menuconfig+ and +barebox-savedefconfig+ only work when the
|
|
|
|
+barebox+ bootloader is enabled.
|
2015-07-16 21:19:05 +02:00
|
|
|
* +uboot-menuconfig+ and +uboot-savedefconfig+ only work when the
|
|
|
|
+U-Boot+ bootloader is enabled.
|
2012-11-27 12:59:16 +01:00
|
|
|
|
|
|
|
.Cleaning:
|
2012-11-11 04:14:49 +01:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
Explicit cleaning is required when any of the architecture or toolchain
|
|
|
|
configuration options are changed.
|
2012-11-11 04:14:49 +01:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
To delete all build products (including build directories, host, staging
|
2012-11-11 04:14:49 +01:00
|
|
|
and target trees, the images and the toolchain):
|
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make clean
|
|
|
|
--------------------
|
|
|
|
|
2013-08-09 12:16:47 +02:00
|
|
|
.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
|
2013-10-18 22:31:25 +02:00
|
|
|
- A few tools are required to build the documentation (see:
|
2013-08-09 12:16:47 +02:00
|
|
|
xref:requirement-optional[]).
|
|
|
|
|
2014-05-31 10:26:20 +02:00
|
|
|
.Resetting Buildroot for a new target:
|
2013-08-09 12:16:48 +02:00
|
|
|
|
2012-11-27 12:59:16 +01:00
|
|
|
To delete all build products as well as the configuration:
|
2012-11-11 04:14:49 +01:00
|
|
|
|
|
|
|
--------------------
|
|
|
|
$ make distclean
|
|
|
|
--------------------
|
|
|
|
|
2013-08-09 12:16:48 +02:00
|
|
|
.Notes
|
|
|
|
If +ccache+ is enabled, running +make clean+ or +distclean+ does
|
2012-11-16 05:54:19 +01:00
|
|
|
not empty the compiler cache used by Buildroot. To delete it, refer
|
2012-11-11 04:14:49 +01:00
|
|
|
to xref:ccache[].
|
core: enhance printvars
Currently, the output of printvars copntains the name of the variable,
its expanded value and its un-expanded value.
However, most of the time, we need the actual, expanded value, so it can
be re-used from a (non-Buildroot) infrastructure script, like a
post-build script, or a build-farm driver (e.g. a Jenkins job...)
Add two options that a user may set to change the output of printvars:
- QUOTED_VARS, if set, will quote the value
- RAW_VARS, if set, will print the unexpanded value
The new output by default only prints the expanded value now.
So that it can be used as such:
$ make -s printvars VARS=BUSYBOX_VERSION
BUSYBOX_VERSION=1.26.2
$ make -s printvars VARS=BUSYBOX_RDEPENDENCIES QUOTED_VARS=YES
BUSYBOX_RDEPENDENCIES='ncurses util-linux'
$ make -s printvars VARS=BUSYBOX_FINAL_PATCH_DEPENDENCIES RAW_VARS=YES
BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
And it is even possible to directly evaluate it in a shell script:
eval $(make -s printvars VARS=BUSYBOX_VERSION QUOTED_VARS=YES)
Backward compatibility of the output is not maintained. It is believed
that scripts that depended on the previous output were very fragile to
begin with, because they had to filter the non-formatted output
(splitting on spaces or braces was not really possible, because values
could contain either).
Document printvars and its options in the manual; list it in the output
of 'make help'.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-29 11:43:05 +02:00
|
|
|
|
|
|
|
.Dumping the internal make variables:
|
|
|
|
|
2019-03-12 18:55:35 +01:00
|
|
|
One can dump the variables known to make, along with their values:
|
core: enhance printvars
Currently, the output of printvars copntains the name of the variable,
its expanded value and its un-expanded value.
However, most of the time, we need the actual, expanded value, so it can
be re-used from a (non-Buildroot) infrastructure script, like a
post-build script, or a build-farm driver (e.g. a Jenkins job...)
Add two options that a user may set to change the output of printvars:
- QUOTED_VARS, if set, will quote the value
- RAW_VARS, if set, will print the unexpanded value
The new output by default only prints the expanded value now.
So that it can be used as such:
$ make -s printvars VARS=BUSYBOX_VERSION
BUSYBOX_VERSION=1.26.2
$ make -s printvars VARS=BUSYBOX_RDEPENDENCIES QUOTED_VARS=YES
BUSYBOX_RDEPENDENCIES='ncurses util-linux'
$ make -s printvars VARS=BUSYBOX_FINAL_PATCH_DEPENDENCIES RAW_VARS=YES
BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
And it is even possible to directly evaluate it in a shell script:
eval $(make -s printvars VARS=BUSYBOX_VERSION QUOTED_VARS=YES)
Backward compatibility of the output is not maintained. It is believed
that scripts that depended on the previous output were very fragile to
begin with, because they had to filter the non-formatted output
(splitting on spaces or braces was not really possible, because values
could contain either).
Document printvars and its options in the manual; list it in the output
of 'make help'.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-29 11:43:05 +02:00
|
|
|
|
|
|
|
----
|
2019-03-12 18:55:35 +01:00
|
|
|
$ make -s printvars VARS='VARIABLE1 VARIABLE2'
|
|
|
|
VARIABLE1=value_of_variable
|
|
|
|
VARIABLE2=value_of_variable
|
core: enhance printvars
Currently, the output of printvars copntains the name of the variable,
its expanded value and its un-expanded value.
However, most of the time, we need the actual, expanded value, so it can
be re-used from a (non-Buildroot) infrastructure script, like a
post-build script, or a build-farm driver (e.g. a Jenkins job...)
Add two options that a user may set to change the output of printvars:
- QUOTED_VARS, if set, will quote the value
- RAW_VARS, if set, will print the unexpanded value
The new output by default only prints the expanded value now.
So that it can be used as such:
$ make -s printvars VARS=BUSYBOX_VERSION
BUSYBOX_VERSION=1.26.2
$ make -s printvars VARS=BUSYBOX_RDEPENDENCIES QUOTED_VARS=YES
BUSYBOX_RDEPENDENCIES='ncurses util-linux'
$ make -s printvars VARS=BUSYBOX_FINAL_PATCH_DEPENDENCIES RAW_VARS=YES
BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
And it is even possible to directly evaluate it in a shell script:
eval $(make -s printvars VARS=BUSYBOX_VERSION QUOTED_VARS=YES)
Backward compatibility of the output is not maintained. It is believed
that scripts that depended on the previous output were very fragile to
begin with, because they had to filter the non-formatted output
(splitting on spaces or braces was not really possible, because values
could contain either).
Document printvars and its options in the manual; list it in the output
of 'make help'.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-29 11:43:05 +02:00
|
|
|
----
|
|
|
|
|
|
|
|
It is possible to tweak the output using some variables:
|
|
|
|
|
|
|
|
- +VARS+ will limit the listing to variables which names match the
|
2019-03-12 18:55:35 +01:00
|
|
|
specified make-patterns - this must be set else nothing is printed
|
core: enhance printvars
Currently, the output of printvars copntains the name of the variable,
its expanded value and its un-expanded value.
However, most of the time, we need the actual, expanded value, so it can
be re-used from a (non-Buildroot) infrastructure script, like a
post-build script, or a build-farm driver (e.g. a Jenkins job...)
Add two options that a user may set to change the output of printvars:
- QUOTED_VARS, if set, will quote the value
- RAW_VARS, if set, will print the unexpanded value
The new output by default only prints the expanded value now.
So that it can be used as such:
$ make -s printvars VARS=BUSYBOX_VERSION
BUSYBOX_VERSION=1.26.2
$ make -s printvars VARS=BUSYBOX_RDEPENDENCIES QUOTED_VARS=YES
BUSYBOX_RDEPENDENCIES='ncurses util-linux'
$ make -s printvars VARS=BUSYBOX_FINAL_PATCH_DEPENDENCIES RAW_VARS=YES
BUSYBOX_FINAL_PATCH_DEPENDENCIES=$(sort $(BUSYBOX_PATCH_DEPENDENCIES))
And it is even possible to directly evaluate it in a shell script:
eval $(make -s printvars VARS=BUSYBOX_VERSION QUOTED_VARS=YES)
Backward compatibility of the output is not maintained. It is believed
that scripts that depended on the previous output were very fragile to
begin with, because they had to filter the non-formatted output
(splitting on spaces or braces was not really possible, because values
could contain either).
Document printvars and its options in the manual; list it in the output
of 'make help'.
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2017-03-29 11:43:05 +02:00
|
|
|
- +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
|
|
|
|
----
|