Skip to content

Commit

Permalink
Add Justfile command to build take-api examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
cr1901 committed Jul 23, 2022
1 parent 904db5d commit e44cf66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
set dotenv-load

build-example EXAMPLE OVERRIDE="nightly" WORKSPACE="take-api":
#!/bin/sh

set -eux

TARGET=target/msp430-none-elf/release/examples/{{EXAMPLE}}
cargo +{{OVERRIDE}} rustc --manifest-path=./{{WORKSPACE}}/Cargo.toml --release -Zbuild-std=core --example={{EXAMPLE}} -- --emit=obj=$TARGET.o,llvm-ir=$TARGET.ll,asm=$TARGET.s
msp430-elf-objdump -Cd $TARGET > $TARGET.lst
msp430-elf-readelf -a --wide $TARGET > $TARGET.sym
msp430-elf-objdump -Cd $TARGET.o > $TARGET.o.lst
msp430-elf-readelf -a --wide $TARGET.o > $TARGET.reloc
msp430-elf-size $TARGET

# Compare sizes using rustup
compare-min OVERRIDE="nightly":
cargo +{{OVERRIDE}} rustc --manifest-path=take-api/Cargo.toml --release --target=msp430-none-elf -Z build-std=core --example min -- --emit=llvm-ir=compare/min-nobare.ll,asm=compare/min-nobare.asm
Expand Down

0 comments on commit e44cf66

Please sign in to comment.