Blame view

Makefile 767 Bytes
Georg Hopp authored
1 2 3 4
.PHONY: start wasm build run clean

PROFILE ?= dev
ifeq "$(PROFILE)" "release"
5 6 7
CARGO_PROFILE = --release
WASM_PROFILE = --release
WASM_EXTRA = --no-default-features
Georg Hopp authored
8
else
9 10 11
CARGO_PROFILE =
WASM_PROFILE = --dev
WASM_EXTRA =
Georg Hopp authored
12 13
endif
14 15 16 17
define msg
	@printf "\033[38;5;197m%s\033[0m\n" "$(1)"
endef
Georg Hopp authored
18
start:
19
	systemfd --no-pid -s 0.0.0.0:3000 -- \
Georg Hopp authored
20 21 22
		cargo watch -i static/ -s "make run"

wasm:
23 24
	$(call msg,BUILD WASM UI)
	@wasm-pack build $(WASM_PROFILE) -d ../static/ui -t web ./ui -- \
25
		$(WASM_EXTRA)
Georg Hopp authored
26 27

build:
28 29
	$(call msg,BUILD SERVER)
	@cargo build $(CARGO_PROFILE) --bin artshop-server
Georg Hopp authored
30 31

run: build wasm
32 33
	$(call msg,RUN SERVER)
	@cargo run $(CARGO_PROFILE) --bin artshop-server
Georg Hopp authored
34 35 36 37 38 39 40

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

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