From 127cc1c79ee93f957907f7824eee75ac00dde095 Mon Sep 17 00:00:00 2001 From: Ray Date: Wed, 29 Oct 2025 22:45:37 +0100 Subject: [PATCH] REVIEWED: Makefile to support software renderer --- examples/Makefile | 14 +++++++++++++- src/Makefile | 13 +++++++++---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index c8500b665..b5e968079 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -486,7 +486,19 @@ endif ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) # Libraries for DRM compiling # NOTE: Required packages: libasound2-dev (ALSA) - LDLIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lgbm -ldrm -ldl -latomic + LDLIBS = -lraylib -lGLESv2 -lEGL -ldrm -lgbm -lpthread -lrt -lm -ldl -latomic + # TODO: Examples compilation does not define GRAPHICS, is it required? + #ifeq ($(GRAPHICS),GRAPHICS_API_OPENGL_ES2) + # LDLIBS += -lGLESv2 -lEGL + #endif +endif +ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32) + # Libraries for Windows desktop compilation + LDFLAGS += -L..\src + LDLIBS = -lraylib -lgdi32 -lwinmm -lshcore + ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE) + LDLIBS += -lopengl32 + endif endif ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # Libraries for web (HTML5) compiling diff --git a/src/Makefile b/src/Makefile index 0895d8f95..41867da1c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -228,7 +228,6 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) ifeq ($(ANDROID_ARCH),x86_64) ANDROID_COMPILER_ARCH = x86_64 endif - endif # Define raylib graphics api depending on selected platform @@ -261,8 +260,8 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32) #GRAPHICS = GRAPHICS_API_OPENGL_ES2 # Uncomment to use OpenGL ES 2.0 (ANGLE) endif ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) - # On DRM OpenGL ES 2.0 must be used GRAPHICS ?= GRAPHICS_API_OPENGL_ES2 + #GRAPHICS = GRAPHICS_API_OPENGL_11_SOFTWARE # Uncomment to use software rendering endif ifeq ($(TARGET_PLATFORM),$(filter $(TARGET_PLATFORM),PLATFORM_WEB PLATFORM_WEB_RGFW)) # On HTML5 OpenGL ES 2.0 is used, emscripten translates it to WebGL 1.0 @@ -636,13 +635,19 @@ ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_RGFW) endif endif ifeq ($(TARGET_PLATFORM),PLATFORM_DRM) - LDLIBS = -lGLESv2 -lEGL -ldrm -lgbm -lpthread -lrt -lm -ldl + LDLIBS = -ldrm -lgbm -lpthread -lrt -lm -ldl + ifeq ($(GRAPHICS),GRAPHICS_API_OPENGL_ES2) + LDLIBS += -lGLESv2 -lEGL + endif ifeq ($(RAYLIB_MODULE_AUDIO),TRUE) LDLIBS += -latomic endif endif ifeq ($(TARGET_PLATFORM),PLATFORM_DESKTOP_WIN32) - LDLIBS = -lgdi32 -lwinmm -lopengl32 -lshcore + LDLIBS = -lgdi32 -lwinmm -lshcore + ifneq ($(GRAPHICS),GRAPHICS_API_OPENGL_11_SOFTWARE) + LDLIBS += -lopengl32 + endif endif ifeq ($(TARGET_PLATFORM),PLATFORM_ANDROID) LDLIBS = -llog -landroid -lEGL -lGLESv2 -lOpenSLES -lc -lm