-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
29 lines (23 loc) · 879 Bytes
/
Makefile
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
WASM_PACK = wasm-pack
INSTALL_TOOL = cargo install wasm-pack
BUILD_WEB = $(WASM_PACK) build --release --target web --out-dir pkg/web --out-name dcap-qvl-web -- --features=js
BUILD_NODE = $(WASM_PACK) build --release --target nodejs --out-dir pkg/node --out-name dcap-qvl-node -- --features=js
all: install_wasm_tool build_web_pkg build_node_pkg
install_wasm_tool:
@echo "Installing wasm-pack if not already installed..."
@if ! command -v $(WASM_PACK) &> /dev/null; then \
echo "wasm-pack not found, installing..."; \
$(INSTALL_TOOL); \
else \
echo "wasm-pack is already installed."; \
fi
build_web_pkg: install_wasm_tool
@echo "Building for web browsers..."
$(BUILD_WEB)
build_node_pkg: install_wasm_tool
@echo "Building for Node.js..."
$(BUILD_NODE)
clean:
@echo "Cleaning up..."
rm -rf pkg
.PHONY: all install_wasm_tool build_web_pkg build_node_pkg clean