Files
kage/Makefile
T
wehub-resource-sync 9c9576b5b9
ci / test (macos-latest) (push) Has been cancelled
ci / test (ubuntu-latest) (push) Has been cancelled
ci / lint (push) Has been cancelled
ci / govulncheck (push) Has been cancelled
ci / tidy (push) Has been cancelled
ci / webview (push) Has been cancelled
ci / windows-gui (push) Has been cancelled
release / check (push) Has been cancelled
release / release (push) Has been cancelled
Docs / build (push) Has been cancelled
Docs / deploy-pages (push) Has been cancelled
Docs / deploy-cloudflare (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-14 10:24:05 +08:00

46 lines
1.2 KiB
Makefile

BIN := kage
PKG := ./cmd/kage
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null || echo none)
DATE := $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w \
-X github.com/tamnd/kage/cli.Version=$(VERSION) \
-X github.com/tamnd/kage/cli.Commit=$(COMMIT) \
-X github.com/tamnd/kage/cli.Date=$(DATE)
export CGO_ENABLED := 0
.PHONY: build build-webview install test test-short vet tidy clean run
build:
go build -ldflags "$(LDFLAGS)" -o bin/$(BIN) $(PKG)
# A native-window viewer: opens packed sites in their own OS WebView window
# instead of the browser. Needs cgo, so it is built separately from the default
# pure-Go binary and the release pipeline.
build-webview:
CGO_ENABLED=1 go build -tags webview -ldflags "$(LDFLAGS)" -o bin/$(BIN) $(PKG)
install:
go install -ldflags "$(LDFLAGS)" $(PKG)
# Full suite, including the Chrome-driven end-to-end tests.
test:
go test -race ./...
# Skip the tests that launch a real browser (CI without Chrome, quick loops).
test-short:
go test -short ./...
vet:
go vet ./...
tidy:
go mod tidy
clean:
rm -rf bin
run: build
./bin/$(BIN)