-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
28 lines (24 loc) · 817 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
CARGO_TARGET_DIR := $(CURDIR)/../target/wasm32-unknown-unknown
STATIC_DIR := $(CURDIR)/static
RELEASE_DIR := ${CARGO_TARGET_DIR}/release
DEBUG_DIR := ${CARGO_TARGET_DIR}/debug
DEPLOY_DIR ?= $(CURDIR)/build
default: deploy
deploy:
@cargo web build --release
@rm -rf ${DEPLOY_DIR} && mkdir ${DEPLOY_DIR}
@cp ${RELEASE_DIR}/packer.wasm ${DEPLOY_DIR}
@cp ${RELEASE_DIR}/packer.js ${DEPLOY_DIR}
@cp ${RELEASE_DIR}/app.wasm ${DEPLOY_DIR}
@cp ${RELEASE_DIR}/app.js ${DEPLOY_DIR}
@cp ${STATIC_DIR}/index.html ${DEPLOY_DIR}
@cp ${STATIC_DIR}/style.css ${DEPLOY_DIR}
@cp ${STATIC_DIR}/TrackballControls.js ${DEPLOY_DIR}
dev:
@cargo web build --bin packer
@cp ${DEBUG_DIR}/packer.wasm ${STATIC_DIR}
@cp ${DEBUG_DIR}/packer.js ${STATIC_DIR}
@cargo web start --bin app
clean:
@cargo clean
@rm -rf ${DEPLOY_DIR}