From 4f98392c9a062e9d4dd8363a2ede9a919ad14006 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Wed, 16 Sep 2026 08:24:54 +0200 Subject: gui module: the plan tab's model, with tests --- Makefile | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0791c4e..b18e486 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ LDFLAGS = -s -w -X main.version=$(VERSION) CHECK_VERSION = case '$(VERSION)' in ''|*[!A-Za-z0-9._+-]*) echo "refusing: VERSION must contain only letters, digits, and the characters . - _ +" >&2; exit 1 ;; esac CROSS_PLATFORMS = linux/amd64 linux/arm64 freebsd/amd64 openbsd/amd64 -.PHONY: all help build install uninstall test vet fmt lint ci bench fuzz race vulncheck cross dist release deps install-hooks clean +.PHONY: all help build install uninstall test vet fmt lint ci bench fuzz race vulncheck cross dist release deps install-hooks clean gui gui-ci install-gui all: build @@ -177,5 +177,22 @@ deps: ## install the optional content extractors; may ask for privileges install-hooks: ## install the pre-commit hook that runs the leak check install -m 755 scripts/hooks/pre-commit "$$(git rev-parse --git-path hooks)/pre-commit" +# The GUI is its own module in gui/, with its own dependencies (gotk4), so +# krino's dependency gate above is unaffected. It needs cgo, a C compiler, +# GTK 4 and gobject-introspection development files. +gui: ## build ./gui/krino-gui (needs GTK 4 development files) + @$(CHECK_VERSION) + cd gui && CGO_ENABLED=1 go build -trimpath -ldflags "$(LDFLAGS)" -o krino-gui ./cmd/krino-gui + +gui-ci: ## the GUI module's gate: gofmt, vet, tests + @test -z "$$(cd gui && gofmt -l .)" || { echo "gofmt needed in gui:"; (cd gui && gofmt -l .); exit 1; } + cd gui && CGO_ENABLED=1 go vet ./... + cd gui && CGO_ENABLED=1 go test ./... + +install-gui: gui ## install krino-gui beside krino + mkdir -p $(BINDIR) + rm -f $(BINDIR)/krino-gui + install -m 755 gui/krino-gui $(BINDIR)/krino-gui + clean: ## remove build output - rm -f $(BIN) + rm -f $(BIN) gui/krino-gui -- cgit v1.3