From bdefa5ad1a87c5959df0ad56c24e89c818f9f3b8 Mon Sep 17 00:00:00 2001 From: nshaheed Date: Sun, 28 Jul 2024 02:49:45 -0700 Subject: [PATCH 1/2] Add `make web` instructions to README --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 2feab34a6..f6ddde98a 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,13 @@ This process should build a `chuck` executable in `chuck/src`. ### Windows To build chuck using Visual Studio (2019 or later recommended), navigate to `chuck\src\visual-studio`, open `chuck.sln`, and build. +### Web +First, build and install the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html), and then run `make`: + +``` +cd chuck/src +make linux-all +``` ## Contributing to ChucK Here are the source repositories maintained by the ChucK Team. _Developers wanted!_ From 858a9c3607b4d34b5a40d281cdbfc03f2dcd9b64 Mon Sep 17 00:00:00 2001 From: Ge Wang Date: Mon, 12 Aug 2024 10:31:00 -0700 Subject: [PATCH 2/2] added further instructions for building webchuck in README.md --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f6ddde98a..c3a7a45f3 100644 --- a/README.md +++ b/README.md @@ -72,12 +72,19 @@ This process should build a `chuck` executable in `chuck/src`. To build chuck using Visual Studio (2019 or later recommended), navigate to `chuck\src\visual-studio`, open `chuck.sln`, and build. ### Web -First, build and install the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html), and then run `make`: - +To compile ChucK to WebAssembly (WASM): +* install the [Emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html) (and activate the SDK version, as instructed in the link) +* before building, enable Emscripten paths and environment variables (e.g., from the `emsdk` directory): +``` +source ./emsdk_env.sh +``` +* run `make web`: ``` cd chuck/src -make linux-all +make web ``` +This should create `webchuck.wasm` and `webchuck.js` in the `chuck/src/host-web/webchuck/js` directory. + ## Contributing to ChucK Here are the source repositories maintained by the ChucK Team. _Developers wanted!_