diff options
| author | Ray <raysan5@gmail.com> | 2014-11-09 13:39:27 +0100 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2014-11-09 13:39:27 +0100 |
| commit | 05ccc4fd42a9ff2dfd33f13be29734bb7531d65a (patch) | |
| tree | fd2d32a5a8740e59e05481d6fb9b15d78d027bf4 | |
| parent | 45b214d83e7469a64793ac4dcebaa0ab963668ef (diff) | |
| parent | a471b6197aec1911cf26bcc891767bca22cb9dab (diff) | |
| download | raylib-05ccc4fd42a9ff2dfd33f13be29734bb7531d65a.tar.gz raylib-05ccc4fd42a9ff2dfd33f13be29734bb7531d65a.zip | |
Merge pull request #5 from debiatan/support_linux_desktop
Small fixes to support the Debian/GNU Linux distro. Hopefully Ubuntu too.
| -rw-r--r-- | examples/makefile | 20 | ||||
| -rw-r--r-- | src/makefile | 7 | ||||
| -rw-r--r-- | src/stb_vorbis.c | 3 |
3 files changed, 27 insertions, 3 deletions
diff --git a/examples/makefile b/examples/makefile index 572bfd98..076c9594 100644 --- a/examples/makefile +++ b/examples/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platform: PLATFORM_DESKTOP +# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX PLATFORM ?= PLATFORM_RPI # define compiler: gcc for C program, define as g++ for C++ @@ -49,7 +49,11 @@ else endif # define library paths containing required libs -LFLAGS = -L. -L../src -L/opt/vc/lib +ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) + LFLAGS = -L. -L../src +else + LFLAGS = -L. -L../src -L/opt/vc/lib +endif # define any libraries to link into executable # if you want to link libraries (libname.so or libname.a), use the -lname @@ -58,10 +62,17 @@ ifeq ($(PLATFORM),PLATFORM_RPI) # NOTE: OpenAL Soft library should be installed (libopenal1 package) LIBS = -lraylib -lGLESv2 -lEGL -lpthread -lrt -lm -lbcm_host -lopenal else +ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) + # libraries for Debian GNU/Linux desktop compiling + # requires the following packages: + # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev + LIBS = -lraylib -lglfw -lGLEW -lGL -lopenal +else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed LIBS = -lraylib -lglfw3 -lglew32 -lopengl32 -lopenal32 -lgdi32 endif +endif # define additional parameters and flags for windows ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -239,8 +250,13 @@ ifeq ($(PLATFORM),PLATFORM_RPI) rm -f *.o # find . -executable -delete else +ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) + find . -type f -executable -delete + rm -f *.o +else del *.o *.exe endif +endif @echo Cleaning done # instead of defining every module one by one, we can define a pattern diff --git a/src/makefile b/src/makefile index 69e7862b..0c078e86 100644 --- a/src/makefile +++ b/src/makefile @@ -24,7 +24,7 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platform: PLATFORM_DESKTOP +# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX PLATFORM ?= PLATFORM_RPI # define raylib graphics api depending on selected platform @@ -120,8 +120,13 @@ clean: ifeq ($(PLATFORM),PLATFORM_RPI) rm -f *.o libraylib.a else +ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) + find . -type f -executable -delete + rm -f *.o libraylib.a +else del *.o libraylib.a endif +endif @echo Cleaning done # instead of defining every module one by one, we can define a pattern diff --git a/src/stb_vorbis.c b/src/stb_vorbis.c index a88b2a77..7a45725b 100644 --- a/src/stb_vorbis.c +++ b/src/stb_vorbis.c @@ -28,6 +28,9 @@ #include "stb_vorbis.h" +#ifdef __linux +#include <alloca.h> +#endif #ifndef STB_VORBIS_HEADER_ONLY |
