Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (63 loc) · 2.65 KB
/
Copy pathMakefile
File metadata and controls
75 lines (63 loc) · 2.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.PHONY: check gen build test clippy fmt hooks godot-smoke godot-presentation
# Godot loads res://target/debug/libgodot_ext.dylib — always build there.
CARGO_TARGET_DIR := $(CURDIR)/target
export CARGO_TARGET_DIR
# macOS default; override with GODOT_BIN=... or put `godot` on PATH.
GODOT_BIN ?= /Applications/Godot.app/Contents/MacOS/Godot
GODOT_FALLBACK := godot
hooks:
./scripts/setup-hooks.sh
gen:
python3 scripts/gen_constants.py
python3 scripts/gen_golden.py
build:
./scripts/build_godot_ext.sh
test:
cargo test --workspace
clippy:
cargo clippy --workspace --all-targets -- -D warnings
fmt:
cargo fmt --check
godot-smoke: build
@set -e; \
GODOT=""; \
if [ -x "$(GODOT_BIN)" ]; then GODOT="$(GODOT_BIN)"; \
elif command -v $(GODOT_FALLBACK) >/dev/null 2>&1; then GODOT="$(GODOT_FALLBACK)"; \
else echo "ERROR: Godot not found. Install to /Applications/Godot.app or set GODOT_BIN."; exit 1; fi; \
case "$(uname -s)" in \
Darwin) test -f bin/libgodot_ext.dylib || { echo "ERROR: bin/libgodot_ext.dylib missing"; exit 1; } ;; \
Linux) test -f bin/libgodot_ext.so || { echo "ERROR: bin/libgodot_ext.so missing"; exit 1; } ;; \
esac; \
echo "Godot smoke test ($$GODOT)…"; \
if [ ! -f .godot/extension_list.cfg ]; then \
echo "Bootstrapping .godot/ (fresh clone — verifying GDExtensions)…"; \
"$$GODOT" --headless --path . -e --quit-after 1 >/dev/null 2>&1 || true; \
fi; \
"$$GODOT" --headless --path . res://scenes/GodotSmoke.tscn
godot-presentation: build
@set -e; \
GODOT=""; \
if [ -x "$(GODOT_BIN)" ]; then GODOT="$(GODOT_BIN)"; \
elif command -v $(GODOT_FALLBACK) >/dev/null 2>&1; then GODOT="$(GODOT_FALLBACK)"; \
else echo "ERROR: Godot not found. Install to /Applications/Godot.app or set GODOT_BIN."; exit 1; fi; \
case "$(uname -s)" in \
Darwin) test -f bin/libgodot_ext.dylib || { echo "ERROR: bin/libgodot_ext.dylib missing"; exit 1; } ;; \
Linux) test -f bin/libgodot_ext.so || { echo "ERROR: bin/libgodot_ext.so missing"; exit 1; } ;; \
esac; \
echo "Godot presentation tests ($$GODOT)…"; \
if [ ! -f .godot/extension_list.cfg ]; then \
echo "Bootstrapping .godot/ (fresh clone — verifying GDExtensions)…"; \
"$$GODOT" --headless --path . -e --quit-after 1 >/dev/null 2>&1 || true; \
fi; \
"$$GODOT" --headless --path . res://scenes/PresentationTests.tscn
check: gen
git diff --exit-code crates/accretion-core/src/constants.rs
git diff --exit-code crates/accretion-core/tests/fixtures/golden.json
sh scripts/check_invariants.sh
sh scripts/check_wiki.sh
cargo test --workspace
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --check
$(MAKE) godot-smoke
$(MAKE) godot-presentation
setup: hooks