Browse Source

Review Makefile config flags

Support external GLFW usage
Renamed some flags for consistency
pull/432/head
raysan5 7 years ago
parent
commit
c93bca8c27
3 changed files with 32 additions and 18 deletions
  1. +6
    -0
      examples/Makefile
  2. +23
    -15
      src/Makefile
  3. +3
    -3
      src/audio.c

+ 6
- 0
examples/Makefile View File

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

+ 23
- 15
src/Makefile View File

@ -52,21 +52,24 @@ RAYLIB_LIBTYPE ?= STATIC
# Included raylib audio module on compilation
# 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_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)
ifeq ($(PLATFORM),PLATFORM_WEB)
FORCE_OPENAL_BACKEND = TRUE
USE_OPENAL_BACKEND = TRUE
endif
# Use cross-compiler for 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_SYSROOT ?= $(RPI_TOOLCHAIN)/arm-linux-gnueabihf/sysroot
endif
@ -107,7 +110,7 @@ endif
# NOTE 1: mini_al library does not support CoreAudio yet
# NOTE 2: Required OpenAL libraries should be available on OSX
ifeq ($(PLATFORM_OS),OSX)
FORCE_OPENAL_BACKEND = TRUE
USE_OPENAL_BACKEND = TRUE
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
@ -201,7 +204,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES)
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-compiler
#CC = armv6j-hardfloat-linux-gnueabi-gcc
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
@ -226,7 +229,7 @@ endif
AR = ar
ifeq ($(PLATFORM),PLATFORM_RPI)
ifeq ($(RPI_CROSS_COMPILE),YES)
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
# Define RPI cross-archiver
#CC = armv6j-hardfloat-linux-gnueabi-gcc
AR = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-ar
@ -284,8 +287,8 @@ ifeq ($(RAYLIB_LIBTYPE),SHARED)
CFLAGS += -fPIC -DBUILD_LIBTYPE_SHARED
endif
ifeq ($(FORCE_OPENAL_BACKEND),TRUE)
CFLAGS += -DFORCE_OPENAL_BACKEND
ifeq ($(USE_OPENAL_BACKEND),TRUE)
CFLAGS += -DUSE_OPENAL_BACKEND
endif
# Define include paths for required headers
@ -297,6 +300,9 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
INCLUDE_PATHS += -I/usr/local/include
LDFLAGS += -L. -Lsrc -L/usr/local/lib -L$(RAYLIB_RELEASE_PATH)
endif
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
LDFLAGS += -lglfw
endif
endif
# Define additional directories containing required header files
@ -343,15 +349,17 @@ OBJS = core.o \
utils.o
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
OBJS += rglfw.o
ifeq ($(USE_EXTERNAL_GLFW),FALSE)
OBJS += rglfw.o
endif
endif
ifeq ($(INCLUDE_AUDIO_MODULE),YES)
ifeq ($(INCLUDE_AUDIO_MODULE),TRUE)
OBJS += audio.o
OBJS += stb_vorbis.o
ifeq ($(FORCE_OPENAL_BACKEND),FALSE)
OBJS += mini_al.o
endif
ifeq ($(USE_OPENAL_BACKEND),FALSE)
OBJS += mini_al.o
endif
endif
# Default target entry

+ 3
- 3
src/audio.c View File

@ -16,8 +16,8 @@
* Define to use the module as standalone library (independently of raylib).
* Required types and functions are defined in the same module.
*
* #define FORCE_OPENAL_BACKEND
* Force OpenAL Soft audio backend usage
* #define USE_OPENAL_BACKEND
* Use OpenAL Soft audio backend usage
*
* #define SUPPORT_FILEFORMAT_WAV
* #define SUPPORT_FILEFORMAT_OGG
@ -80,7 +80,7 @@
#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.
#endif

Loading…
Cancel
Save