Update Makefile

This commit is contained in:
Ray
2026-04-12 11:07:19 +02:00
parent a5427bc38f
commit 51d693607e

View File

@ -286,7 +286,7 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
endif endif
ifeq ($(TARGET_PLATFORM),PLATFORM_MEMORY) ifeq ($(TARGET_PLATFORM),PLATFORM_MEMORY)
# By default use OpenGL Software # By default use OpenGL Software
GRAPHICS ?= GRAPHICS_API_OPENGL_SOFTWARE GRAPHICS = GRAPHICS_API_OPENGL_SOFTWARE
endif endif
# Define default C compiler and archiver to pack library: CC, AR # Define default C compiler and archiver to pack library: CC, AR
@ -324,7 +324,12 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DRM)
AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar AR = $(RPI_TOOLCHAIN)/bin/$(RPI_TOOLCHAIN_NAME)-ar
endif endif
endif endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# HTML5 emscripten compiler
CC = emcc
AR = emar
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
# HTML5 emscripten compiler # HTML5 emscripten compiler
CC = emcc CC = emcc
AR = emar AR = emar
@ -368,7 +373,6 @@ ifneq ($(RAYLIB_CONFIG_FLAGS), NONE)
endif endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# NOTE: When using multi-threading in the user code, it requires -pthread enabled
CFLAGS += -std=gnu99 CFLAGS += -std=gnu99
else else
CFLAGS += -std=c99 CFLAGS += -std=c99
@ -387,12 +391,15 @@ ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
endif endif
ifeq ($(RAYLIB_BUILD_MODE),RELEASE) ifeq ($(RAYLIB_BUILD_MODE),RELEASE)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CFLAGS += -O1 CFLAGS += -O1
endif endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
CFLAGS += -Os
endif
ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID)
CFLAGS += -O2 CFLAGS += -O2
endif endif
@ -406,23 +413,12 @@ endif
ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW) ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_GLFW)
CFLAGS += -Werror=implicit-function-declaration CFLAGS += -Werror=implicit-function-declaration
endif endif
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(TARGET_PLATFORM),PLATFORM_WEB)
# -Os # size optimization ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
# -O2 # optimization level 2, if used, also set --memory-init-file 0 CFLAGS += --profiling
# -sUSE_GLFW=3 # Use glfw3 library (context/input management) endif
# -sALLOW_MEMORY_GROWTH=1 # to allow memory resizing -> WARNING: Audio buffers could FAIL! endif
# -sTOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB) (67108864 = 64MB) ifeq ($(TARGET_PLATFORM),PLATFORM_WEB_RGFW)
# -sUSE_PTHREADS=1 # multithreading support
# -sWASM=0 # disable Web Assembly, emitted by default
# -sASYNCIFY # lets synchronous C/C++ code interact with asynchronous JS
# -sFORCE_FILESYSTEM=1 # force filesystem to load/save files data
# -sASSERTIONS=1 # enable runtime checks for common memory allocation errors (-O1 and above turn it off)
# -sMINIFY_HTML=0 # minify generated html from shell.html
# --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
# --source-map-base # allow debugging in browser with source map
# --shell-file shell.html # define a custom shell .html and output extension
ifeq ($(RAYLIB_BUILD_MODE),DEBUG) ifeq ($(RAYLIB_BUILD_MODE),DEBUG)
CFLAGS += --profiling CFLAGS += --profiling
endif endif
@ -772,7 +768,6 @@ all: raylib
raylib: $(OBJS) raylib: $(OBJS)
ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW))
# Compile raylib libray for web # Compile raylib libray for web
#$(CC) $(OBJS) -r -o $(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME).bc
ifeq ($(RAYLIB_LIBTYPE),SHARED) ifeq ($(RAYLIB_LIBTYPE),SHARED)
@echo "WARNING: $(TARGET_PLATFORM) does not support SHARED libraries. Generating STATIC library." @echo "WARNING: $(TARGET_PLATFORM) does not support SHARED libraries. Generating STATIC library."
endif endif