make: add race+coverprofile to test target; add build-caldav target

- test target now runs with -race and emits coverage.out for coverage
  reporting.
- New build-caldav target builds cmd/mavcaldav without CGO (pure Go).
- build-caldav added to PHONY and build dependency chain.
- mavcaldav added to clean target.
This commit is contained in:
kami
2026-07-05 02:07:04 +04:00
parent 7683a9b32c
commit b9248ef2e6
+7 -4
View File
@@ -8,11 +8,11 @@ PIPER_BIN := $(shell pwd)/deps/piper/piper
PIPER_MODEL := $(shell pwd)/models/tts/ru_RU-irina-medium.onnx
PIPER_ESPEAK := $(shell pwd)/deps/piper/espeak-ng-data
.PHONY: all build build-stt build-tts build-daemon build-client build-web build-poll clean test run-stt run-tts run-web
.PHONY: all build build-stt build-tts build-daemon build-client build-web build-poll build-caldav clean test run-stt run-tts run-web
all: build
build: build-stt build-tts build-daemon build-client build-web build-poll
build: build-stt build-tts build-daemon build-client build-web build-poll build-caldav
build-stt:
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" LD_LIBRARY_PATH="$(shell pwd)/deps/lib" \
@@ -36,12 +36,15 @@ build-web:
build-poll:
$(GO) build $(GOFLAGS) -o mavpoll ./cmd/mavpoll/
build-caldav:
$(GO) build $(GOFLAGS) -o mavcaldav ./cmd/mavcaldav/
run-web: build-web
./mavweb -addr :9200 -voice 127.0.0.1:9100
test:
CGO_CFLAGS="$(CGO_CFLAGS)" CGO_LDFLAGS="$(CGO_LDFLAGS)" LD_LIBRARY_PATH="$(shell pwd)/deps/lib" \
$(GO) test ./internal/... ./cmd/...
$(GO) test -race -coverprofile=coverage.out ./internal/... ./cmd/...
run-stt: build-stt
LD_LIBRARY_PATH="$(shell pwd)/deps/lib" \
@@ -69,4 +72,4 @@ deps-piper:
tar -xzf /tmp/piper.tar.gz -C deps/
clean:
rm -f mavend mavenclient mavsttd mavttsd mavweb mavpoll
rm -f mavend mavenclient mavsttd mavttsd mavweb mavpoll mavcaldav