mirror of
https://github.com/raysan5/raylib.git
synced 2026-11-25 09:01:47 -05:00
Compare commits
6 Commits
f5994221b4
...
4b0c5962dd
| Author | SHA1 | Date | |
|---|---|---|---|
| 4b0c5962dd | |||
| ed803c7995 | |||
| 623c95b575 | |||
| 8b5b90dbf7 | |||
| db88379da7 | |||
| a324241f3a |
86
src/Makefile
86
src/Makefile
@ -37,8 +37,8 @@
|
||||
# > PLATFORM_MEMORY
|
||||
# - Memory framebuffer output, using software renderer, no OS required
|
||||
#
|
||||
# Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline.
|
||||
# Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline.
|
||||
# Many thanks to Milan Nikolic (@gen2brain) for implementing Android platform pipeline
|
||||
# Many thanks to Emanuele Petriglia for his contribution on GNU/Linux pipeline
|
||||
#
|
||||
# Copyright (c) 2013-2026 Ramon Santamaria (@raysan5)
|
||||
#
|
||||
@ -118,12 +118,12 @@ RAYLIB_MODULE_RAYGUI_PATH ?= $(RAYLIB_SRC_PATH)/../../raygui/src
|
||||
USE_EXTERNAL_GLFW ?= FALSE
|
||||
|
||||
# Enable support for X11 by default on Linux when using GLFW
|
||||
# NOTE: Wayland is disabled by default, only enable if you are sure
|
||||
# NOTE: Wayland is disabled by default, enable if required
|
||||
GLFW_LINUX_ENABLE_WAYLAND ?= FALSE
|
||||
GLFW_LINUX_ENABLE_X11 ?= TRUE
|
||||
|
||||
# Enable support for X11 by default on Linux when using RGFW
|
||||
# NOTE: Wayland is disabled by default, only enable if you are sure
|
||||
# NOTE: Wayland is disabled by default, enable if required
|
||||
RGFW_LINUX_ENABLE_WAYLAND ?= FALSE
|
||||
RGFW_LINUX_ENABLE_X11 ?= TRUE
|
||||
|
||||
@ -137,11 +137,11 @@ SDL_LIBRARIES ?= -lSDL2 -lSDL2main
|
||||
# "whoami" prints the name of the user that calls him (so, if it is the root user, "whoami" prints "root")
|
||||
ROOT = $(shell whoami)
|
||||
|
||||
# By default we suppose we are working on Windows
|
||||
# WARNING: Default to Windows host and target
|
||||
HOST_PLATFORM_OS ?= WINDOWS
|
||||
PLATFORM_OS ?= WINDOWS
|
||||
|
||||
# Detect the shell used by make: cmd preserves quotes, while sh removes them.
|
||||
# Detect the shell used by make: cmd preserves quotes, while sh removes them
|
||||
ifndef PLATFORM_SHELL
|
||||
PLATFORM_SHELL = sh
|
||||
ifeq ($(shell echo "test"),"test")
|
||||
@ -198,16 +198,19 @@ endif
|
||||
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||
# Android architecture
|
||||
# Starting at 2019 using arm64 is mandatory for published apps,
|
||||
# Starting on August 2020, minimum required target API is Android 10 (API level 29)
|
||||
# NOTE: Starting at 2019 using arm64 is mandatory for published apps,
|
||||
# NOTE: Starting on August 2020, minimum required target API is Android 10 (API level 29)
|
||||
# NOTE: Android 13 (API level 33), released on August 2022 should be a safe bet
|
||||
ANDROID_ARCH ?= arm64
|
||||
ANDROID_API_VERSION ?= 29
|
||||
ANDROID_API_VERSION ?= 33
|
||||
|
||||
# Android required path variables
|
||||
# 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-r30
|
||||
ANDROID_TOOLCHAIN = $(ANDROID_NDK)/toolchains/llvm/prebuilt/windows-x86_64
|
||||
# NOTE: To run from a CMD shell, CC requires the .cmd extension on the call or it fails trying to find [bash]
|
||||
ANDROID_SHELL_CMD = .cmd
|
||||
else
|
||||
ANDROID_NDK ?= /usr/lib/android/ndk
|
||||
ifeq ($(PLATFORM_OS), OSX)
|
||||
@ -341,18 +344,18 @@ endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||
# Android toolchain (must be provided for desired architecture and compiler)
|
||||
ifeq ($(ANDROID_ARCH),arm)
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-androideabi$(ANDROID_API_VERSION)-clang
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-androideabi$(ANDROID_API_VERSION)-clang$(ANDROID_SHELL_CMD)
|
||||
endif
|
||||
ifeq ($(ANDROID_ARCH),arm64)
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang$(ANDROID_SHELL_CMD)
|
||||
endif
|
||||
ifeq ($(ANDROID_ARCH),x86)
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang$(ANDROID_SHELL_CMD)
|
||||
endif
|
||||
ifeq ($(ANDROID_ARCH),x86_64)
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang
|
||||
CC = $(ANDROID_TOOLCHAIN)/bin/$(ANDROID_COMPILER_ARCH)-linux-android$(ANDROID_API_VERSION)-clang$(ANDROID_SHELL_CMD)
|
||||
endif
|
||||
# It seems from Android NDK r22 onwards we need to use llvm-ar
|
||||
# NOTE: Since Android NDK r22 onwards, llvm-ar should be used
|
||||
AR = $(ANDROID_TOOLCHAIN)/bin/llvm-ar
|
||||
endif
|
||||
|
||||
@ -457,7 +460,9 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
|
||||
# -Werror=format-security
|
||||
CFLAGS += -Wa,--noexecstack -Wformat -no-canonical-prefixes
|
||||
# Preprocessor macro definitions
|
||||
CFLAGS += -D__ANDROID__ -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
|
||||
CFLAGS += -D__ANDROID__ -DPLATFORM_ANDROID
|
||||
# NOTE: API level is already implicit on compiler call, no need for redefinition
|
||||
#-D__ANDROID_API__=$(ANDROID_API_VERSION)
|
||||
endif
|
||||
|
||||
# Define required compilation flags for raylib SHARED lib
|
||||
@ -796,8 +801,8 @@ else
|
||||
@echo "raylib dynamic library ($(RAYLIB_LIB_NAME).dll) and import library (lib$(RAYLIB_LIB_NAME)dll.a) generated!"
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
# Compile raylib shared library version $(RAYLIB_VERSION).
|
||||
# WARNING: you should type "make clean" before doing this target
|
||||
# Compile raylib shared library version $(RAYLIB_VERSION)
|
||||
# WARNING: "make clean" should be called before running this target
|
||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||
@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
|
||||
cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
|
||||
@ -811,7 +816,7 @@ else
|
||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).dylib lib$(RAYLIB_LIB_NAME).dylib
|
||||
endif
|
||||
ifeq ($(PLATFORM_OS),BSD)
|
||||
# WARNING: you should type "gmake clean" before doing this target
|
||||
# WARNING: "gmake clean" should be called before running this target
|
||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||
@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so)!"
|
||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs lib$(RAYLIB_LIB_NAME).$(RAYLIB_VERSION).so lib$(RAYLIB_LIB_NAME).$(RAYLIB_API_VERSION).so
|
||||
@ -819,8 +824,8 @@ else
|
||||
endif
|
||||
endif
|
||||
ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
|
||||
# Compile raylib shared library version $(RAYLIB_VERSION).
|
||||
# WARNING: you should type "make clean" before doing this target
|
||||
# Compile raylib shared library version $(RAYLIB_VERSION)
|
||||
# WARNING: "make clean" should be called before running this target
|
||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||
@echo "raylib shared library generated (lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)) in $(RAYLIB_RELEASE_PATH)!"
|
||||
cd $(RAYLIB_RELEASE_PATH) && ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
|
||||
@ -837,7 +842,7 @@ else
|
||||
endif
|
||||
else
|
||||
# Compile raylib static library version $(RAYLIB_VERSION)
|
||||
# WARNING: You should type "make clean" before doing this target.
|
||||
# WARNING: "make clean" should be called before running this target
|
||||
$(AR) rcs $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(OBJS)
|
||||
@echo "raylib static library generated (lib$(RAYLIB_LIB_NAME).a) in $(RAYLIB_RELEASE_PATH)!"
|
||||
endif
|
||||
@ -904,44 +909,42 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Install generated and needed files to desired directories.
|
||||
# Install generated and needed files to desired directories
|
||||
# On GNU/Linux and BSDs, there are some standard directories that contain extra
|
||||
# libraries and header files. These directories (often /usr/local/lib and
|
||||
# /usr/local/include) are for libraries that are installed manually
|
||||
# (without a package manager). We'll use /usr/local/lib/raysan5 and /usr/local/include/raysan5
|
||||
# for our -L and -I specification to simplify management of the raylib source package.
|
||||
# Customize these locations if you like but don't forget to pass them to make
|
||||
# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig.
|
||||
# HINT: Add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles.
|
||||
# See below and ../examples/Makefile for more information.
|
||||
# for our -L and -I specification to simplify management of the raylib source package
|
||||
# Customize these locations if desired but don't forget to pass them to make
|
||||
# for compilation and enable runtime linking with -rpath, LD_LIBRARY_PATH, or ldconfig
|
||||
# HINT: Add -L$(RAYLIB_INSTALL_PATH) -I$(RAYLIB_H_INSTALL_PATH) to your own makefiles
|
||||
# See below and ../examples/Makefile for more information
|
||||
|
||||
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib. No relative paths.
|
||||
# RAYLIB_INSTALL_PATH should be the desired full path to libraylib, no relative paths
|
||||
DESTDIR ?= /usr/local
|
||||
RAYLIB_INSTALL_PATH ?= $(DESTDIR)/lib
|
||||
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files.
|
||||
# RAYLIB_H_INSTALL_PATH locates the installed raylib header and associated source files
|
||||
RAYLIB_H_INSTALL_PATH ?= $(DESTDIR)/include
|
||||
|
||||
install :
|
||||
ifeq ($(ROOT),root)
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
# Attention! You are root, writing files to $(RAYLIB_INSTALL_PATH)
|
||||
# and $(RAYLIB_H_INSTALL_PATH). Consult this Makefile for more information.
|
||||
# Prepare the environment as needed.
|
||||
# WARNING: root user, writing files to $(RAYLIB_INSTALL_PATH) and $(RAYLIB_H_INSTALL_PATH)
|
||||
mkdir --parents --verbose $(RAYLIB_INSTALL_PATH)
|
||||
mkdir --parents --verbose $(RAYLIB_H_INSTALL_PATH)
|
||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||
# Installing raylib to $(RAYLIB_INSTALL_PATH).
|
||||
# Installing raylib to $(RAYLIB_INSTALL_PATH)
|
||||
cp --update --verbose $(RAYLIB_RELEASE_PATH)/libraylib.so.$(RAYLIB_VERSION) $(RAYLIB_INSTALL_PATH)/lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION)
|
||||
cd $(RAYLIB_INSTALL_PATH); ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_VERSION) lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
|
||||
cd $(RAYLIB_INSTALL_PATH); ln -fsv lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) lib$(RAYLIB_LIB_NAME).so
|
||||
# Uncomment to update the runtime linker cache with RAYLIB_INSTALL_PATH.
|
||||
# Not necessary if later embedding RPATH in your executable. See examples/Makefile.
|
||||
# Uncomment to update the runtime linker cache with $(RAYLIB_INSTALL_PATH)
|
||||
# Not necessary if later embedding RPATH in your executable. See examples/Makefile
|
||||
ldconfig $(RAYLIB_INSTALL_PATH)
|
||||
else
|
||||
# Installing raylib to $(RAYLIB_INSTALL_PATH).
|
||||
# Installing raylib to $(RAYLIB_INSTALL_PATH)
|
||||
cp --update --verbose $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).a $(RAYLIB_INSTALL_PATH)/lib$(RAYLIB_LIB_NAME).a
|
||||
endif
|
||||
# Copying raylib development files to $(RAYLIB_H_INSTALL_PATH).
|
||||
# Copying raylib development files to $(RAYLIB_H_INSTALL_PATH)
|
||||
cp --update raylib.h $(RAYLIB_H_INSTALL_PATH)/raylib.h
|
||||
cp --update raymath.h $(RAYLIB_H_INSTALL_PATH)/raymath.h
|
||||
cp --update rcamera.h $(RAYLIB_H_INSTALL_PATH)/rcamera.h
|
||||
@ -955,17 +958,16 @@ else
|
||||
endif
|
||||
|
||||
# Remove raylib dev files installed on the system
|
||||
# NOTE: see 'install' target.
|
||||
# NOTE: Check 'install' target for details
|
||||
uninstall :
|
||||
ifeq ($(ROOT),root)
|
||||
# WARNING: You are root, about to delete items from $(RAYLIB_INSTALL_PATH).
|
||||
# and $(RAYLIB_H_INSTALL_PATH). Please confirm each item.
|
||||
# WARNING: root user, about to delete items from $(RAYLIB_INSTALL_PATH) and $(RAYLIB_H_INSTALL_PATH)
|
||||
ifeq ($(PLATFORM_OS),LINUX)
|
||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so
|
||||
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_API_VERSION)
|
||||
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.so.$(RAYLIB_VERSION)
|
||||
# Uncomment to clean up the runtime linker cache. See install target.
|
||||
# Uncomment to clean up the runtime linker cache, check install target
|
||||
ldconfig
|
||||
else
|
||||
rm --force --interactive --verbose $(RAYLIB_INSTALL_PATH)/libraylib.a
|
||||
|
||||
2
src/external/m3d.h
vendored
2
src/external/m3d.h
vendored
@ -2417,7 +2417,7 @@ m3d_t *m3d_load(unsigned char *data, m3dread_t readfilecb, m3dfree_t freecb, m3d
|
||||
char *name, *lang;
|
||||
float f;
|
||||
m3d_t *model;
|
||||
M3D_INDEX mi;
|
||||
M3D_INDEX mi = { 0 };
|
||||
#ifdef M3D_VERTEXMAX
|
||||
M3D_INDEX pi;
|
||||
#endif
|
||||
|
||||
@ -3202,7 +3202,7 @@ unsigned char *DecodeDataBase64(const char *text, int *outputSize)
|
||||
while ((ending >= 0) && (text[ending] == '=')) { padding++; ending--; }
|
||||
int estimatedOutputSize = 3*(dataSize/4) - padding;
|
||||
if (estimatedOutputSize < 0) estimatedOutputSize = 0; // Invalid input, i.e. "QQ=" or "===="
|
||||
int maxOutputSize = 3*(dataSize/4);
|
||||
unsigned int maxOutputSize = 3*(dataSize/4);
|
||||
|
||||
// Load some memory to store decoded data
|
||||
// NOTE: Allocated enough size to include padding
|
||||
|
||||
Reference in New Issue
Block a user