Skip to content

Commit cb7dc94

Browse files
author
Amanda Butler
authored
Merge pull request #1141 from ARMmbed/fix-mbed-os-dir-description
#1139: Improving description of MBED_OS_DIR config option
2 parents e9fa8a0 + 07a9a43 commit cb7dc94

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

docs/tools/CLI/cli-create.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,24 +82,30 @@ You can create plain (empty) programs, without either Mbed OS 5 or Mbed OS 2, by
8282

8383
### Managing multiple Mbed projects
8484

85-
You can create multiple Mbed projects and use the same Mbed OS library directory for each of these projects with the following commands:
85+
By default, a copy of `mbed-os` is checked out into each of your active Mbed project directories.
86+
87+
The configuration option `MBED_OS_DIR` allows you to create multiple Mbed projects and use the same Mbed OS library directory for each of these projects.
88+
89+
Set the `MBED_OS_DIR` configuration option as an absolute path to a directory containing an implementation of `mbed-os`.
90+
91+
The following commands illustrate this:
8692

8793
```
88-
$ cd <projects directory>
94+
$ cd /absolute/path/to/project/dir
8995
$ mbed import mbed-os
90-
$ mbed config -G MBED_OS_DIR <projects directory>/mbed-os
91-
[mbed] <projects directory>/mbed-os now set as global MBED_OS_DIR
96+
$ mbed config -G MBED_OS_DIR /absolute/path/to/project/dir/mbed-os
97+
[mbed] /absolute/path/to/project/dir/mbed-os now set as global MBED_OS_DIR
9298
$ mbed new project1
9399
[mbed] Creating new program "project1" (git)
94100
$ mbed new project2
95101
[mbed] Creating new program "project2" (git)
96102
```
97103

98-
Add your `main.cpp` file and other project files to the `project1` and `project2` directories. Then compile each project from the root `<projects directory>` with the following example commands:
104+
Add your `main.cpp` file and other project files to the `project1` and `project2` directories. Then compile each project from the root `/absolute/path/to/project/dir` with the following example commands:
99105

100106
```
101107
$ mbed compile -t ARM -m LPC1768 --source project1 --source mbed-os --build BUILD/project1
102-
$ mbed compile -t ARM -m K64F --source project2 --source mbed-os --build BUILD/project2
108+
$ mbed compile -t ARM -m K64F --source project2 --source mbed-os --build BUILD/project2
103109
```
104110

105111
Find more details on the `--source` switch in the [build rules documentation](../reference/mbed-os-build-rules.html).

0 commit comments

Comments
 (0)