Skip to content

Commit

Permalink
build: add just setup target
Browse files Browse the repository at this point in the history
  • Loading branch information
GCdePaula committed Jan 8, 2025
1 parent 48861cf commit 468e57e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
9 changes: 7 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
update-submodules:
git submodule update --recursive --init

clean-emulator:
make -C machine/emulator clean depclean distclean

setup: update-submodules clean-emulator
just -f ./test/programs/justfile download-deps
just -f ./test/programs/justfile build-programs

build-consensus:
just -f ./cartesi-rollups/contracts/justfile build
clean-consensus-bindings:
Expand Down Expand Up @@ -32,8 +39,6 @@ build-release-rust-workspace *ARGS: bind

build: build-smart-contracts bind build-rust-workspace

clean-emulator:
make -C machine/emulator clean depclean distclean


build-docker-image TAG="dave:dev":
Expand Down
35 changes: 20 additions & 15 deletions test/programs/justfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
download-deps:
wget https://github.com/cartesi/image-kernel/releases/download/v0.20.0/linux-6.5.13-ctsi-1-v0.20.0.bin \
-O ./linux.bin
wget https://github.com/cartesi/machine-emulator-tools/releases/download/v0.16.1/rootfs-tools-v0.16.1.ext2 \
-O ./rootfs.ext2
download-deps: clean-deps
wget https://github.com/cartesi/image-kernel/releases/download/v0.20.0/linux-6.5.13-ctsi-1-v0.20.0.bin \
-O ./linux.bin
wget https://github.com/cartesi/machine-emulator-tools/releases/download/v0.16.1/rootfs-tools-v0.16.1.ext2 \
-O ./rootfs.ext2

clean-deps:
rm rootfs.ext2
rm linux.bin
rm -f rootfs.ext2
rm -f linux.bin

clean-programs: clean-echo
build-programs: build-echo

build-echo: clean-echo
cartesi-machine --ram-image=./linux.bin \
--flash-drive=label:root,filename:./rootfs.ext2 \
--no-rollback --store=./echo/machine-image \
-- "ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --verbose=1"
./build_anvil_state.sh "echo"
cartesi-machine --ram-image=./linux.bin \
--flash-drive=label:root,filename:./rootfs.ext2 \
--no-rollback --store=./echo/machine-image \
-- "ioctl-echo-loop --vouchers=1 --notices=1 --reports=1 --verbose=1"
./build_anvil_state.sh "echo"

clean-echo:
rm -f echo/_anvil.log echo/addresses echo/anvil_state.json
rm -rf echo/machine-image

clean-program prog:
rm -f {{prog}}/_anvil.log echo/addresses echo/anvil_state.json
rm -rf {{prog}}/machine-image

clean-echo: (clean-program "echo")

0 comments on commit 468e57e

Please sign in to comment.