antplusbridge/Makefile
Erik Brakkee b24513fcc3 feat: add CLI with Cobra and timestamped logging
Introduce structured CLI argument parsing using Cobra with three
configurable flags:
  --vendor: USB vendor ID (default: 0x0fcf)
  --product: USB product ID (default: 0x1008)
  --device: ANT+ device number (default: 3001)

Add timestamped logging for all log statements with format
YYYY-MM-DD HH:MM:SS. Log vendor, product, and device values at
startup in both hex and decimal.

Remove hardcoded USB identifiers from main.go and consolidate all
startup logic into cli.go with a dedicated Config struct.

Update ant.go ListenForTrainer signature to accept uint16 for
vendor and product IDs.
2026-05-27 00:36:06 +02:00

33 lines
630 B
Makefile

.DEFAULT_GOAL := all
.PHONY: fmt vet build clean tools
tools:
GOPROXY=direct go install git.wamblee.org/public/gotools/cmd/go2junit@main
go install github.com/a-h/templ/cmd/templ@v0.3.977
fmt:
go fmt ./...
vet: fmt
go vet ./...
build: vet
mkdir -p bin
go build -ldflags "-X main.Version=$(shell git rev-parse HEAD ) -X main.BuildTime=$(shell date +'%Y-%m-%dT%H:%M:%S')" -o bin/bridge ./cmd/...
install: build
go install ./...
test: build
go test -count=1 -coverprofile=testout/coverage.out -json ${TESTFLAGS} ./... | go2junit testout
clean:
rm -rf bin
rm -f pkg/server/ui/LICENSE*
rm -rf testout
all: build