Makefile
767 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.PHONY: start wasm build run clean
PROFILE ?= dev
ifeq "$(PROFILE)" "release"
CARGO_PROFILE = --release
WASM_PROFILE = --release
WASM_EXTRA = --no-default-features
else
CARGO_PROFILE =
WASM_PROFILE = --dev
WASM_EXTRA =
endif
define msg
@printf "\033[38;5;197m%s\033[0m\n" "$(1)"
endef
start:
systemfd --no-pid -s 0.0.0.0:3000 -- \
cargo watch -i static/ -s "make run"
wasm:
$(call msg,BUILD WASM UI)
@wasm-pack build $(WASM_PROFILE) -d ../static/ui -t web ./ui -- \
$(WASM_EXTRA)
build:
$(call msg,BUILD SERVER)
@cargo build $(CARGO_PROFILE) --bin artshop-server
run: build wasm
$(call msg,RUN SERVER)
@cargo run $(CARGO_PROFILE) --bin artshop-server
release:
docker build -t artshop -f build/Dockerfile .
clean:
cargo clean
rm -Rf ./static/ui