Makefile 625 Bytes
.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

start:
	systemfd --no-pid -s 0.0.0.0:3000 -- \
		cargo watch -i static/ -s "make run"

wasm:
	wasm-pack build $(WASM_PROFILE) -d ../static/ui -t web ./ui -- \
		$(WASM_EXTRA)

build:
	cargo build $(CARGO_PROFILE) --bin artshop-server

run: build wasm
	cargo run $(CARGO_PROFILE) --bin artshop-server

release:
	docker build -t artshop -f build/Dockerfile .

clean:
	cargo clean
	rm -Rf ./static/ui