From 52868a82fa240f18d10b4a507fd51351d184fcbe Mon Sep 17 00:00:00 2001 From: Omar Rizwan Date: Wed, 19 Jun 2024 13:33:17 -0400 Subject: [PATCH] Add Emscripten instructions --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index 312d4f4..9be3acc 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,17 @@ project under the `test` directory as well, demonstrating usage of the library. - Run `make` to build - To run the test program you'll need a SM64 US ROM in the root of the repository with the name `baserom.us.z64`. +## Building for Emscripten (Web) (WIP) + +Run `emmake make CC=emcc`. + +If you want libsm64 standalone to call from JS (may not be that +useful?), then run `emcc dist/libsm64.so -o libsm64.js` afterward to +emit `libsm64.wasm` and `libsm64.js`. + +Otherwise, `dist/libsm64.so` should be a compiled WebAssembly object +that you can link into your own C project. + ## Make targets (all platforms) - `make lib`: (Default) Build the `dist` directory, containing the shared object or DLL and public-facing header.