Skip to content

Commit f91eaae

Browse files
Merge pull request #723 from yennster/patch-1
Add instructions on how to compile multiple projects with one copy of Mbed OS
2 parents b35d117 + d40549d commit f91eaae

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,28 @@ $ mbed new mbed-classic-program --mbedlib
216216

217217
You can create plain (empty) programs, without either Mbed OS 5 or Mbed OS 2, by using the `--create-only` option.
218218

219+
### Managing multiple Mbed projects
220+
221+
You can create multiple Mbed projects and use the same Mbed OS library directory for each of these projects with the following commands:
222+
223+
```
224+
$ cd <projects directory>
225+
$ mbed import mbed-os
226+
$ mbed config -G MBED_OS_DIR <projects directory>/mbed-os
227+
[mbed] <projects directory>/mbed-os now set as global MBED_OS_DIR
228+
$ mbed new project1
229+
[mbed] Creating new program "project1" (git)
230+
$ mbed new project2
231+
[mbed] Creating new program "project2" (git)
232+
```
233+
234+
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:
235+
236+
```
237+
$ mbed compile -t ARM -m LPC1768 --source project1 --source mbed-os --build BUILD/project1
238+
$ mbed compile -t ARM -m K64F --source project2 --source mbed-os --build BUILD/project2
239+
```
240+
219241
### Importing an existing program
220242

221243
Use `mbed import` to clone an existing program and all its dependencies to your machine:

0 commit comments

Comments
 (0)