Skip to content
Robin Avery edited this page Aug 7, 2025 · 10 revisions

Most helper scripts are located in /tools. Some are downloaded automatically by ninja (through download_tool.py, and these will appear in /build/tools.

Ninja targets

Command Result
ninja Build Matching objects and link the main.elf
ninja all_source Build Matching and NonMatching objects without linking
ninja diff If the DOL checksum is invalid, prints a diff of the mismatch
ninja baseline Sets the current state of function progress for later use with changes or changes_all. Stored in build/GALE01/baseline.json
ninja changes Prints all functions that have been broken since the baseline. A broken function was 100% and is now less.
ninja changes_all Prints all functions whose progress has gone down since the baseline.
ninja -t clean Cleans (deletes) all files produced by Ninja. Generally it is preferably to delete build/GALE01 instead.

Rust tools

Several of our tools are built in Rust using the Cargo workspaces feature. To compile and run one of these tools, ensure Cargo is installed and then run:

cargo run -rpq <package-name> -- [args]

The flags are -r (release, not debug), -p (package, from the workspace), and -q (quiet, suppress output from cargo itself). Refer to the Cargo documentation for further information. These tools can also be compiled into userspace binaries using Cargo install.

Replace symbols

To rename a symbol project-wide, run:

cargo run -rpq melee-replace-symbols -- [args]

This tool takes a series of replacements in the form of FROM:TO. You can pass the path of a text files to receive input from, or "-" (or leave it empty) to receive from stdin.

Examples

Multiple replacements, one line

echo 'fn_DEADBEEF:myNamedFunction lbl_12345678:someCallback' | cargo run -rqp melee-replace-symbols -- -

Multiple lines using cat

cat <<EOF | cargo run -rqp melee-replace-symbols -- -            
fn_DEADBEEF:myNamedFunction
lbl_12345678:someCallback
EOF

Using a text file

cargo run -rqp melee-replace-symbols -- build/replacements.txt

replacements.txt:

fn_DEADBEEF:myNamedFunction
lbl_12345678:someCallback

Clone this wiki locally