PREFIX ?= $(HOME)/.local
PROFILE_DIR = $(HOME)/.config/nono/profiles
BIN_DIR = $(PREFIX)/bin
TUI_DIR = tui

.PHONY: install uninstall validate test tui tui-build tui-install

install:
	@./scripts/install.sh

uninstall:
	rm -f $(PROFILE_DIR)/opencode-tinfoil.json
	rm -f $(BIN_DIR)/opencode
	@echo "Uninstalled."

validate:
	nono profile validate opencode-tinfoil

test:
	$(BIN_DIR)/opencode --version

tui:
	cd $(TUI_DIR) && go run .

tui-build:
	cd $(TUI_DIR) && go build -buildvcs=false -o $(BIN_DIR)/nono-tui .

tui-install: tui-build
	@echo "Installed nono-tui to $(BIN_DIR)/nono-tui"