Every model option now names its vendor's bundled logo: a models.dev provider id maps through the presets, and model families (claude, gpt, gemini, deepseek, grok, kimi, glm, qwen, mistral, minimax) are recognised by id for lists that have no provider, such as Copilot's. Claude Code's aliases and own models carry the Claude mark, Codex's the OpenAI mark, Copilot's and Cursor's auto their own. The two-letter monogram fallback is gone: an option without a known vendor keeps an empty slot, and a custom provider shows a plain outline glyph. A foreign ANTHROPIC_BASE_URL now names the Claude Code group instead of being appended to the first row's note. Window header content moves 1.5pt down to sit level with the traffic lights. Dev builds also serve the UI over plain HTTP when DIAL_DEV_UI is set (make dev uses 127.0.0.1:3427) so it can be checked in a browser.
80 lines
3.0 KiB
Makefile
80 lines
3.0 KiB
Makefile
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
|
LDFLAGS = -s -w -X main.version=$(VERSION)
|
|
TAGS = production
|
|
TARGETS = darwin/arm64 darwin/amd64 linux/amd64 linux/arm64 windows/amd64 windows/arm64
|
|
|
|
# The GUI links the platform webview through cgo, so it is built natively.
|
|
# `nogui` builds the terminal-only dial, which cross-compiles anywhere.
|
|
ifeq ($(shell uname -s),Darwin)
|
|
export CGO_CFLAGS = -mmacosx-version-min=11.0
|
|
export CGO_LDFLAGS = -mmacosx-version-min=11.0
|
|
endif
|
|
|
|
.PHONY: build cli install test app icons release release-cli clean dev dev-once
|
|
|
|
build:
|
|
go build -tags $(TAGS) -trimpath -ldflags="$(LDFLAGS)" -o dial .
|
|
|
|
cli:
|
|
CGO_ENABLED=0 go build -tags nogui -trimpath -ldflags="$(LDFLAGS)" -o dial .
|
|
|
|
install:
|
|
go install -tags $(TAGS) -trimpath -ldflags="$(LDFLAGS)" .
|
|
|
|
test:
|
|
go vet ./... && go test ./...
|
|
|
|
# macOS bundle: menu bar app with no Dock icon (LSUIElement).
|
|
app: build
|
|
@rm -rf dial.app
|
|
@mkdir -p dial.app/Contents/MacOS dial.app/Contents/Resources
|
|
@cp dial dial.app/Contents/MacOS/dial
|
|
@cp build/darwin/dial.icns dial.app/Contents/Resources/dial.icns
|
|
@sed 's/@VERSION@/$(VERSION)/' build/darwin/Info.plist > dial.app/Contents/Info.plist
|
|
@echo " dial.app"
|
|
|
|
icons:
|
|
@go run build/icon/gen.go tray internal/gui/tray.png
|
|
@go run build/icon/gen.go app 64 internal/gui/icon.png
|
|
@rm -rf build/darwin/dial.iconset && mkdir -p build/darwin/dial.iconset
|
|
@for s in 16 32 128 256 512; do \
|
|
go run build/icon/gen.go app $$s build/darwin/dial.iconset/icon_$${s}x$${s}.png; \
|
|
go run build/icon/gen.go app $$((s*2)) build/darwin/dial.iconset/icon_$${s}x$${s}@2x.png; \
|
|
done
|
|
@iconutil -c icns build/darwin/dial.iconset -o build/darwin/dial.icns && rm -rf build/darwin/dial.iconset
|
|
|
|
release: clean build
|
|
@mkdir -p dist
|
|
@cp dial dist/dial-$(shell go env GOOS)-$(shell go env GOARCH)
|
|
@$(MAKE) --no-print-directory release-cli
|
|
|
|
release-cli:
|
|
@mkdir -p dist
|
|
@for t in $(TARGETS); do \
|
|
os=$${t%/*}; arch=$${t#*/}; ext=""; [ $$os = windows ] && ext=.exe; \
|
|
echo " $$os/$$arch (cli)"; \
|
|
CGO_ENABLED=0 GOOS=$$os GOARCH=$$arch go build -tags nogui -trimpath -ldflags="$(LDFLAGS)" -o dist/dial-cli-$$os-$$arch$$ext . ; \
|
|
done
|
|
|
|
clean:
|
|
rm -rf dial dial.exe dial.app dist
|
|
|
|
# Development: the UI is served from internal/gui/assets and the window
|
|
# reloads itself when a file there is saved; with fswatch installed, Go
|
|
# changes rebuild and relaunch the app. Uses its own gateway port so a
|
|
# running dial keeps serving the agents.
|
|
DEV_ADDR ?= 127.0.0.1:3426
|
|
DEV_UI ?= 127.0.0.1:3427
|
|
dev:
|
|
@if command -v fswatch >/dev/null; then \
|
|
while true; do \
|
|
$(MAKE) --no-print-directory dev-once & pid=$$!; \
|
|
fswatch -1 -r -e '.*' -i '\.go$$' -i '\.md$$' . >/dev/null; \
|
|
echo " go changed · rebuilding"; kill $$pid 2>/dev/null; pkill -x dial-dev 2>/dev/null; wait $$pid 2>/dev/null; \
|
|
done; \
|
|
else $(MAKE) --no-print-directory dev-once; fi
|
|
|
|
dev-once:
|
|
@go build -tags dev -o dial-dev . && echo " dial-dev · UI from internal/gui/assets, reload on save · gateway $(DEV_ADDR)"
|
|
@DIAL_ADDR=$(DEV_ADDR) DIAL_DEV_UI=$(DEV_UI) ./dial-dev app
|