-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
60 lines (47 loc) · 2.05 KB
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
[env]
CARGO_TARGET_DIR = {value = "target", condition = {env_not_set = ["CARGO_TARGET_DIR"]}}
CARGO_WASM_PATH = "${CARGO_TARGET_DIR}/wasm32-unknown-unknown/release/${CARGO_MAKE_CRATE_NAME}.wasm"
CARGO_PROFILE = "dev"
TARGET_DIR = "target"
CARGO_MANIFEST_DIR = "${CARGO_MAKE_WORKING_DIRECTORY}"
[tasks.install-target-wasm32-unknown-unknown]
args = ["target", "install", "wasm32-unknown-unknown"]
command = "rustup"
[tasks.basic-http-server]
install_crate = { crate_name = "basic-http-server", binary = "basic-http-server", test_arg="--help" }
[tasks.wasm-bindgen-cli]
install_crate = { crate_name = "wasm-bindgen-cli", binary = "wasm-bindgen", test_arg="--help", min_version = "0.2.77" }
[tasks.cargo-build-web]
args = ["build", "--target", "wasm32-unknown-unknown", "--release", "-Zbuild-std=std,panic_abort"]
command = "cargo"
dependencies = ["install-target-wasm32-unknown-unknown"]
[tasks.cargo-build-web-debug]
args = ["build", "--target", "wasm32-unknown-unknown", "-Zbuild-std=std,panic_abort"]
command = "cargo"
dependencies = ["install-target-wasm32-unknown-unknown"]
[tasks.bindgen]
args = ["--out-dir", "target/", "--out-name", "enc_chat", "--target", "web", "target/wasm32-unknown-unknown/release/enc_chat.wasm"]
command = "wasm-bindgen"
dependencies = ["cargo-build-web", "wasm-bindgen-cli"]
[tasks.bindgen-debug]
args = ["--out-dir", "target/", "--out-name", "enc_chat", "--target", "web", "target/wasm32-unknown-unknown/debug/enc_chat.wasm"]
command = "wasm-bindgen"
dependencies = ["cargo-build-web-debug", "wasm-bindgen-cli"]
[tasks.copy_wasm]
args = ["target/enc_chat_bg.wasm", "."]
command = "cp"
[tasks.copy_js]
args = ["target/enc_chat.js", "."]
command = "cp"
[tasks.build-web]
dependencies = ["bindgen"]
[tasks.build-web-debug]
dependencies = ["bindgen-debug"]
[tasks.serve]
args = ["-a", "0.0.0.0:9000"]
command = "basic-http-server"
dependencies = ["build-web", "copy_wasm", "copy_js", "basic-http-server"]
[tasks.serve-debug]
args = ["-a", "0.0.0.0:9000"]
command = "basic-http-server"
dependencies = ["build-web-debug", "copy_wasm", "copy_js", "basic-http-server"]