34 lines
669 B
Makefile
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
|