Skip to content

Commit

Permalink
refactor(audio): disabled PulseAudio to prioritise audio capture to u…
Browse files Browse the repository at this point in the history
…se ALSA on Linux
  • Loading branch information
tphakala committed Mar 3, 2024
1 parent 1636444 commit 5e1bede
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 5e1bede

Please sign in to comment.