.PHONY: bootstrap setup test lint fmt fmt-check check build run dev deps docker cibuild clean hooks

# Every target is a thin shim over script/. The scripts are the real
# entrypoints: they carry the project-specific knowledge (flags,
# timeouts, docker-only linting) that a raw `go test` or `golangci-lint`
# invocation silently bypasses. Never call the underlying tools
# directly.
.DEFAULT_GOAL := check

bootstrap:
	@script/bootstrap

setup:
	@script/setup

test:
	@script/test

lint:
	@script/lint

fmt:
	@script/fmt

fmt-check:
	@script/fmt-check

check:
	@script/check

build:
	go build -o bin/simplexcalc ./cmd/simplexcalc

# run and dev need the simplex-chat command-line client on PATH; the
# image built by `make docker` carries its own.
run: build
	./bin/simplexcalc run

dev:
	go run ./cmd/simplexcalc run

deps:
	go mod download
	go mod tidy

docker:
	@script/docker

cibuild:
	@script/cibuild

clean:
	rm -rf bin/

hooks:
	@script/install-precommit
