# ─────────────────────────────────────────────────────────────────────────────
# Imaginator — Makefile
# ─────────────────────────────────────────────────────────────────────────────

BIN     := imaginator
GUI_BIN := imaginator-gui
VERSION := $(shell grep 'Version = ' core/types.go | sed 's/.*"\(.*\)".*/\1/')

.PHONY: all cli gui clean tidy

all: cli gui

cli:
	go build -ldflags="-s -w" -o $(BIN) ./cmd/cli

gui:
	go build -ldflags="-s -w" -o $(GUI_BIN) ./cmd/gui

# Windows — GUI without console window
gui-win:
	GOOS=windows go build -ldflags="-s -w -H windowsgui" -o $(GUI_BIN).exe ./cmd/gui

# macOS — bundle (requires fyne package tool: go install fyne.io/fyne/v2/cmd/fyne@latest)
gui-mac:
	fyne package -os darwin -icon assets/icon.png -name Imaginator -appID com.activething.imaginator ./cmd/gui

tidy:
	go mod tidy

clean:
	rm -f $(BIN) $(GUI_BIN) $(GUI_BIN).exe
