.PHONY: help build run test app rebuild-mac clean

CONFIG  ?= release
VERSION ?= 1.2.0

help:
	@echo "make build         # swift build -c $(CONFIG)"
	@echo "make run           # swift run -c $(CONFIG) CxWebAppMac"
	@echo "make test          # swift test"
	@echo "make app           # bundle into build/CxWebAppMac.app"
	@echo "make rebuild-mac   # build + .app + .tar.gz + .dmg + share/cxai-mac/build-info.json (VERSION=$(VERSION))"
	@echo "make clean"

build:
	swift build -c $(CONFIG)

run:
	swift run -c $(CONFIG) CxWebAppMac

test:
	swift test

app:
	bash scripts/build-app.sh

rebuild-mac:
	VERSION=$(VERSION) bash scripts/build-mac-bundle.sh

clean:
	rm -rf .build build
