Skip to content

Commit b744fdb

Browse files
authored
Merge pull request #365 from bridadan/correcting-parameters
Correcting parameters '-o' and '--app-config'
2 parents ad45de3 + 0022df1 commit b744fdb

File tree

2 files changed

+14
-16
lines changed

2 files changed

+14
-16
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ The arguments for *compile* are:
348348
* `-t <TOOLCHAIN>` to select a toolchain (of those defined in `mbed_settings.py`, see above). The value can be either `ARM` (ARM Compiler 5), `GCC_ARM` (GNU ARM Embedded), or `IAR` (IAR Embedded Workbench for ARM).
349349
* `--source <SOURCE>` to select the source directory. The default is `.` (the current directorty). You can specify multiple source locations, even outside the program tree.
350350
* `--build <BUILD>` to select the build directory. Default: `BUILD/` inside your program.
351-
* `--options <OPTIONS>` to select compile options. Examples: "debug-info": will generate debugging information; "small-build" will use microlib/nanolib, but limit RTOS to single thread; "save-asm": will save the asm generated by the compiler
351+
* `--profile <PATH_TO_BUILD_PROFILE>` to select a path to a build profile configuration file. Example: mbed-os/tools/profiles/debug.json
352352
* `--library` to compile the code as a [static .a/.ar library](#compiling-static-libraries).
353353
* `--config` to inspect the run-time compile configuration (see below).
354354
* `-S` or `--supported` shows a matrix of the supported targets and toolchains.
@@ -430,13 +430,13 @@ $ mbed compile -t GCC_ARM -m K64F -c -DUVISOR_PRESENT
430430

431431
___Compiling in debug mode___
432432

433-
To compile in debug mode (as opposed to the default *release* mode) use `-o debug-info` in the compile command line:
433+
To compile in debug mode (as opposed to the default *release* mode) use `--profile mbed-os/tools/profiles/debug.json` in the compile command line:
434434

435435
```
436-
$ mbed compile -t GCC_ARM -m K64F -o debug-info
436+
$ mbed compile -t GCC_ARM -m K64F --profile mbed-os/tools/profiles/debug.json
437437
```
438438

439-
<span class="tips">**Tip:** If you have files that you want to compile only in release mode, put them in a directory called `TARGET_RELEASE` at any level of your tree. If you have files that you want to compile only in debug mode, put them in a directory called `TARGET_DEBUG` at any level of your tree (then use `-o debug-info` as explained above).
439+
<span class="tips">**Tip:** If you have files that you want to compile only in release mode, put them in a directory called `TARGET_RELEASE` at any level of your tree. If you have files that you want to compile only in debug mode, put them in a directory called `TARGET_DEBUG` at any level of your tree (then use `--profile` as explained above).
440440
</span>
441441

442442
### Automating toolchain and target selection
@@ -510,7 +510,7 @@ The arguments to `test` are:
510510
* `-n <TESTS_BY_NAME>` to limit the tests built or ran to a comma separated list (ex. test1,test2,test3)
511511
* `--source <SOURCE>` to select the source directory. Default is `.` (the current dir). You can specify multiple source locations, even outside the program tree.
512512
* `--build <BUILD>` to select the build directory. Default: `BUILD/` inside your program.
513-
* `--options <OPTIONS>` to select compile options. Examples: "debug-info": will generate debugging information; "small-build" will use microlib/nanolib, but limit RTOS to single thread; "save-asm": will save the asm generated by the compiler
513+
* `--profile <PATH_TO_BUILD_PROFILE>` to select a path to a build profile configuration file. Example: mbed-os/tools/profiles/debug.json
514514
* `-c or --clean` to clean the build directory before compiling,
515515
* `--test-spec <TEST_SPEC>` to set the path for the test spec file used when building and running tests (the default path is the build directory).
516516
* `-v` or `--verbose` for verbose diagnostic output.

mbed/mbed.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ def status_(ignore=False):
20142014
@subcommand('compile',
20152015
dict(name=['-t', '--toolchain'], help='Compile toolchain. Example: ARM, GCC_ARM, IAR'),
20162016
dict(name=['-m', '--target'], help='Compile target MCU. Example: K64F, NUCLEO_F401RE, NRF51822...'),
2017-
dict(name=['-o', '--options'], action='append', help='Compile options. Examples: "debug-info": generate debugging information; "small-build" to use microlib/nanolib, but limit RTOS to single thread; "save-asm": save the asm generated by the compiler'),
2017+
dict(name=['--profile'], action='append', help='Path of a build profile configuration file. Example: mbed-os/tools/profiles/debug.json'),
20182018
dict(name='--library', dest='compile_library', action='store_true', help='Compile the current program or library as a static library.'),
20192019
dict(name='--config', dest='compile_config', action='store_true', help='Show run-time compile configuration'),
20202020
dict(name='--prefix', dest='config_prefix', action='append', help='Restrict listing to parameters that have this prefix'),
@@ -2026,7 +2026,7 @@ def status_(ignore=False):
20262026
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
20272027
help='Compile code using the mbed build tools',
20282028
description=("Compile this program using the mbed build tools."))
2029-
def compile_(toolchain=None, target=None, options=False, compile_library=False, compile_config=False, config_prefix=None, source=False, build=False, clean=False, artifact_name=None, supported=False, app_config=None):
2029+
def compile_(toolchain=None, target=None, profile=False, compile_library=False, compile_config=False, config_prefix=None, source=False, build=False, clean=False, artifact_name=None, supported=False, app_config=None):
20302030
# Gather remaining arguments
20312031
args = remainder
20322032
# Find the root of the program
@@ -2061,7 +2061,7 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
20612061
# Compile configuration
20622062
popen(['python', os.path.join(tools_dir, 'get_config.py')]
20632063
+ ['-t', tchain, '-m', target]
2064-
+ list(chain.from_iterable(izip(repeat('-o'), options or [])))
2064+
+ list(chain.from_iterable(izip(repeat('--profile'), profile or [])))
20652065
+ list(chain.from_iterable(izip(repeat('--source'), source)))
20662066
+ (['-v'] if verbose else [])
20672067
+ (list(chain.from_iterable(izip(repeat('--prefix'), config_prefix))) if config_prefix else []),
@@ -2074,7 +2074,7 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
20742074
popen(['python', '-u', os.path.join(tools_dir, 'build.py')]
20752075
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
20762076
+ ['-t', tchain, '-m', target]
2077-
+ list(chain.from_iterable(izip(repeat('-o'), options or [])))
2077+
+ list(chain.from_iterable(izip(repeat('--profile'), profile or [])))
20782078
+ list(chain.from_iterable(izip(repeat('--source'), source)))
20792079
+ ['--build', build]
20802080
+ (['-c'] if clean else [])
@@ -2090,7 +2090,7 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
20902090
popen(['python', '-u', os.path.join(tools_dir, 'make.py')]
20912091
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
20922092
+ ['-t', tchain, '-m', target]
2093-
+ list(chain.from_iterable(izip(repeat('-o'), options or [])))
2093+
+ list(chain.from_iterable(izip(repeat('--profile'), profile or [])))
20942094
+ list(chain.from_iterable(izip(repeat('--source'), source)))
20952095
+ ['--build', build]
20962096
+ (['-c'] if clean else [])
@@ -2114,13 +2114,13 @@ def compile_(toolchain=None, target=None, options=False, compile_library=False,
21142114
dict(name=['-n', '--tests-by-name'], dest='tests_by_name', help='Limit the tests to a list (ex. test1,test2,test3)'),
21152115
dict(name='--source', action='append', help='Source directory. Default: . (current dir)'),
21162116
dict(name='--build', help='Build directory. Default: build/'),
2117-
dict(name=['-o', '--options'], action='append', help='Compile options. Examples: "debug-info": generate debugging information; "small-build" to use microlib/nanolib, but limit RTOS to single thread; "save-asm": save the asm generated by the compiler'),
2117+
dict(name=['--profile'], action='append', help='Path of a build profile configuration file. Example: mbed-os/tools/profiles/debug.json'),
21182118
dict(name=['-c', '--clean'], action='store_true', help='Clean the build directory before compiling'),
21192119
dict(name='--test-spec', dest="test_spec", help="Path used for the test spec file used when building and running tests (the default path is the build directory)"),
21202120
dict(name='--app-config', dest="app_config", help="Path of an app configuration file (Default is to look for 'mbed_app.json')"),
21212121
help='Find, build and run tests',
21222122
description=("Find, build, and run tests in a program and libraries"))
2123-
def test_(toolchain=None, target=None, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, options=False, build=False, clean=False, test_spec=None, app_config=None):
2123+
def test_(toolchain=None, target=None, compile_list=False, run_list=False, compile_only=False, run_only=False, tests_by_name=None, source=False, profile=False, build=False, clean=False, test_spec=None, app_config=None):
21242124
# Gather remaining arguments
21252125
args = remainder
21262126
# Find the root of the program
@@ -2158,7 +2158,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21582158

21592159
if compile_list:
21602160
popen(['python', '-u', os.path.join(tools_dir, 'test.py'), '--list']
2161-
+ list(chain.from_iterable(izip(repeat('-o'), options or [])))
2161+
+ list(chain.from_iterable(izip(repeat('--profile'), profile or [])))
21622162
+ ['-t', tchain, '-m', target]
21632163
+ list(chain.from_iterable(izip(repeat('--source'), source)))
21642164
+ (['-n', tests_by_name] if tests_by_name else [])
@@ -2170,7 +2170,7 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21702170
if compile_only or build_and_run_tests:
21712171
popen(['python', '-u', os.path.join(tools_dir, 'test.py')]
21722172
+ list(chain.from_iterable(izip(repeat('-D'), macros)))
2173-
+ list(chain.from_iterable(izip(repeat('-o'), options or [])))
2173+
+ list(chain.from_iterable(izip(repeat('--profile'), profile or [])))
21742174
+ ['-t', tchain, '-m', target]
21752175
+ (['-c'] if clean else [])
21762176
+ list(chain.from_iterable(izip(repeat('--source'), source)))
@@ -2186,15 +2186,13 @@ def test_(toolchain=None, target=None, compile_list=False, run_list=False, compi
21862186
popen(['mbedgt', '--test-spec', test_spec, '--list']
21872187
+ (['-n', tests_by_name] if tests_by_name else [])
21882188
+ (['-V'] if verbose else [])
2189-
+ (['--app-config', app_config] if app_config else [])
21902189
+ args,
21912190
env=env)
21922191

21932192
if run_only or build_and_run_tests:
21942193
popen(['mbedgt', '--test-spec', test_spec]
21952194
+ (['-n', tests_by_name] if tests_by_name else [])
21962195
+ (['-V'] if verbose else [])
2197-
+ (['--app-config', app_config] if app_config else [])
21982196
+ args,
21992197
env=env)
22002198

0 commit comments

Comments
 (0)