Intégration de libsoxr pour le rééchantillonnage audio

This commit is contained in:
2025-09-09 21:15:53 +02:00
parent 8770725cfa
commit be2792b27d
152 changed files with 17834 additions and 346 deletions

View File

@@ -1,7 +1,18 @@
APP_NAME=pmomusic
PREFIX := $(CURDIR)/C
SRC_DIR := $(PREFIX)/src/soxr-0.1.3
INCLUDE_DIR := $(PREFIX)/include
LIB_DIR := $(PREFIX)/lib
BIN_DIR := $(PREFIX)/bin
CFLAGS = -O2 -fPIC
LDFLAGS :=
LIBSOXR := $(LIB_DIR)/libsoxr.a
.PHONY: all clean build web run test
# Build Go app
build: web
build: web $(LIBSOXR)
go build -o bin/$(APP_NAME) ./cmd/$(APP_NAME)
# Build web frontend
@@ -14,10 +25,27 @@ web:
run:
go run ./cmd/$(APP_NAME)
# Clean Go binary and web build
# Clean Go binary, web build, libsoxr build
clean:
rm -rf bin/
rm -rf bin/$(APP_NAME)
rm -rf web/dist
@echo "==> Cleaning libsoxr build..."
# supprime les fichiers compilés libsoxr
rm -rf $(INCLUDE_DIR)/* $(LIB_DIR)/*
@echo "==> Clean done"
# Compilation statique de libsoxr
$(LIBSOXR):
@echo "==> Building libsoxr statically..."
mkdir -p $(INCLUDE_DIR) $(LIB_DIR) $(BIN_DIR)
cd $(SRC_DIR) && ./go
# Installer dans PREFIX (headers et lib)
cd $(SRC_DIR)/Release && make install PREFIX=$(PREFIX)
@echo "==> libsoxr built: $(LIBSOXR)"
# Build everything
all: build
# Run Go tests (requires libsoxr built)
test: $(LIBSOXR)
CGO_ENABLED=1 go test ./...