From a1eaa212dfedfc37db26079e97cd74b3daf3806d Mon Sep 17 00:00:00 2001 From: LelixSuper Date: Thu, 4 Aug 2016 15:22:15 +0200 Subject: [PATCH] Update the docs --- ...x.md => Build-the-library-for-GNU-Linux.md | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) rename Compile-for-GNU-Linux.md => Build-the-library-for-GNU-Linux.md (54%) diff --git a/Compile-for-GNU-Linux.md b/Build-the-library-for-GNU-Linux.md similarity index 54% rename from Compile-for-GNU-Linux.md rename to Build-the-library-for-GNU-Linux.md index d0466b3..d3abcfa 100644 --- a/Compile-for-GNU-Linux.md +++ b/Build-the-library-for-GNU-Linux.md @@ -1,9 +1,9 @@ To build your raylib game for GNU/Linux you need to download raylib git repository and install some dependencies. raylib already comes with ready-to-use makefiles to compile source code, examples and templates that you can use on your projects. -This guide is for Ubuntu/Debian distros, that use APT as package manager; it is tested on Ubuntu 14.04. +This guide is for all GNU/Linux distros (I will use APT as package manager, for Debian based distros). ### Install basis and useful packages -You have to install GCC compilers, Make tool and git (for downloading raylib repository): +You have to install GCC compilers, Make tool and git (for downloading raylib repository). sudo apt install build-essential git @@ -11,35 +11,44 @@ You have to install GCC compilers, Make tool and git (for downloading raylib rep #### Install raylib dependencies raylib requires GLFW3 (Windows and input management) and OpenAL Soft (audio system management). Just install them: - sudo apt install libopenal1 libopenal-dev + sudo apt install libopenal-dev GLFW3 depends on some other libraries: sudo apt install mesa-common-dev libx11-dev libxrandr-dev libxi-dev xorg-dev libgl1-mesa-dev libglu1-mesa-dev libglew-dev -Now, you need to download GLFW3 from sources and build it (you also need cmake tool; if you have not, just do: `sudo apt install cmake`): +Now, you need to download GLFW3 from sources and build it (you also need cmake tool; if you don't have, just do: `sudo apt install cmake`): - git clone https://github.com/glfw/glfw.git glfw + wget https://github.com/glfw/glfw/releases/download/3.2/glfw-3.2.zip + unzip glfw-3.2.zip cd glfw cmake . sudo make install -#### Compile raylib source code -First, you need to download raylib repository from git; after you can compile it for GNU/Linux: +#### Build raylib source code +You can compile three different type of raylib library: + +* The static library (default method); +* The dynamic shared library; +* The web library. + +First of all, you need to download raylib repository from Github; after you can compile it: git clone https://github.com/raysan5/raylib.git raylib cd raylib/src/ - make PLATFORM=PLATFORM_DESKTOP + make PLATFORM=PLATFORM_DESKTOP # To make the static version. + make PLATFORM=PLATFORM_DESKTOP SHARED=YES # To make the dynamic shared version. + make PLATFORM=PLATFORM_WEB # To make web version. -_NOTE:_ By default raylib is compiled for OpenGL 3.3 Core graphics API backend; to compile for OpenGL 1.1 graphics API just type: +_NOTE:_ By default raylib is compiled for OpenGL 3.3 Core graphics API backend; to compile for OpenGL 1.1 graphics API just add `GRAPHICS=GRAPHICS_API_OPENGL_11` to the make command. - make PLATFORM=PLATFORM_DESKTOP GRAPHICS=GRAPHICS_API_OPENGL_11 +If you want, you can install the library in the standard directories, or remove it: -If you want, you can move the library and header in standards directories: - - sudo cp libraylib.a /usr/local/lib/libraylib.a - sudo mkdir /usr/local/include/raylib # If there is not the directory - sudo cp raylib.h /usr/local/include/raylib/raylib.h + sudo make install # Static version. + sudo make install SHARED=YES # Dynamic shared version. + + sudo make unistall + sudo make unistall SHARED=YES ### Compile raylib examples Just move to folder `raylib/examples/` and run: @@ -54,7 +63,6 @@ To force one example recompile: make core_basic_window PLATFORM=PLATFORM_DESKTOP -B - **If you have any doubt, [just let me know][raysan5].** [raysan5]: mailto:raysan5@gmail.com "Ramon Santamaria - Ray San" \ No newline at end of file