-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
26 lines (20 loc) · 721 Bytes
/
Copy pathMakefile
File metadata and controls
26 lines (20 loc) · 721 Bytes
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
ROOT=$(PWD)
PKG_DIR = $(ROOT)/$(WWW_DIR)/pkg/
JS_DIST_DIR = $(ROOT)/$(WWW_DIR)/dist/
WASM_FLAGS =--target web --release
WASM_CRATE = crates/gridsolve_wasm
WWW_DIR = www
ESBUILD_FLAGS = --sourcemap --bundle --target=firefox100,chrome100
wasm:
wasm-pack build $(WASM_FLAGS) $(WASM_CRATE) --out-dir $(PKG_DIR)
www:
esbuild $(ESBUILD_FLAGS) $(WWW_DIR)/app.jsx --outfile=$(JS_DIST_DIR)/dist.js
watch-www:
esbuild $(ESBUILD_FLAGS) $(WWW_DIR)/app.jsx --outfile=$(JS_DIST_DIR)/dist.js --watch
all: wasm www
mkdir -p $(JS_DIST_DIR)
cp $(PKG_DIR)/gridsolve_wasm_bg.wasm $(JS_DIST_DIR)
release: all
mkdir -p build
cp -r $(WWW_DIR)/*.html $(WWW_DIR)/*.css $(WWW_DIR)/dist build
.PHONY: wasm wasm-release www all release