-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from tock/make-all-tab
Make: add `make tab` as an approach to build for multiple locations
- Loading branch information
Showing
29 changed files
with
351 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
libtock_build_scripts::auto_layout(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[package] | ||
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"] | ||
categories = ["embedded", "no-std", "os"] | ||
description = """Helper functions for compiling libtock-rs apps.""" | ||
edition = "2021" | ||
license = "Apache-2.0 OR MIT" | ||
name = "libtock_build_scripts" | ||
repository = "https://www.github.com/tock/libtock-rs" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
Libtock Build Scripts Support Crate | ||
=================================== | ||
|
||
This crate provides helpers for building libtock-rs apps. | ||
|
||
Usage | ||
----- | ||
|
||
There are three general steps to use this crate. | ||
|
||
1. This crate should be included as a build dependency in the app's Cargo.toml | ||
file: | ||
|
||
```toml | ||
# Cargo.toml | ||
... | ||
|
||
[build-dependencies] | ||
libtock_build_scripts = { git = "https://github.com/tock/libtock-rs"} | ||
``` | ||
|
||
This will ensure the crate and the contained linker scripts are available for | ||
the app build. | ||
|
||
2. This crate provides a helper function which can used from the libtock-rs | ||
app's build.rs file. In the common case, you just call the provided function | ||
from the build.rs file in your crate's root: | ||
|
||
```rs | ||
// build.rs | ||
|
||
fn main() { | ||
libtock_build_scripts::auto_layout(); | ||
} | ||
``` | ||
|
||
This will allow cargo to setup linker scripts and paths for the linker when | ||
your app is built. | ||
|
||
3. When calling `cargo build` you need to instruct the build.rs on where in | ||
memory to compile your app for. This crate supports two mechanisms to do | ||
this. You can only use one. | ||
|
||
1. Set the `LIBTOCK_PLATFORM` environment variable which specifies the name | ||
of the linker script in `/layouts` to be used. So for example, if you are | ||
using the microbit_v2 you might run: | ||
|
||
```bash | ||
$ LIBTOCK_PLATFORM=microbit_v2 cargo build --target thumbv7em-none-eabi --release | ||
``` | ||
|
||
2. Set the `LIBTOCK_LINKER_FLASH` and `LIBTOCK_LINKER_RAM` environment | ||
variables which specify the starting addresses of flash and RAM memory, | ||
respectively. This allows you to customize where exactly the compiled app | ||
must be placed in flash and RAM. For example, to build for common | ||
Cortex-M4 platforms you might run: | ||
|
||
```bash | ||
$ LIBTOCK_LINKER_FLASH=0x00040000 LIBTOCK_LINKER_RAM=0x20008000 cargo build --target thumbv7em-none-eabi --release | ||
``` |
File renamed without changes.
Oops, something went wrong.