TARGET = ./tmp/server
FRONTEND = ./web/frontend

SVELTE_COMPONENTS = status

SVELTE_TARGETS = $(addprefix $(FRONTEND)/public/build/,$(addsuffix .ts, $(SVELTE_COMPONENTS)))

.PHONY: $(TARGET) clean
.NOTPARALLEL:

$(TARGET): $(SVELTE_TARGETS)
	$(info ===>  BUILD Go server)
	@go build -o $(TARGET) main.go

$(SVELTE_TARGETS): $(SVELTE_SRC)
	$(info ===>  BUILD frontend)
	cd $(FRONTEND) && npm install && npm run build

clean:
	@rm -rf tmp
