Review Makefile config flags

Support external GLFW usage
Renamed some flags for consistency
This commit is contained in:
raysan5 2017-12-28 17:58:09 +01:00
parent 0bd06eec51
commit c93bca8c27
3 changed files with 32 additions and 18 deletions

View file

@ -33,6 +33,9 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
RAYLIB_PATH ?= /home/pi/raylib RAYLIB_PATH ?= /home/pi/raylib
endif endif
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll) # Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC RAYLIB_LIBTYPE ?= STATIC
@ -235,6 +238,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# On XWindow requires also below libraries # On XWindow requires also below libraries
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
endif endif
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
LDLIBS += -lglfw
endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
# Libraries for Raspberry Pi compiling # Libraries for Raspberry Pi compiling

View file

@ -52,21 +52,24 @@ RAYLIB_LIBTYPE ?= STATIC
# Included raylib audio module on compilation # Included raylib audio module on compilation
# NOTE: Some programs like tools could not require audio support # NOTE: Some programs like tools could not require audio support
INCLUDE_AUDIO_MODULE ?= YES INCLUDE_AUDIO_MODULE ?= TRUE
# Force OpenAL Soft backend for audio # Force OpenAL Soft backend for audio
FORCE_OPENAL_BACKEND ?= FALSE USE_OPENAL_BACKEND ?= FALSE
# Use external GLFW library instead of rglfw module
USE_EXTERNAL_GLFW ?= FALSE
# OpenAL Soft audio backend forced on HTML5 and OSX (see below) # OpenAL Soft audio backend forced on HTML5 and OSX (see below)
ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM),PLATFORM_WEB)
FORCE_OPENAL_BACKEND = TRUE USE_OPENAL_BACKEND = TRUE
endif endif
# Use cross-compiler for PLATFORM_RPI # Use cross-compiler for PLATFORM_RPI
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
RPI_CROSS_COMPILE ?= NO USE_RPI_CROSS_COMPILER ?= FALSE
ifeq ($(RPI_CROSS_COMPILE),YES) ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry RPI_TOOLCHAIN ?= C:/SysGCC/Raspberry
RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot RPI_TOOLCHAIN_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
endif endif
@ -107,7 +110,7 @@ endif
# NOTE 1: mini_al library does not support CoreAudio yet # NOTE 1: mini_al library does not support CoreAudio yet
# NOTE 2: Required OpenAL libraries should be available on OSX # NOTE 2: Required OpenAL libraries should be available on OSX
ifeq ($(PLATFORM_OS),OSX) ifeq ($(PLATFORM_OS),OSX)
FORCE_OPENAL_BACKEND = TRUE USE_OPENAL_BACKEND = TRUE
endif endif
ifeq ($(PLATFORM),PLATFORM_WEB) ifeq ($(PLATFORM),PLATFORM_WEB)
@ -201,7 +204,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif endif
endif endif
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES) ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler # Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc #CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
@ -226,7 +229,7 @@ endif
AR = ar AR = ar
ifeq ($(PLATFORM),PLATFORM_RPI) ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES) ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-archiver # Define RPI cross-archiver
#CC = armv6j-hardfloat-linux-gnueabi-gcc #CC = armv6j-hardfloat-linux-gnueabi-gcc
AR = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-ar AR = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-ar
@ -284,8 +287,8 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED)
CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED
endif endif
ifeq ($(FORCE_OPENAL_BACKEND),TRUE) ifeq ($(USE_OPENAL_BACKEND),TRUE)
CFLAGS += -DFORCE_OPENAL_BACKEND CFLAGS += -DUSE_OPENAL_BACKEND
endif endif
# Define include paths for required headers # Define include paths for required headers
@ -297,6 +300,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
INCLUDE_PATHS += -I/usr/local/include INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH) LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH)
endif endif
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
LDFLAGS += -lglfw
endif
endif endif
# Define additional directories containing required header files # Define additional directories containing required header files
@ -343,13 +349,15 @@ OBJS = core.o \
utils.o utils.o
ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
OBJS += rglfw.o OBJS += rglfw.o
endif endif
endif
ifeq ($(INCLUDE_AUDIO_MODULE),YES) ifeq ($(INCLUDE_AUDIO_MODULE),TRUE)
OBJS += audio.o OBJS += audio.o
OBJS += stb_vorbis.o OBJS += stb_vorbis.o
ifeq ($(FORCE_OPENAL_BACKEND),FALSE) ifeq ($(USE_OPENAL_BACKEND),FALSE)
OBJS += mini_al.o OBJS += mini_al.o
endif endif
endif endif

View file

@ -16,8 +16,8 @@
* Define to use the module as standalone library (independently of raylib). * Define to use the module as standalone library (independently of raylib).
* Required types and functions are defined in the same module. * Required types and functions are defined in the same module.
* *
* #define FORCE_OPENAL_BACKEND * #define USE_OPENAL_BACKEND
* Force OpenAL Soft audio backend usage * Use OpenAL Soft audio backend usage
* *
* #define SUPPORT_FILEFORMAT_WAV * #define SUPPORT_FILEFORMAT_WAV
* #define SUPPORT_FILEFORMAT_OGG * #define SUPPORT_FILEFORMAT_OGG
@ -80,7 +80,7 @@
#define SUPPORT_FILEFORMAT_MOD #define SUPPORT_FILEFORMAT_MOD
//------------------------------------------------- //-------------------------------------------------
#if !defined(FORCE_OPENAL_BACKEND) #if !defined(USE_OPENAL_BACKEND)
#define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL. #define USE_MINI_AL 1 // Set to 1 to use mini_al; 0 to use OpenAL.
#endif #endif