# Tidewall build entry points. Everything runs headless with the repo-local engine.
GODOT := tools/godot.sh

.PHONY: check import parse test test-selfcheck smoke capture-test binaries verify-engine

## Everything that must pass before a push.
check: verify-engine binaries parse test test-selfcheck smoke

verify-engine:
	@$(GODOT) --verify

binaries:
	@tools/check_binaries.sh

## Refreshes Godot's global class cache, so class_name lookups resolve.
import:
	@$(GODOT) --import --quit >/dev/null 2>&1 || true

parse: import
	@$(GODOT) --script res://tools/parse_all.gd

test: import
	@tools/run_tests.sh

## Proves the test runner detects each kind of failure.
test-selfcheck: import
	@tools/test_selfcheck.sh

## Boots the headless server for 1,000 ticks and checks exit codes, logs and timing.
smoke: import
	@tools/smoke.sh

## Renders the capture test scenes in the offscreen container. Needs Docker.
capture-test: import
	@tools/capture_selfcheck.sh
