From f18c8cea160b65cf1fa30eb1578442dbe7edd032 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Wed, 16 Nov 2016 19:43:21 +0100 Subject: Updated to support OpenAL Soft static library --- src/Makefile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/Makefile') 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 -- cgit v1.2.3 From bee283b12b348b054bde2eae1a449c363ac26fd7 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Thu, 17 Nov 2016 12:55:30 +0100 Subject: Some tweaks around --- src/Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index feadc424..2433428f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,11 @@ SHARED ?= NO # define NO to use OpenAL Soft as static library (or shared by default) SHARED_OPENAL ?= NO +# on PLATFORM_WEB force OpenAL Soft shared library +ifeq ($(PLATFORM),PLATFORM_WEB) + SHARED_OPENAL ?= YES +endif + # 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"). -- cgit v1.2.3 From f7b706263a820034a93ab88e7582b7001819d8d0 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 18 Nov 2016 13:39:57 +0100 Subject: Some code tweaks Correcting details that pop-up when testing the different platforms --- src/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Makefile') diff --git a/src/Makefile b/src/Makefile index 2433428f..2e263189 100644 --- a/src/Makefile +++ b/src/Makefile @@ -39,7 +39,7 @@ PLATFORM ?= PLATFORM_DESKTOP SHARED ?= NO # define NO to use OpenAL Soft as static library (or shared by default) -SHARED_OPENAL ?= NO +SHARED_OPENAL ?= YES # on PLATFORM_WEB force OpenAL Soft shared library ifeq ($(PLATFORM),PLATFORM_WEB) @@ -188,6 +188,11 @@ else # compile raylib static library for desktop platforms. ar rcs $(OUTPUT_PATH)/libraylib.a $(OBJS) @echo "libraylib.a generated (static library)!" + ifeq ($(SHARED_OPENAL),NO) + @echo "expected OpenAL Soft static library linking" + else + @echo "expected OpenAL Soft shared library linking" + endif endif endif -- cgit v1.2.3