Skip to content

Commit b47e329

Browse files
udzuraCopilot
andcommitted
Add Makefile for build process
- Create Makefile to handle cargo build and file concatenation - Revert config.toml to output out.js (intermediate file) - Combined.js is now generated by cat pre.js out.js main.js Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
1 parent a728eb2 commit b47e329

File tree

7 files changed

+17
-7
lines changed

7 files changed

+17
-7
lines changed

.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[target.wasm32-unknown-emscripten]
22
rustflags = [
33
"-C",
4-
"link-args=-o apps_script/out.js",
4+
"link-args=-o out.js",
55
"-C",
66
"link-args=-s EXPORTED_FUNCTIONS=['_eval_ruby_script_int','_main']",
77
"-C",
@@ -23,7 +23,7 @@ rustflags = [
2323
"-C",
2424
"link-args=-Oz",
2525
"-C",
26-
"link-args=-sSUPPORT_LONGJMP=emscripten",
26+
"link-args=-s SUPPORT_LONGJMP=emscripten",
2727
"-C",
2828
"link-args=-s SINGLE_FILE_BINARY_ENCODE=0",
2929
"-C",

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ target
1919
# and can be added to the global gitignore or merged into this file. For a more nuclear
2020
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
2121
#.idea/
22+
23+
out.js

Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ edition = "2024"
55

66
[dependencies]
77
mrubyedge = { version = "1.1.8", default-features = false }
8-
mruby-compiler2-sys = { version = "0.3.0", default-features = false }
8+
mruby-compiler2-sys = { path = "/Users/udzura/ghq/github.com/mrubyedge/mruby-compiler2-sys", default-features = false }
9+
# mruby-compiler2-sys = { version = "0.3.0", default-features = false }
910
# mruby-math = "0.1.0"
1011

1112
[profile.dev]

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.PHONY: build clean
2+
3+
build:
4+
BINDGEN_EXTRA_CLANG_ARGS="--sysroot=$(EMSDK)/upstream/emscripten/cache/sysroot" \
5+
cargo build --target wasm32-unknown-emscripten --release
6+
cat pre.js out.js main.js > combined.js
7+
8+
clean:
9+
cargo clean
10+
rm -f combined.js out.js

combined.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

out.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)