diff options
| author | Ray <[email protected]> | 2016-11-24 17:26:07 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2016-11-24 17:26:07 +0100 |
| commit | 17f09cb03484a408cdd50a3d2e4d6604bb1f4c70 (patch) | |
| tree | 51e909c419de9625f1beaaca44696857a600e8d5 /src/Makefile | |
| parent | 05f68c22d5c8d8f7c4254ae47700318e21709887 (diff) | |
| parent | a81dfabf863c512044b246e23aaf43489d2fa1ac (diff) | |
| download | raylib-1.6.0.tar.gz raylib-1.6.0.zip | |
Merge pull request #198 from raysan5/develop1.6.0
Develop branch integration
Diffstat (limited to 'src/Makefile')
| -rw-r--r-- | src/Makefile | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile index ee3f0c12..2e263189 100644 --- a/src/Makefile +++ b/src/Makefile @@ -38,6 +38,14 @@ 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 ?= YES + +# 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"). @@ -99,11 +107,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,12 +182,17 @@ 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. 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 @@ -202,7 +224,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 |
