Reviewed Makefiles...
- Renamed VERSION to RAYLIB_VERSION - Renamed API_VERSION to RAYLIB_API_VERSION - Renamed RAYLIB_RELEASE to RAYLIB_RELEASE_PATH - Support Web Assembly compilation on PLATFORM_WEB
This commit is contained in:
parent
493a67e6d5
commit
f2a675ae53
5 changed files with 118 additions and 134 deletions
|
@ -49,24 +49,20 @@ USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PLATFORM_OS=WINDOWS
|
PLATFORM_OS=WINDOWS
|
||||||
LIBPATH=win32
|
|
||||||
else
|
else
|
||||||
UNAMEOS=$(shell uname)
|
UNAMEOS=$(shell uname)
|
||||||
ifeq ($(UNAMEOS),Linux)
|
ifeq ($(UNAMEOS),Linux)
|
||||||
PLATFORM_OS=LINUX
|
PLATFORM_OS=LINUX
|
||||||
LIBPATH=linux
|
|
||||||
endif
|
endif
|
||||||
UNAMEOS=$(shell uname)
|
|
||||||
ifeq ($(UNAMEOS),FreeBSD)
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
PLATFORM_OS=FREEBSD
|
PLATFORM_OS=FREEBSD
|
||||||
LIBPATH=freebsd
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAMEOS),Darwin)
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
PLATFORM_OS=OSX
|
PLATFORM_OS=OSX
|
||||||
LIBPATH=osx
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -77,11 +73,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI cross-compiler
|
|
||||||
RPI_CROSS_COMPILE ?= NO
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH = C:/emsdk
|
EMSDK_PATH = C:/emsdk
|
||||||
|
@ -93,29 +84,32 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
|
||||||
|
|
||||||
# Define raylib release directory for compiled library
|
# Define raylib release directory for compiled library
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/freebsd
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
# Define default C compiler: gcc
|
||||||
|
# NOTE: define g++ compiler if using C++
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
@ -129,9 +123,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
ifeq ($(RPI_CROSS_COMPILE),YES)
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
# RPI cross-compiler
|
# Define RPI cross-compiler
|
||||||
CC = armv6j-hardfloat-linux-gnueabi-gcc
|
#CC = armv6j-hardfloat-linux-gnueabi-gcc
|
||||||
|
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
@ -181,8 +176,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
||||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
# -s USE_PTHREADS=1 # multithreading support
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
|
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
||||||
|
@ -202,7 +198,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs
|
# Define library paths containing required libs
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
|
@ -254,6 +250,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
LDLIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
|
||||||
endif
|
endif
|
||||||
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
|
ifeq ($(USE_EXTERNAL_GLFW),TRUE)
|
||||||
|
# NOTE: It could require additional packages installed: libglfw3-dev
|
||||||
LDLIBS += -lglfw
|
LDLIBS += -lglfw
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -264,7 +261,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE)/libraylib.bc
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all object files required
|
# Define all object files required
|
||||||
|
|
67
src/Makefile
67
src/Makefile
|
@ -36,19 +36,18 @@
|
||||||
#
|
#
|
||||||
#******************************************************************************
|
#******************************************************************************
|
||||||
|
|
||||||
# Please read the wiki to know how to compile raylib, because there are
|
# Please read the wiki to know how to compile raylib, because there are different methods.
|
||||||
# different methods.
|
# https://github.com/raysan5/raylib/wiki
|
||||||
|
|
||||||
.PHONY: all clean install uninstall
|
.PHONY: all clean install uninstall
|
||||||
|
|
||||||
# Define required raylib variables
|
# Define required raylib variables
|
||||||
VERSION = 1.9.2
|
PLATFORM ?= PLATFORM_DESKTOP
|
||||||
API_VERSION = 1
|
RAYLIB_PATH = ..
|
||||||
PLATFORM ?= PLATFORM_DESKTOP
|
RAYLIB_VERSION = 1.9.2
|
||||||
RAYLIB_PATH = ..
|
RAYLIB_API_VERSION = 1
|
||||||
|
|
||||||
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
|
||||||
RAYLIB_LIBTYPE ?= STATIC
|
RAYLIB_LIBTYPE ?= STATIC
|
||||||
|
|
||||||
# Included raylib audio module on compilation
|
# Included raylib audio module on compilation
|
||||||
# NOTE: Some programs like tools could not require audio support
|
# NOTE: Some programs like tools could not require audio support
|
||||||
|
@ -120,8 +119,8 @@ 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.37.21
|
EMSCRIPTEN_VERSION = 1.37.28
|
||||||
CLANG_VERSION=e1.37.21_64bit
|
CLANG_VERSION=e1.37.28_64bit
|
||||||
PYTHON_VERSION=2.7.5.3_64bit
|
PYTHON_VERSION=2.7.5.3_64bit
|
||||||
NODE_VERSION=4.1.1_64bit
|
NODE_VERSION=4.1.1_64bit
|
||||||
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);$(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)
|
||||||
|
@ -192,7 +191,7 @@ ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
GRAPHICS = GRAPHICS_API_OPENGL_ES2
|
GRAPHICS = GRAPHICS_API_OPENGL_ES2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Default C compiler: gcc
|
# Define default C compiler: gcc
|
||||||
# NOTE: define g++ compiler if using C++
|
# NOTE: define g++ compiler if using C++
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
|
@ -259,7 +258,7 @@ endif
|
||||||
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
# -std=gnu99 defines C language mode (GNU C from 1999 revision)
|
||||||
# -fgnu89-inline declaring inline functions support (GCC optimized)
|
# -fgnu89-inline declaring inline functions support (GCC optimized)
|
||||||
# -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
|
# -D_DEFAULT_SOURCE use with -std=c99 on Linux and PLATFORM_WEB, required for timespec
|
||||||
CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces
|
CFLAGS += -O1 -Wall -std=c99 -D_DEFAULT_SOURCE -fgnu89-inline -Wno-missing-braces
|
||||||
|
|
||||||
# Additional flags for compiler (if desired)
|
# Additional flags for compiler (if desired)
|
||||||
|
@ -406,30 +405,30 @@ else
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
# Compile raylib to shared library version for GNU/Linux.
|
# Compile raylib to shared library version for GNU/Linux.
|
||||||
# WARNING: you should type "make clean" before doing this target
|
# WARNING: you should type "make clean" before doing this target
|
||||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lm -lpthread -ldl -lrt
|
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lm -lpthread -ldl -lrt
|
||||||
@echo "raylib shared library generated (libraylib.$(VERSION).so)!"
|
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
$(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib $(OBJS) -compatibility_version $(API_VERSION) -current_version $(VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa
|
$(CC) -dynamiclib -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib $(OBJS) -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION) -framework OpenGL -framework OpenAL -framework IOKit -framework CoreVideo -framework Cocoa
|
||||||
install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).dylib
|
install_name_tool -id "libraylib.$(VERSION).dylib" $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).dylib
|
||||||
@echo "raylib shared library generated (libraylib.$(VERSION).dylib)!"
|
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).dylib)!"
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.$(API_VERSION).dylib
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.$(RAYLIB_API_VERSION).dylib
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).dylib libraylib.dylib
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).dylib libraylib.dylib
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
# WARNING: you should type "gmake clean" before doing this target
|
# WARNING: you should type "gmake clean" before doing this target
|
||||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) -Wl,-soname,libraylib.$(API_VERSION).so -lGL -lpthread
|
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) -Wl,-soname,libraylib.$(RAYLIB_API_VERSION).so -lGL -lpthread
|
||||||
@echo "raylib shared library generated (libraylib.$(VERSION).so)!"
|
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
|
$(CC) -shared -o $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so $(OBJS) $(LDFLAGS) $(LDLIBS)
|
||||||
@echo "raylib shared library generated (libraylib.$(VERSION).so)!"
|
@echo "raylib shared library generated (libraylib.$(RAYLIB_VERSION).so)!"
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.$(API_VERSION).so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.$(RAYLIB_API_VERSION).so
|
||||||
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(VERSION).so libraylib.so
|
cd $(RAYLIB_RELEASE_PATH) && ln -fs libraylib.$(RAYLIB_VERSION).so libraylib.so
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
# Compile raylib static library
|
# Compile raylib static library
|
||||||
|
@ -495,8 +494,8 @@ ifeq ($(ROOT),root)
|
||||||
# /usr/local/include/) are for libraries that are installed
|
# /usr/local/include/) are for libraries that are installed
|
||||||
# manually (without a package manager).
|
# manually (without a package manager).
|
||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so /usr/local/lib/libraylib.$(VERSION).so
|
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_VERSION).so
|
||||||
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so /usr/local/lib/libraylib.$(API_VERSION).so
|
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so
|
||||||
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.so /usr/local/lib/libraylib.so
|
cp --update $(RAYLIB_RELEASE_PATH)/libraylib.so /usr/local/lib/libraylib.so
|
||||||
else
|
else
|
||||||
cp --update raylib.h /usr/local/include/raylib.h
|
cp --update raylib.h /usr/local/include/raylib.h
|
||||||
|
@ -518,8 +517,8 @@ ifeq ($(ROOT),root)
|
||||||
rm --force /usr/local/include/raylib.h
|
rm --force /usr/local/include/raylib.h
|
||||||
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
ifeq ($(RAYLIB_LIBTYPE),SHARED)
|
||||||
rm --force /usr/local/lib/libraylib.so
|
rm --force /usr/local/lib/libraylib.so
|
||||||
rm --force /usr/local/lib/libraylib.$(API_VERSION).so
|
rm --force /usr/local/lib/libraylib.$(RAYLIB_API_VERSION).so
|
||||||
rm --force /usr/local/lib/libraylib.$(VERSION).so
|
rm --force /usr/local/lib/libraylib.$(RAYLIB_VERSION).so
|
||||||
else
|
else
|
||||||
rm --force /usr/local/lib/libraylib.a
|
rm --force /usr/local/lib/libraylib.a
|
||||||
endif
|
endif
|
||||||
|
@ -536,7 +535,7 @@ clean:
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o
|
del *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so external/stb_vorbis.o
|
||||||
else
|
else
|
||||||
rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(VERSION).so external/stb_vorbis.o
|
rm -f *.o $(RAYLIB_RELEASE_PATH)/libraylib.a $(RAYLIB_RELEASE_PATH)/libraylib.bc $(RAYLIB_RELEASE_PATH)/libraylib.so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_API_VERSION).so $(RAYLIB_RELEASE_PATH)/libraylib.$(RAYLIB_VERSION).so external/stb_vorbis.o
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
ifeq ($(PLATFORM),PLATFORM_ANDROID)
|
||||||
rm -rf $(ANDROID_TOOLCHAIN)
|
rm -rf $(ANDROID_TOOLCHAIN)
|
||||||
|
|
|
@ -49,24 +49,20 @@ USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PLATFORM_OS=WINDOWS
|
PLATFORM_OS=WINDOWS
|
||||||
LIBPATH=win32
|
|
||||||
else
|
else
|
||||||
UNAMEOS=$(shell uname)
|
UNAMEOS=$(shell uname)
|
||||||
ifeq ($(UNAMEOS),Linux)
|
ifeq ($(UNAMEOS),Linux)
|
||||||
PLATFORM_OS=LINUX
|
PLATFORM_OS=LINUX
|
||||||
LIBPATH=linux
|
|
||||||
endif
|
endif
|
||||||
UNAMEOS=$(shell uname)
|
|
||||||
ifeq ($(UNAMEOS),FreeBSD)
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
PLATFORM_OS=FREEBSD
|
PLATFORM_OS=FREEBSD
|
||||||
LIBPATH=freebsd
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAMEOS),Darwin)
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
PLATFORM_OS=OSX
|
PLATFORM_OS=OSX
|
||||||
LIBPATH=osx
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -77,11 +73,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI cross-compiler
|
|
||||||
RPI_CROSS_COMPILE ?= NO
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH = C:/emsdk
|
EMSDK_PATH = C:/emsdk
|
||||||
|
@ -93,29 +84,32 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
|
||||||
|
|
||||||
# Define raylib release directory for compiled library
|
# Define raylib release directory for compiled library
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/freebsd
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
# Define default C compiler: gcc
|
||||||
|
# NOTE: define g++ compiler if using C++
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
@ -129,9 +123,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
ifeq ($(RPI_CROSS_COMPILE),YES)
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
# RPI cross-compiler
|
# Define RPI cross-compiler
|
||||||
CC = armv6j-hardfloat-linux-gnueabi-gcc
|
#CC = armv6j-hardfloat-linux-gnueabi-gcc
|
||||||
|
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
@ -181,8 +176,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
||||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
# -s USE_PTHREADS=1 # multithreading support
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
|
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
||||||
|
@ -202,7 +198,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs
|
# Define library paths containing required libs
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
|
@ -265,7 +261,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE)/libraylib.bc
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all source files required
|
# Define all source files required
|
||||||
|
|
|
@ -49,24 +49,20 @@ USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PLATFORM_OS=WINDOWS
|
PLATFORM_OS=WINDOWS
|
||||||
LIBPATH=win32
|
|
||||||
else
|
else
|
||||||
UNAMEOS=$(shell uname)
|
UNAMEOS=$(shell uname)
|
||||||
ifeq ($(UNAMEOS),Linux)
|
ifeq ($(UNAMEOS),Linux)
|
||||||
PLATFORM_OS=LINUX
|
PLATFORM_OS=LINUX
|
||||||
LIBPATH=linux
|
|
||||||
endif
|
endif
|
||||||
UNAMEOS=$(shell uname)
|
|
||||||
ifeq ($(UNAMEOS),FreeBSD)
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
PLATFORM_OS=FREEBSD
|
PLATFORM_OS=FREEBSD
|
||||||
LIBPATH=freebsd
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAMEOS),Darwin)
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
PLATFORM_OS=OSX
|
PLATFORM_OS=OSX
|
||||||
LIBPATH=osx
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -77,11 +73,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI cross-compiler
|
|
||||||
RPI_CROSS_COMPILE ?= NO
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH = C:/emsdk
|
EMSDK_PATH = C:/emsdk
|
||||||
|
@ -93,29 +84,32 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
|
||||||
|
|
||||||
# Define raylib release directory for compiled library
|
# Define raylib release directory for compiled library
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/freebsd
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
# Define default C compiler: gcc
|
||||||
|
# NOTE: define g++ compiler if using C++
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
@ -129,9 +123,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
ifeq ($(RPI_CROSS_COMPILE),YES)
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
# RPI cross-compiler
|
# Define RPI cross-compiler
|
||||||
CC = armv6j-hardfloat-linux-gnueabi-gcc
|
#CC = armv6j-hardfloat-linux-gnueabi-gcc
|
||||||
|
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
@ -181,8 +176,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
||||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
# -s USE_PTHREADS=1 # multithreading support
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
|
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
||||||
|
@ -202,7 +198,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs
|
# Define library paths containing required libs
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
|
@ -265,7 +261,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE)/libraylib.bc
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all source files required
|
# Define all source files required
|
||||||
|
|
|
@ -49,24 +49,20 @@ USE_WAYLAND_DISPLAY ?= FALSE
|
||||||
|
|
||||||
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
|
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
|
||||||
|
# ifeq ($(UNAME),Msys) -> Windows
|
||||||
ifeq ($(OS),Windows_NT)
|
ifeq ($(OS),Windows_NT)
|
||||||
PLATFORM_OS=WINDOWS
|
PLATFORM_OS=WINDOWS
|
||||||
LIBPATH=win32
|
|
||||||
else
|
else
|
||||||
UNAMEOS=$(shell uname)
|
UNAMEOS=$(shell uname)
|
||||||
ifeq ($(UNAMEOS),Linux)
|
ifeq ($(UNAMEOS),Linux)
|
||||||
PLATFORM_OS=LINUX
|
PLATFORM_OS=LINUX
|
||||||
LIBPATH=linux
|
|
||||||
endif
|
endif
|
||||||
UNAMEOS=$(shell uname)
|
|
||||||
ifeq ($(UNAMEOS),FreeBSD)
|
ifeq ($(UNAMEOS),FreeBSD)
|
||||||
PLATFORM_OS=FREEBSD
|
PLATFORM_OS=FREEBSD
|
||||||
LIBPATH=freebsd
|
|
||||||
endif
|
endif
|
||||||
ifeq ($(UNAMEOS),Darwin)
|
ifeq ($(UNAMEOS),Darwin)
|
||||||
PLATFORM_OS=OSX
|
PLATFORM_OS=OSX
|
||||||
LIBPATH=osx
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
@ -77,11 +73,6 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
|
||||||
# RPI cross-compiler
|
|
||||||
RPI_CROSS_COMPILE ?= NO
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Emscripten required variables
|
# Emscripten required variables
|
||||||
EMSDK_PATH = C:/emsdk
|
EMSDK_PATH = C:/emsdk
|
||||||
|
@ -93,29 +84,32 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
EMSCRIPTEN=$(EMSDK_PATH)\emscripten\$(EMSCRIPTEN_VERSION)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/release/libs
|
||||||
|
|
||||||
# Define raylib release directory for compiled library
|
# Define raylib release directory for compiled library
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),WINDOWS)
|
ifeq ($(PLATFORM_OS),WINDOWS)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/win32/mingw32
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),LINUX)
|
ifeq ($(PLATFORM_OS),LINUX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/linux
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/linux
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),OSX)
|
ifeq ($(PLATFORM_OS),OSX)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/osx
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/osx
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/freebsd
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/freebsd
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/html5
|
|
||||||
endif
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
RAYLIB_RELEASE = $(RAYLIB_PATH)/release/libs/rpi
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/rpi
|
||||||
|
endif
|
||||||
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/release/libs/html5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define default C compiler: gcc
|
# Define default C compiler: gcc
|
||||||
|
# NOTE: define g++ compiler if using C++
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
|
@ -129,9 +123,10 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_RPI)
|
ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
ifeq ($(RPI_CROSS_COMPILE),YES)
|
ifeq ($(USE_RPI_CROSS_COMPILER),TRUE)
|
||||||
# RPI cross-compiler
|
# Define RPI cross-compiler
|
||||||
CC = armv6j-hardfloat-linux-gnueabi-gcc
|
#CC = armv6j-hardfloat-linux-gnueabi-gcc
|
||||||
|
CC = $(RPI_TOOLCHAIN)/bin/arm-linux-gnueabihf-gcc
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
|
@ -181,8 +176,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
# -s ALLOW_MEMORY_GROWTH=1 # to allow memory resizing
|
||||||
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
# -s TOTAL_MEMORY=16777216 # to specify heap memory size (default = 16MB)
|
||||||
# -s USE_PTHREADS=1 # multithreading support
|
# -s USE_PTHREADS=1 # multithreading support
|
||||||
|
# -s WASM=1 # support Web Assembly (https://github.com/kripken/emscripten/wiki/WebAssembly)
|
||||||
# --preload-file resources # specify a resources folder for data compilation
|
# --preload-file resources # specify a resources folder for data compilation
|
||||||
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 --profiling --preload-file resources
|
CFLAGS += -s USE_GLFW=3 -s ASSERTIONS=1 -s WASM=1 --profiling --preload-file resources
|
||||||
|
|
||||||
# Define a custom shell .html and output extension
|
# Define a custom shell .html and output extension
|
||||||
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
CFLAGS += --shell-file $(RAYLIB_PATH)\templates\web_shell\shell.html
|
||||||
|
@ -202,7 +198,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define library paths containing required libs
|
# Define library paths containing required libs
|
||||||
LDFLAGS = -L. -L$(RAYLIB_RELEASE) -L$(RAYLIB_PATH)/src
|
LDFLAGS = -L. -L$(RAYLIB_RELEASE_PATH) -L$(RAYLIB_PATH)/src
|
||||||
|
|
||||||
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
|
||||||
ifeq ($(PLATFORM_OS),FREEBSD)
|
ifeq ($(PLATFORM_OS),FREEBSD)
|
||||||
|
@ -265,7 +261,7 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
|
||||||
endif
|
endif
|
||||||
ifeq ($(PLATFORM),PLATFORM_WEB)
|
ifeq ($(PLATFORM),PLATFORM_WEB)
|
||||||
# Libraries for web (HTML5) compiling
|
# Libraries for web (HTML5) compiling
|
||||||
LDLIBS = $(RAYLIB_RELEASE)/libraylib.bc
|
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Define all source files required
|
# Define all source files required
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue