summaryrefslogtreecommitdiff
path: root/libs/raylib/src/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libs/raylib/src/Makefile')
-rw-r--r--libs/raylib/src/Makefile65
1 files changed, 33 insertions, 32 deletions
diff --git a/libs/raylib/src/Makefile b/libs/raylib/src/Makefile
index 4b32c4c..ede7c7f 100644
--- a/libs/raylib/src/Makefile
+++ b/libs/raylib/src/Makefile
@@ -42,8 +42,8 @@
.PHONY: all clean install uninstall
# Define required raylib variables
-RAYLIB_VERSION = 2.5.0
-RAYLIB_API_VERSION = 251
+RAYLIB_VERSION = 3.0.0
+RAYLIB_API_VERSION = 300
# See below for alternatives.
RAYLIB_PATH = ..
@@ -148,33 +148,28 @@ endif
ifeq ($(PLATFORM),PLATFORM_WEB)
# Emscripten required variables
EMSDK_PATH ?= C:/emsdk
- EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/fastcomp/emscripten
- CLANG_PATH = $(EMSDK_PATH)/fastcomp/bin
- PYTHON_PATH = $(EMSDK_PATH)/python/2.7.13.1_64bit/python-2.7.13.amd64
+ EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/upstream/emscripten
+ CLANG_PATH = $(EMSDK_PATH)/upstream/bin
+ PYTHON_PATH = $(EMSDK_PATH)/python/3.7.4_64bit
NODE_PATH = $(EMSDK_PATH)/node/12.9.1_64bit/bin
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Android architecture: ARM64
- # Starting at 2019 using ARM64 is mandatory for published apps
+ # Starting at 2019 using ARM64 is mandatory for published apps,
+ # and minimum required target API is Android 9 (API level 28)
ANDROID_ARCH ?= ARM
- ANDROID_API_VERSION = 26
+ ANDROID_API_VERSION = 28
# Android required path variables
- # NOTE: Android NDK is just required to generate the standalone toolchain,
- # in case is not already provided
+ # NOTE: Starting with Android NDK r21, no more toolchain generation is required, NDK is the toolchain on itself
ifeq ($(OS),Windows_NT)
- ANDROID_NDK = C:/android-ndk
+ ANDROID_NDK = C:/android-ndk-r21
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64
else
ANDROID_NDK = /usr/lib/android/ndk
- endif
-
- # Android standalone toolchain path
- ifeq ($(OS),Windows_NT)
- ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
- else
- ANDROID_TOOLCHAIN = /usr/lib/android/toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
+ ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/linux
endif
ifeq ($(ANDROID_ARCH),ARM)
@@ -219,7 +214,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID)
endif
# Define default C compiler and archiver to pack library
-CC ?= gcc
+CC = gcc
AR = ar
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
@@ -248,11 +243,11 @@ endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Android toolchain (must be provided for desired architecture and compiler)
ifeq ($(ANDROID_ARCH),ARM)
- CC = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-clang
+ CC = $(ANDROID_TOOLCHAIN)/bin/armv7a-linux-androideabi$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/arm-linux-androideabi-ar
endif
ifeq ($(ANDROID_ARCH),ARM64)
- CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-clang
+ CC = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android$(ANDROID_API_VERSION)-clang
AR = $(ANDROID_TOOLCHAIN)/bin/aarch64-linux-android-ar
endif
ifeq ($(ANDROID_ARCH),x86)
@@ -291,9 +286,20 @@ endif
ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += -g
+ ifeq ($(PLATFORM),PLATFORM_WEB)
+ CFLAGS += -s ASSERTIONS=1 --profiling
+ endif
endif
ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
- CFLAGS += -O1
+ ifeq ($(PLATFORM),PLATFORM_WEB)
+ CFLAGS += -Os
+ endif
+ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
+ CFLAGS += -s -O1
+ endif
+ ifeq ($(PLATFORM),PLATFORM_ANDROID)
+ CFLAGS += -O2
+ endif
endif
# Additional flags for compiler (if desired)
@@ -311,18 +317,12 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL!
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
# -s USE_PTHREADS=1 # multithreading support
- # -s WASM=0 # disable Web Assembly, emitted by default
- # -s EMTERPRETIFY=1 # enable emscripten code interpreter (very slow)
- # -s EMTERPRETIFY_ASYNC=1 # support synchronous loops by emterpreter
# -s FORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -s ASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# --profiling # include information for code profiling
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
# --preload-file resources # specify a resources folder for data compilation
CFLAGS += -s USE_GLFW=3
- ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
- CFLAGS += -s ASSERTIONS=1 --profiling
- endif
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
# Compiler flags for arquitecture
@@ -477,14 +477,14 @@ endif
raylib: $(OBJS)
ifeq ($(PLATFORM),PLATFORM_WEB)
# Compile raylib for web.
- emcc -O1 $(OBJS) -o $(RAYLIB_RELEASE_PATH)/libraylib.bc
+ $(CC) -O1 $(OBJS) -o $(RAYLIB_RELEASE_PATH)/libraylib.bc
@echo "raylib library generated (libraylib.bc)!"
else
ifeq ($(RAYLIB_LIBTYPE),SHARED)
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
# TODO: Compile resource file raylib.dll.rc for linkage on raylib.dll generation
- $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) -L$(RAYLIB_RELEASE_PATH) -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylibdll.a
+ $(CC) -shared -o $(RAYLIB_RELEASE_PATH)/raylib.dll $(OBJS) $(RAYLIB_RELEASE_PATH)/raylib.dll.rc.data -L$(RAYLIB_RELEASE_PATH) -static-libgcc -lopengl32 -lgdi32 -lwinmm -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/libraylib.dll.a
@echo "raylib dynamic library (raylib.dll) and import library (libraylibdll.a) generated!"
endif
ifeq ($(PLATFORM_OS),LINUX)
@@ -571,10 +571,11 @@ raudio.o : raudio.c raylib.h
# Compile raygui module
# NOTE: raygui header should be distributed with raylib.h
-raygui.o : raygui.c raygui.h
- @echo #define RAYGUI_IMPLEMENTATION > raygui.c
- @echo #include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h" > raygui.c
+raygui.o : raygui.c raygui.h gui_textbox_extended.h ricons.h
$(CC) -c $< $(CFLAGS) $(INCLUDE_PATHS) -D$(PLATFORM) -DRAYGUI_IMPLEMENTATION
+raygui.c:
+ echo '#define RAYGUI_IMPLEMENTATION' > raygui.c
+ echo '#include "$(RAYLIB_MODULE_RAYGUI_PATH)/raygui.h"' >> raygui.c
# Compile physac module
# NOTE: physac header should be distributed with raylib.h