From cb1cec8b13c9a35310eb9044162fbce3c19015f3 Mon Sep 17 00:00:00 2001 From: nandithebull Date: Sat, 21 Nov 2026 00:56:57 -0800 Subject: [PATCH] Add justfile and ignore out/ Co-Authored-By: Claude Sonnet 5.5 --- .gitignore | 1 + justfile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 justfile diff --git a/.gitignore b/.gitignore index 590f40a..b1031a1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ target/ target .mooncakes/ .moonagent/out/ +/out/ diff --git a/justfile b/justfile new file mode 100644 index 0000000..9fb55e9 --- /dev/null +++ b/justfile @@ -0,0 +1,33 @@ +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/.wat to out/ (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