add dev resources; plumb GUI_ENV_FILE/API_ENV_FILE/API_DESI_DATA into run targets
This commit is contained in:
@@ -9,6 +9,14 @@ GUI := gui
|
||||
API := api
|
||||
INFRA := infra
|
||||
|
||||
# Local dev/test assets live under resources/dev. These are the defaults for
|
||||
# the run/*-web targets; override any of them on the command line, e.g.
|
||||
# make run GUI_ENV_FILE=/path/to/gui.env API_DESI_DATA=/path/to/data.json
|
||||
RESOURCE_DIR := $(CURDIR)/resources/dev
|
||||
GUI_ENV_FILE ?= $(RESOURCE_DIR)/gui.env.example
|
||||
API_ENV_FILE ?= $(RESOURCE_DIR)/api.env.example
|
||||
API_DESI_DATA ?= $(RESOURCE_DIR)/desi_subset.json
|
||||
|
||||
.PHONY: help setup run run-web build build-debug build-web test clean fmt \
|
||||
renovate-validate
|
||||
|
||||
@@ -32,9 +40,9 @@ setup: ## Setup all sub-projects (submodules, gui deps, api deps, infra deps)
|
||||
## ---- Renderer (Odin) -----------------------------------------------------
|
||||
|
||||
run: ## Run the native app (gui/)
|
||||
@$(MAKE) -C $(API) run & api_pid=$$!; \
|
||||
@API_ENV_FILE="$(API_ENV_FILE)" API_DESI_DATA="$(API_DESI_DATA)" $(MAKE) -C $(API) run & api_pid=$$!; \
|
||||
trap 'kill $$api_pid 2>/dev/null' INT TERM EXIT; \
|
||||
$(MAKE) -C $(GUI) run; \
|
||||
GUI_ENV_FILE="$(GUI_ENV_FILE)" $(MAKE) -C $(GUI) run; \
|
||||
kill $$api_pid 2>/dev/null
|
||||
|
||||
build: ## Release build (gui/ + api/)
|
||||
@@ -49,9 +57,9 @@ build-web: ## WebAssembly build -> build/web (gui/, needs emscripten)
|
||||
@$(MAKE) -C $(GUI) build-web
|
||||
|
||||
run-web: ## Start WASM build + API server for web dev
|
||||
@$(MAKE) -C $(API) run & api_pid=$$!; \
|
||||
@API_ENV_FILE="$(API_ENV_FILE)" API_DESI_DATA="$(API_DESI_DATA)" $(MAKE) -C $(API) run & api_pid=$$!; \
|
||||
trap 'kill $$api_pid 2>/dev/null' INT TERM EXIT; \
|
||||
$(MAKE) -C $(GUI) build-web; \
|
||||
GUI_ENV_FILE="$(GUI_ENV_FILE)" $(MAKE) -C $(GUI) build-web; \
|
||||
kill $$api_pid 2>/dev/null
|
||||
|
||||
## ---- Aggregates ----------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user