additional changes
This commit is contained in:
+19
-1
@@ -8,13 +8,28 @@
|
||||
# output dirs live at the repo root and are referenced through `$(ROOT)`.
|
||||
|
||||
ODIN ?= odin
|
||||
GDB ?= gdb
|
||||
ROOT := ..
|
||||
BIN := $(ROOT)/bin
|
||||
BINARY := $(BIN)/desi_explorer
|
||||
ODIN_FLAGS := -collection:lib=lib/local
|
||||
WASM_DEFINE := RAYLIB_WASM_LIB=env.o
|
||||
|
||||
.PHONY: help setup add-dep run build build-debug build-web test clean fmt
|
||||
# Normalize GUI_ENV_FILE (given relative to the repo root) to an absolute path
|
||||
# so the Odin process can open it regardless of its working directory.
|
||||
# "override" is required because GUI_ENV_FILE is usually set on the command
|
||||
# line (or passed as an env var to this sub-make), which would otherwise
|
||||
# override any assignment made here.
|
||||
ifdef GUI_ENV_FILE
|
||||
ifneq ($(abspath $(GUI_ENV_FILE)),$(GUI_ENV_FILE))
|
||||
override GUI_ENV_FILE := $(abspath $(ROOT)/$(GUI_ENV_FILE))
|
||||
endif
|
||||
endif
|
||||
# "override" on a command-line variable silently drops it from the recipe
|
||||
# environment; re-export it so the app can find its env file (run + gdb).
|
||||
export GUI_ENV_FILE
|
||||
|
||||
.PHONY: help setup add-dep run build build-debug gdb build-web test clean fmt
|
||||
|
||||
help: ## List available targets
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||
@@ -41,6 +56,9 @@ build-debug: ## Debug build -> bin/desi_explorer
|
||||
@mkdir -p lib/local $(BIN)
|
||||
$(ODIN) build src $(ODIN_FLAGS) -o:none -debug -out:$(BINARY)
|
||||
|
||||
gdb: build-debug ## Run the native app under gdb (type 'run', then 'bt' on a crash)
|
||||
$(GDB) -q --args $(BINARY) $(ARGS)
|
||||
|
||||
build-web: ## WebAssembly build -> build/web (needs emscripten)
|
||||
@scripts/build_web.sh
|
||||
|
||||
|
||||
Reference in New Issue
Block a user