# hub: the operator CLI (Go, standard library only). See docs/cli.md. # VERSION is stamped into internal/version.Version; release builds pass the tag without its leading v. GO ?= $(shell command -v go 2>/dev/null || echo /opt/homebrew/bin/go) VERSION ?= PKG = git.trevon.dev/trevon/hub/internal/version LDFLAGS = -s -w $(if $(VERSION),-X $(PKG).Version=$(VERSION)) BUILD = CGO_ENABLED=0 $(GO) build -trimpath -ldflags '$(LDFLAGS)' .PHONY: hub hub-linux-amd64 hub-darwin-arm64 test clean hub: @mkdir -p bin $(BUILD) -o bin/hub ./cmd/hub hub-linux-amd64: @mkdir -p bin GOOS=linux GOARCH=amd64 $(BUILD) -o bin/hub-linux-amd64 ./cmd/hub hub-darwin-arm64: @mkdir -p bin GOOS=darwin GOARCH=arm64 $(BUILD) -o bin/hub-darwin-arm64 ./cmd/hub test: $(GO) vet ./... && $(GO) test ./... && python3 -m unittest discover -s probe -p "test_*.py" clean: rm -rf bin dist