.PHONY: build run test typecheck fmt clean

BIN := bin/mcables
PKG := ./...

build:
	@mkdir -p bin
	go build -trimpath -ldflags="-s -w" -o $(BIN) ./cmd/mcables

run:
	go run ./cmd/mcables

test:
	go test -race $(PKG)

typecheck:
	@if [ -f web/tsconfig.json ]; then \
		cd web && tsc --noEmit; \
	else \
		echo "web/tsconfig.json not present yet — typecheck skipped"; \
	fi

fmt:
	gofmt -s -w .

clean:
	rm -rf bin
