From 50cacecd1754e2579b347058f28c4f77768b5079 Mon Sep 17 00:00:00 2001 From: Anthony Samms Date: Mon, 15 Sep 2025 13:42:50 -0400 Subject: [PATCH] Update Makefile --- libs/audio/Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/audio/Makefile b/libs/audio/Makefile index e1f3cc8..d45b09e 100644 --- a/libs/audio/Makefile +++ b/libs/audio/Makefile @@ -5,11 +5,10 @@ CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 LDFLAGS = -shared -Wl,--export-dynamic LIBS = -lportaudio -lsndfile -lsamplerate -lpthread -lm -# Detect OS and set appropriate flags UNAME_S := $(shell uname -s 2>/dev/null || echo Windows) # MSYS2/MinGW-w64 detection -ifeq ($(UNAME_S),MINGW64_NT) +ifneq (,$(findstring MINGW,$(UNAME_S))) CC = x86_64-w64-mingw32-gcc LIBNAME = libaudio.dll CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include @@ -17,6 +16,15 @@ ifeq ($(UNAME_S),MINGW64_NT) LIBS = -lportaudio -lsndfile -lsamplerate -lpthread -lm OBJ_EXT = .o +else ifneq (,$(findstring Windows,$(UNAME_S))) + # Windows with MSVC + CC = cl + LIBNAME = libaudio.dll + CFLAGS = /O2 /W3 /MD /TC + LDFLAGS = /DLL + LIBS = portaudio.lib libsndfile.lib libsamplerate.lib + OBJ_EXT = .obj + else ifeq ($(UNAME_S),Darwin) # macOS LIBNAME = libaudio.dylib