mirror of
https://github.com/Yonokid/PyTaiko.git
synced 2026-02-04 11:40:13 +01:00
new audio system?
This commit is contained in:
51
libs/audio/Makefile
Normal file
51
libs/audio/Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
# Makefile for audio library
|
||||
CC = gcc
|
||||
CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99
|
||||
LDFLAGS = -shared -Wl,--export-dynamic
|
||||
LIBS = -lportaudio -lsndfile -lsamplerate -lpthread -lm
|
||||
|
||||
# Detect OS for library naming
|
||||
UNAME_S := $(shell uname -s)
|
||||
ifeq ($(UNAME_S),Darwin)
|
||||
LIBNAME = libaudio.dylib
|
||||
CFLAGS += -I/usr/local/include -I/opt/homebrew/include
|
||||
LDFLAGS = -shared -undefined dynamic_lookup
|
||||
LDFLAGS += -L/usr/local/lib -L/opt/homebrew/lib
|
||||
else ifeq ($(UNAME_S),Linux)
|
||||
LIBNAME = libaudio.so
|
||||
else
|
||||
LIBNAME = libaudio.dll
|
||||
LIBS += -lole32 -lwinmm
|
||||
LDFLAGS = -shared
|
||||
endif
|
||||
|
||||
SOURCES = $(wildcard *.c)
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
.PHONY: all clean install
|
||||
|
||||
all: $(LIBNAME)
|
||||
|
||||
$(LIBNAME): $(OBJECTS)
|
||||
$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(OBJECTS) $(LIBNAME)
|
||||
|
||||
install: $(LIBNAME)
|
||||
sudo cp $(LIBNAME) /usr/local/lib/
|
||||
sudo ldconfig 2>/dev/null || true
|
||||
|
||||
# Development target with debug symbols
|
||||
debug: CFLAGS += -g -DDEBUG
|
||||
debug: $(LIBNAME)
|
||||
|
||||
# Check dependencies
|
||||
check-deps:
|
||||
@echo "Checking dependencies..."
|
||||
@pkg-config --exists portaudio-2.0 || (echo "PortAudio not found!" && false)
|
||||
@pkg-config --exists sndfile || (echo "libsndfile not found!" && false)
|
||||
@echo "All dependencies found!"
|
||||
Reference in New Issue
Block a user