aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorraysan5 <raysan5@gmail.com>2016-11-16 19:43:21 +0100
committerraysan5 <raysan5@gmail.com>2016-11-16 19:43:21 +0100
commitf18c8cea160b65cf1fa30eb1578442dbe7edd032 (patch)
tree4d5e5bfebbee3bed34bc8bb3a013fbc1a46bce68
parent41e49c5a6e8b9816c7aae4a9fddecdf5d6b91a7b (diff)
downloadraylib-f18c8cea160b65cf1fa30eb1578442dbe7edd032.tar.gz
raylib-f18c8cea160b65cf1fa30eb1578442dbe7edd032.zip
Updated to support OpenAL Soft static library
-rw-r--r--src/Makefile18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index ee3f0c12..feadc424 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -38,6 +38,9 @@ PLATFORM ?= PLATFORM_DESKTOP
# define YES if you want shared/dynamic version of library instead of static (default)
SHARED ?= NO
+# define NO to use OpenAL Soft as static library (or shared by default)
+SHARED_OPENAL ?= NO
+
# determine if the file has root access (only for installing raylib)
# "whoami" prints the name of the user that calls him (so, if it is the root
# user, "whoami" prints "root").
@@ -99,11 +102,20 @@ CFLAGS = -O1 -Wall -std=gnu99 -fgnu89-inline -Wno-missing-braces
ifeq ($(SHARED),YES)
CFLAGS += -fPIC
SHAREDFLAG = BUILDING_DLL
- SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lopenal32 -lgdi32
+ SHAREDLIBS = -Lexternal/glfw3/lib/win32 -Lexternal/openal_soft/lib/win32 -lglfw3 -lgdi32
else
SHAREDFLAG = BUILDING_STATIC
endif
+# if static OpenAL Soft required, define the corresponding flags
+ifeq ($(SHARED_OPENAL),NO)
+ SHAREDLIBS += -lopenal32 -lwinmm
+ SHAREDOPENALFLAG = AL_LIBTYPE_STATIC
+else
+ SHAREDLIBS += -lopenal32dll
+ SHAREDOPENALFLAG = SHARED_OPENAL
+endif
+
#CFLAGSEXTRA = -Wextra -Wmissing-prototypes -Wstrict-prototypes
# define any directories containing required header files
@@ -165,7 +177,7 @@ else
endif
ifeq ($(PLATFORM_OS),WINDOWS)
$(CC) -shared -o $(OUTPUT_PATH)/raylib.dll $(OBJS) $(SHAREDLIBS) -Wl,--out-implib,$(OUTPUT_PATH)/libraylibdll.a
- @echo "raylib dynamic library (raylib.dll) and MSVC required import library (libraylibdll.a) generated!"
+ @echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!"
endif
else
# compile raylib static library for desktop platforms.
@@ -202,7 +214,7 @@ models.o : models.c raylib.h rlgl.h raymath.h
# compile audio module
audio.o : audio.c raylib.h
- $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG)
+ $(CC) -c $< $(CFLAGS) $(INCLUDES) -D$(PLATFORM) -D$(SHAREDFLAG) -D$(SHAREDOPENALFLAG)
# compile stb_vorbis library
external/stb_vorbis.o: external/stb_vorbis.c external/stb_vorbis.h