Files
wasm2elf-mb/justfile
T
2026-11-21 00:56:57 -08:00

34 lines
669 B
Makefile

exe := "_build/native/debug/build/cmd/main/main.exe"
# list recipes
default:
@just --list
# build the compiler
build:
moon build --target native
# type-check only
check:
moon check
# compile examples/<name>.wat to out/<name> (a static ELF)
compile name: build
mkdir -p out
wasm-tools parse examples/{{name}}.wat -o out/{{name}}.wasm
wasm-tools validate out/{{name}}.wasm
{{exe}} out/{{name}}.wasm out/{{name}}
# compile and run one example
run name: (compile name)
-./out/{{name}}; echo "exit code: $?"
# build and run every example
examples: build
./run_examples.sh
# remove build output
clean:
moon clean
rm -rf out