Review Makefiles for web compilation
This commit is contained in:
parent
1eae4b483b
commit
20e446cc7d
4 changed files with 85 additions and 60 deletions
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
@ -164,7 +164,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# HTML5 emscripten compiler
|
# HTML5 emscripten compiler
|
||||||
# WARNING: To compile to HTML5, code must be redesigned
|
# WARNING: To compile to HTML5, code must be redesigned
|
||||||
# to use emscripten.h and emscripten_set_main_loop()
|
# to use emscripten.h and emscripten_set_main_loop()
|
||||||
CC = emcc
|
CC = emcc
|
||||||
endif
|
endif
|
||||||
|
@ -195,7 +195,11 @@ ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
CFLAGS += -s -O1
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -Os
|
||||||
|
else
|
||||||
|
CFLAGS += -s -O1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
@ -115,13 +115,12 @@ endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_VERSION ?= 1.38.31
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/fastcomp/emscripten
|
||||||
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
|
CLANG_PATH = $(EMSDK_PATH)/fastcomp/bin
|
||||||
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
|
PYTHON_PATH = $(EMSDK_PATH)/python/2.7.13.1_64bit/python-2.7.13.amd64
|
||||||
NODE_VERSION = 8.9.1_64bit
|
NODE_PATH = $(EMSDK_PATH)/node/12.9.1_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define raylib release directory for compiled library.
|
# Define raylib release directory for compiled library.
|
||||||
|
@ -188,10 +187,19 @@ endif
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -Os
|
||||||
|
else
|
||||||
|
CFLAGS += -s -O1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
@ -200,7 +208,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# resource file contains windows executable icon and properties
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows
|
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
@ -230,10 +238,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# --profiling # include information for code profiling
|
# --profiling # include information for code profiling
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
||||||
ifeq ($(BUILD_MODE), DEBUG)
|
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
||||||
|
@ -290,18 +295,18 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# NOTE: WinMM library required to set high-res timer resolution
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
# Required for physac examples
|
# Required for physac examples
|
||||||
#LDLIBS += -static -lpthread
|
LDLIBS += -static -lpthread
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
# NOTE: Required packages: libegl1-mesa-dev
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
||||||
|
|
||||||
# On X11 requires also below libraries
|
# On X11 requires also below libraries
|
||||||
LDLIBS += -lX11
|
LDLIBS += -lX11
|
||||||
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
||||||
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
|
|
||||||
# On Wayland windowing system, additional libraries requires
|
# On Wayland windowing system, additional libraries requires
|
||||||
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
||||||
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
||||||
|
@ -314,7 +319,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
|
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
||||||
|
@ -381,7 +386,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
del *.o *.exe /s
|
del *.o *.exe /s
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable|x-pie-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
find . -type f -perm +ugo+x -delete
|
find . -type f -perm +ugo+x -delete
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
@ -115,13 +115,12 @@ endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_VERSION ?= 1.38.31
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/fastcomp/emscripten
|
||||||
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
|
CLANG_PATH = $(EMSDK_PATH)/fastcomp/bin
|
||||||
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
|
PYTHON_PATH = $(EMSDK_PATH)/python/2.7.13.1_64bit/python-2.7.13.amd64
|
||||||
NODE_VERSION = 8.9.1_64bit
|
NODE_PATH = $(EMSDK_PATH)/node/12.9.1_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define raylib release directory for compiled library.
|
# Define raylib release directory for compiled library.
|
||||||
|
@ -188,10 +187,19 @@ endif
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -Os
|
||||||
|
else
|
||||||
|
CFLAGS += -s -O1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
@ -200,7 +208,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# resource file contains windows executable icon and properties
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows
|
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
@ -230,10 +238,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# --profiling # include information for code profiling
|
# --profiling # include information for code profiling
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1
|
||||||
ifeq ($(BUILD_MODE), DEBUG)
|
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
||||||
|
@ -290,18 +295,18 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# NOTE: WinMM library required to set high-res timer resolution
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
# Required for physac examples
|
# Required for physac examples
|
||||||
#LDLIBS += -static -lpthread
|
LDLIBS += -static -lpthread
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
# NOTE: Required packages: libegl1-mesa-dev
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
||||||
|
|
||||||
# On X11 requires also below libraries
|
# On X11 requires also below libraries
|
||||||
LDLIBS += -lX11
|
LDLIBS += -lX11
|
||||||
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
||||||
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
|
|
||||||
# On Wayland windowing system, additional libraries requires
|
# On Wayland windowing system, additional libraries requires
|
||||||
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
||||||
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
||||||
|
@ -314,7 +319,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
|
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
||||||
|
@ -375,7 +380,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
del *.o *.exe /s
|
del *.o *.exe /s
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable|x-pie-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
find . -type f -perm +ugo+x -delete
|
find . -type f -perm +ugo+x -delete
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#
|
#
|
||||||
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
# raylib makefile for Desktop platforms, Raspberry Pi, Android and HTML5
|
||||||
#
|
#
|
||||||
# Copyright (c) 2013-2019 Ramon Santamaria (@raysan5)
|
# Copyright (c) 2013-2020 Ramon Santamaria (@raysan5)
|
||||||
#
|
#
|
||||||
# This software is provided "as-is", without any express or implied warranty. In no event
|
# This software is provided "as-is", without any express or implied warranty. In no event
|
||||||
# will the authors be held liable for any damages arising from the use of this software.
|
# will the authors be held liable for any damages arising from the use of this software.
|
||||||
|
@ -106,16 +106,21 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
RAYLIB_PATH = $(realpath $(RAYLIB_PREFIX))
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
# Default path for raylib on Raspberry Pi, if installed in different path, update it!
|
||||||
|
# This is not currently used by src/Makefile. Not sure of its origin or usage. Refer to wiki.
|
||||||
|
# TODO: update install: target in src/Makefile for RPI, consider relation to LINUX.
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
|
RAYLIB_PATH ?= /home/pi/raylib
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH ?= C:/emsdk
|
EMSDK_PATH ?= C:/emsdk
|
||||||
EMSCRIPTEN_VERSION ?= 1.38.31
|
EMSCRIPTEN_PATH ?= $(EMSDK_PATH)/fastcomp/emscripten
|
||||||
CLANG_VERSION = e$(EMSCRIPTEN_VERSION)_64bit
|
CLANG_PATH = $(EMSDK_PATH)/fastcomp/bin
|
||||||
PYTHON_VERSION = 2.7.13.1_64bit\python-2.7.13.amd64
|
PYTHON_PATH = $(EMSDK_PATH)/python/2.7.13.1_64bit/python-2.7.13.amd64
|
||||||
NODE_VERSION = 8.9.1_64bit
|
NODE_PATH = $(EMSDK_PATH)/node/12.9.1_64bit/bin
|
||||||
export PATH = $(EMSDK_PATH);$(EMSDK_PATH)\clang\$(CLANG_VERSION);$(EMSDK_PATH)\node\$(NODE_VERSION)\bin;$(EMSDK_PATH)\python\$(PYTHON_VERSION);$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION);C:\raylib\MinGW\bin:$$(PATH)
|
export PATH = $(EMSDK_PATH);$(EMSCRIPTEN_PATH);$(CLANG_PATH);$(NODE_PATH);$(PYTHON_PATH);C:\raylib\MinGW\bin:$$(PATH)
|
||||||
EMSCRIPTEN = $(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define raylib release directory for compiled library.
|
# Define raylib release directory for compiled library.
|
||||||
|
@ -182,10 +187,19 @@ endif
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
# -Wno-missing-braces ignore invalid warning (GCC bug 53119)
|
||||||
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -O1 -s -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
CFLAGS += -Wall -std=c99 -D_DEFAULT_SOURCE -Wno-missing-braces
|
||||||
|
|
||||||
ifeq ($(BUILD_MODE),DEBUG)
|
ifeq ($(BUILD_MODE),DEBUG)
|
||||||
CFLAGS += -g
|
CFLAGS += -g
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -s ASSERTIONS=1 --profiling
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
CFLAGS += -Os
|
||||||
|
else
|
||||||
|
CFLAGS += -s -O1
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
@ -194,7 +208,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
# resource file contains windows executable icon and properties
|
# resource file contains windows executable icon and properties
|
||||||
# -Wl,--subsystem,windows hides the console window
|
# -Wl,--subsystem,windows hides the console window
|
||||||
CFLAGS += $(RAYLIB_PATH)/raylib.rc.data -Wl,--subsystem,windows
|
CFLAGS += $(RAYLIB_PATH)/src/raylib.rc.data -Wl,--subsystem,windows
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
ifeq ($(RAYLIB_LIBTYPE),STATIC)
|
||||||
|
@ -224,10 +238,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# --profiling # include information for code profiling
|
# --profiling # include information for code profiling
|
||||||
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
# --memory-init-file 0 # to avoid an external memory initialization code file (.mem)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -Os -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s TOTAL_MEMORY=16777216 -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1
|
||||||
ifeq ($(BUILD_MODE), DEBUG)
|
|
||||||
CFLAGS += -s ASSERTIONS=1 --profiling
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)/src/shell.html
|
||||||
|
@ -284,18 +295,18 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# NOTE: WinMM library required to set high-res timer resolution
|
# NOTE: WinMM library required to set high-res timer resolution
|
||||||
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
LDLIBS = -lraylib -lopengl32 -lgdi32 -lwinmm
|
||||||
# Required for physac examples
|
# Required for physac examples
|
||||||
#LDLIBS += -static -lpthread
|
LDLIBS += -static -lpthread
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Libraries for Debian GNU/Linux desktop compiling
|
# Libraries for Debian GNU/Linux desktop compiling
|
||||||
# NOTE: Required packages: libegl1-mesa-dev
|
# NOTE: Required packages: libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
LDLIBS = -lraylib -lGL -lm -lpthread -ldl -lrt
|
||||||
|
|
||||||
# On X11 requires also below libraries
|
# On X11 requires also below libraries
|
||||||
LDLIBS += -lX11
|
LDLIBS += -lX11
|
||||||
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
# NOTE: It seems additional libraries are not required any more, latest GLFW just dlopen them
|
||||||
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
#LDLIBS += -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
|
|
||||||
# On Wayland windowing system, additional libraries requires
|
# On Wayland windowing system, additional libraries requires
|
||||||
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
ifeq ($(USE_WAYLAND_DISPLAY),TRUE)
|
||||||
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
LDLIBS += -lwayland-client -lwayland-cursor -lwayland-egl -lxkbcommon
|
||||||
|
@ -308,7 +319,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
# Libraries for OSX 10.9 desktop compiling
|
# Libraries for OSX 10.9 desktop compiling
|
||||||
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
# NOTE: Required packages: libopenal-dev libegl1-mesa-dev
|
||||||
LDLIBS = -lraylib -framework OpenGL -framework OpenAL -framework Cocoa
|
LDLIBS = -lraylib -framework OpenGL -framework Cocoa -framework IOKit -framework CoreAudio -framework CoreVideo
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),BSD)
|
ifeq ($(PLATFORM_OS),BSD)
|
||||||
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
# Libraries for FreeBSD, OpenBSD, NetBSD, DragonFly desktop compiling
|
||||||
|
@ -375,7 +386,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
del *.o *.exe /s
|
del *.o *.exe /s
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable|x-pie-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -fv
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
find . -type f -perm +ugo+x -delete
|
find . -type f -perm +ugo+x -delete
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue