From 016d32d8bec41294f002f5e83bd57c25122b27f6 Mon Sep 17 00:00:00 2001 From: Salvatore Ingala <6681844+bigspider@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:05:10 +0100 Subject: [PATCH] Add justfiles for several crates --- app-sdk/justfile | 14 ++++++++++++++ apps/bitcoin/app/justfile | 23 +++++++++++++++++++++++ apps/sadik/app/justfile | 23 +++++++++++++++++++++++ apps/sadik/client/justfile | 5 +++++ apps/test/app/justfile | 23 +++++++++++++++++++++++ vm/justfile | 28 ++++++++++++++++++++++++++++ 6 files changed, 116 insertions(+) create mode 100644 app-sdk/justfile create mode 100644 apps/bitcoin/app/justfile create mode 100644 apps/sadik/app/justfile create mode 100644 apps/sadik/client/justfile create mode 100644 apps/test/app/justfile create mode 100644 vm/justfile diff --git a/app-sdk/justfile b/app-sdk/justfile new file mode 100644 index 0000000..be4eab8 --- /dev/null +++ b/app-sdk/justfile @@ -0,0 +1,14 @@ + +# build for both native and riscv targets +build: + cargo build --release --target=x86_64-unknown-linux-gnu + cargo build --release --target=riscv32i-unknown-none-elf + +# build for native target +build-native: + cargo build --release --target=x86_64-unknown-linux-gnu + +# build for riscv target +build-riscv: + cargo build --release --target=riscv32i-unknown-none-elf + diff --git a/apps/bitcoin/app/justfile b/apps/bitcoin/app/justfile new file mode 100644 index 0000000..ad87e93 --- /dev/null +++ b/apps/bitcoin/app/justfile @@ -0,0 +1,23 @@ +run: + cargo run + +# build for both native and riscv targets +build: + cargo build --release --target=x86_64-unknown-linux-gnu + cargo build --release --target=riscv32i-unknown-none-elf + +# build for native target +build-native: + cargo build --release --target=x86_64-unknown-linux-gnu + +# build for riscv target +build-riscv: + cargo build --release --target=riscv32i-unknown-none-elf + +# disassembles the riscv binary +disassemble: + riscv64-linux-gnu-objdump -d target/riscv32i-unknown-none-elf/release/vnd-bitcoin + +# show the sections of the riscv binary +show-sections: + readelf -S target/riscv32i-unknown-none-elf/release/vnd-bitcoin diff --git a/apps/sadik/app/justfile b/apps/sadik/app/justfile new file mode 100644 index 0000000..a108bd6 --- /dev/null +++ b/apps/sadik/app/justfile @@ -0,0 +1,23 @@ +run: + cargo run + +# build for both native and riscv targets +build: + cargo build --release --target=x86_64-unknown-linux-gnu + cargo build --release --target=riscv32i-unknown-none-elf + +# build for native target +build-native: + cargo build --release --target=x86_64-unknown-linux-gnu + +# build for riscv target +build-riscv: + cargo build --release --target=riscv32i-unknown-none-elf + +# disassembles the riscv binary +disassemble: + riscv64-linux-gnu-objdump -d target/riscv32i-unknown-none-elf/release/vnd-test + +# show the sections of the riscv binary +show-sections: + readelf -S target/riscv32i-unknown-none-elf/release/vnd-test diff --git a/apps/sadik/client/justfile b/apps/sadik/client/justfile new file mode 100644 index 0000000..2d3ace4 --- /dev/null +++ b/apps/sadik/client/justfile @@ -0,0 +1,5 @@ + +# build for both native and riscv targets +integration-tests: + cargo test --features speculos-tests + diff --git a/apps/test/app/justfile b/apps/test/app/justfile new file mode 100644 index 0000000..a108bd6 --- /dev/null +++ b/apps/test/app/justfile @@ -0,0 +1,23 @@ +run: + cargo run + +# build for both native and riscv targets +build: + cargo build --release --target=x86_64-unknown-linux-gnu + cargo build --release --target=riscv32i-unknown-none-elf + +# build for native target +build-native: + cargo build --release --target=x86_64-unknown-linux-gnu + +# build for riscv target +build-riscv: + cargo build --release --target=riscv32i-unknown-none-elf + +# disassembles the riscv binary +disassemble: + riscv64-linux-gnu-objdump -d target/riscv32i-unknown-none-elf/release/vnd-test + +# show the sections of the riscv binary +show-sections: + readelf -S target/riscv32i-unknown-none-elf/release/vnd-test diff --git a/vm/justfile b/vm/justfile new file mode 100644 index 0000000..cfca352 --- /dev/null +++ b/vm/justfile @@ -0,0 +1,28 @@ +run: + speculos build/nanos2/bin/app.elf + +run-nanox: + speculos build/nanox/bin/app.elf + +run-nanosplus: + speculos build/nanos2/bin/app.elf + +run-flex: + speculos build/flex/bin/app.elf + +run-stax: + speculos build/stax/bin/app.elf + + +load-nanosplus: + python3 -m ledgerblue.runScript --scp --fileName build/nanos2/bin/app.apdu --elfFile build/nanos2/bin/app.elf + +load-nanox: + python3 -m ledgerblue.runScript --scp --fileName build/nanox/bin/app.apdu --elfFile build/nanox/bin/app.elf + +load-flex: + python3 -m ledgerblue.runScript --scp --fileName build/flex/bin/app.apdu --elfFile build/flex/bin/app.elf + +load-stax: + python3 -m ledgerblue.runScript --scp --fileName build/stax/bin/app.apdu --elfFile build/stax/bin/app.elf +