From 5e1bede4aa097090d55202b2b867fa779fb5dc16 Mon Sep 17 00:00:00 2001 From: Tomi Hakala Date: Sun, 3 Mar 2024 11:46:02 +0200 Subject: [PATCH] refactor(audio): disabled PulseAudio to prioritise audio capture to use ALSA on Linux --- Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 88373dfa..ec93b511 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,22 @@ -BINARY_DIR=bin -BINARY_NAME=birdnet-go +BINARY_DIR := bin +BINARY_NAME := birdnet-go + +# Common flags +CGO_FLAGS := CGO_ENABLED=1 CGO_CFLAGS="-I$(HOME)/src/tensorflow -DMA_NO_PULSEAUDIO" +LDFLAGS := -ldflags "-s -w" build: - CGO_ENABLED=1 CGO_CFLAGS="-I$(HOME)/src/tensorflow" go build -ldflags "-s -w" -o ${BINARY_DIR}/${BINARY_NAME} + $(CGO_FLAGS) go build $(LDFLAGS) -o $(BINARY_DIR)/$(BINARY_NAME) windows: - GOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc CGO_CFLAGS="-I$(HOME)/src/tensorflow" go build -ldflags "-s -w" -o $(BINARY_DIR)/$(BINARY_NAME).exe + GOOS=windows GOARCH=amd64 $(CGO_FLAGS) CC=x86_64-w64-mingw32-gcc go build $(LDFLAGS) -o $(BINARY_DIR)/$(BINARY_NAME).exe macos_intel: - GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="-I$(HOME)/src/tensorflow" go build -ldflags "-s -w" -o $(BINARY_DIR)/$(BINARY_NAME) + GOOS=darwin GOARCH=amd64 $(CGO_FLAGS) go build $(LDFLAGS) -o $(BINARY_DIR)/$(BINARY_NAME) macos_arm: - GOOS=darwin GOARCH=amd64 CGO_ENABLED=1 CGO_CFLAGS="-I$(HOME)/src/tensorflow" go build -ldflags "-s -w" -o $(BINARY_DIR)/$(BINARY_NAME) + GOOS=darwin GOARCH=arm64 $(CGO_FLAGS) go build $(LDFLAGS) -o $(BINARY_DIR)/$(BINARY_NAME) clean: go clean - rm -f ${BINARY_DIR}/${BINARY_NAME} + rm -rf $(BINARY_DIR)/$(BINARY_NAME) $(BINARY_DIR)/$(BINARY_NAME).exe