mirror of https://github.com/ARMmbed/mbed-os.git
When building greentea tests, each test is an executable with its
own output binary path. This is also the case when a user project
produces multiple executables. But the current implementation of
post-build operations always assumes there's only one executable,
at the root of the build directory.
The post-build command depends on Mbed target, and it always takes
the the executable we build as an input file. To achieve this, we
let each Mbed target (that has a post-build command) define a function
function(mbed_post_build_function target)
which takes a CMake executable target as an argument from which it can
get its binary path using generator expressions. It generates and adds
to the passed executable target a post-build custom command.
Notes:
* The function name needs to be exact, because CMake only supports
literal function calls - CMake can't dereference a function name from
a variable. To avoid multiple definitions of this function, each Mbed
target needs to guard it with a macro to check if the user is
building this Mbed target.
* `mbed_post_build_function()` is a function, but it is usually
defined by another macro rather than a parent function, because
nesting functions would make many variables inaccessible inside the
innermost `mbed_post_build_function()`.
* There's no more need to force regenerate images. Previously, post-
build commands were custom *targets* which always got to run, so we
force regenerated images on every build to avoid patching an image
that's already been patched once on previous build. Now post-build
commands are custom *commands* of the same executable target, and they
are only run if the executable target itself is rebuilt.
|
||
|---|---|---|
| .. | ||
| arm_pack_manager | ||
| bootloaders | ||
| cmake | ||
| config | ||
| debug_tools/crash_log_parser | ||
| export | ||
| flash_algo | ||
| importer | ||
| notifier | ||
| profiles | ||
| psa | ||
| resources | ||
| targets | ||
| test | ||
| test_configs | ||
| toolchains | ||
| .mbedignore | ||
| README.md | ||
| __init__.py | ||
| build.py | ||
| build_api.py | ||
| build_release.py | ||
| default_settings.py | ||
| detect_targets.py | ||
| device_management.py | ||
| get_config.py | ||
| libraries.py | ||
| make.py | ||
| memap.py | ||
| memap_flamegraph.html | ||
| options.py | ||
| paths.py | ||
| project.py | ||
| regions.py | ||
| run_icetea.py | ||
| settings.py | ||
| singletest.py | ||
| test.py | ||
| test_api.py | ||
| test_exporters.py | ||
| tests.py | ||
| utils.py | ||
README.md
Mbed OS Build Tools
This directory contains the python tools used for building Mbed OS and Mbed 2.
Quick navigation:
| file/directory | Purpose/function |
|---|---|
build.py |
implementation of mbed compile --library |
build_api.py |
full-project build operations |
build_release.py |
CLI for making an mbed 2 release |
config |
implementation of Config System |
debug_tools |
Crash log parsing |
default_settings.py |
Default version of project local settings.py |
detect_targets.py |
implementation of mbed detect |
device_management.py |
implementation of mbed device-management |
export |
Export plugins and API for woking with them |
flash_algo |
CMSIS flash algorithm parser |
get_config.py |
implementation of mbed compile --config |
host_tests |
location of pre-htrun host tests |
importer |
code importer for use with CMSIS, TFM/PSA etc. |
libraries.py |
constants for building mbed 2 libraries |
make.py |
implementation of mbed compile |
memap.py |
map file parser and summary generator |
notifier |
API for seting compile status to a frontend |
options.py |
Default option parser and option utilities |
paths.py |
constants for many paths used |
profiles |
location of the default build profiles |
project.py |
implementation of mbed export |
psa |
PSA |
regions.py |
merging from managed bootloader mode |
resources |
scans directories for files used in a project |
run_icetea.py |
implementation of mbed test --icetea |
settings.py |
project specific settings from env vars |
singletest.py |
location of pre-greentea greentea |
targets |
target description reader and post-build steps |
test |
unit tests for tools |
test_api.py |
part of pre-greentea greentea |
test_configs |
configuration files used by mbed test |
test_exporters.py |
part of pre-greentea greentea |
tests.py |
implementation of mbed test --greentea |
toolchains |
API for calling the selected compiler |
utils.py |
General purpose utilities like file moving |