aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2016-03-13 19:31:36 +0100
committerRay <raysan5@gmail.com>2016-03-13 19:31:36 +0100
commit5bcda7bf1526c40f605de3abcde4fd10d81c6cc5 (patch)
tree86098d3d7f0254712ed2fa9f64d43ab98fc54ce3 /examples
parentdcabb49244ba4da0d0ccdda7fce61103c814b086 (diff)
parent9e7a3b7017446c46e8ad128736a5979402cf09d7 (diff)
downloadraylib-5bcda7bf1526c40f605de3abcde4fd10d81c6cc5.tar.gz
raylib-5bcda7bf1526c40f605de3abcde4fd10d81c6cc5.zip
Merge pull request #102 from LelixSuper/develop
Fix examples and templates compiling on GNU/Linux
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile (renamed from examples/makefile)85
1 files changed, 59 insertions, 26 deletions
diff --git a/examples/makefile b/examples/Makefile
index 2a9e88ba..e62488ae 100644
--- a/examples/makefile
+++ b/examples/Makefile
@@ -79,31 +79,65 @@ endif
# define any directories containing required header files
ifeq ($(PLATFORM),PLATFORM_RPI)
- INCLUDES = -I. -I../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
-else
- INCLUDES = -I. -I../src
-# external libraries headers
-# GLFW3
- INCLUDES += -I../external/glfw3/include
-# GLEW - Not required any more, replaced by GLAD
- #INCLUDES += -I../external/glew/include
-# OpenAL Soft
- INCLUDES += -I../external/openal_soft/include
+ INCLUDES = -I. -I../../src -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads
+endif
+ifeq ($(PLATFORM),PLATFORM_DESKTOP)
+ # add standard directories for GNU/Linux
+ ifeq ($(PLATFORM_OS),LINUX)
+ INCLUDES = -I. -I../src -I/usr/local/include/raylib/
+ else
+ INCLUDES = -I. -I../../src -IC:/raylib/raylib/src
+ # external libraries headers
+ # GLFW3
+ INCLUDES += -I../../external/glfw3/include
+ # GLEW - Not required any more, replaced by GLAD
+ #INCLUDES += -I../external/glew/include
+ # OpenAL Soft
+ INCLUDES += -I../../external/openal_soft/include
+ endif
endif
# define library paths containing required libs
ifeq ($(PLATFORM),PLATFORM_RPI)
- LFLAGS = -L. -L../src -L/opt/vc/lib
-else
- LFLAGS = -L. -L../src
-# external libraries to link with
-# GLFW3
- LFLAGS += -L../external/glfw3/lib/$(LIBPATH)
- ifneq ($(PLATFORM_OS),OSX)
- # OpenAL Soft
- LFLAGS += -L../external/openal_soft/lib/$(LIBPATH)
- # GLEW - Not required any more, replaced by GLAD
- #LFLAGS += -L../external/glew/lib/$(LIBPATH)
+ LFLAGS = -L. -L../../src -L/opt/vc/lib
+endif
+ifeq ($(PLATFORM),PLATFORM_DESKTOP)
+ # add standard directories for GNU/Linux
+ ifeq ($(PLATFORM_OS),LINUX)
+ LFLAGS = -L. -L../../src
+ else
+ LFLAGS = -L. -L../../src -LC:/raylib/raylib/src
+ # external libraries to link with
+ # GLFW3
+ LFLAGS += -L../../external/glfw3/lib/$(LIBPATH)
+ ifneq ($(PLATFORM_OS),OSX)
+ # OpenAL Soft
+ LFLAGS += -L../../external/openal_soft/lib/$(LIBPATH)
+ # GLEW: Not used, replaced by GLAD
+ #LFLAGS += -L../../external/glew/lib/$(LIBPATH)
+ endif
+ endif
+endif
+
+# define library paths containing required libs
+ifeq ($(PLATFORM),PLATFORM_RPI)
+ LFLAGS = -L. -L../../src -L/opt/vc/lib
+endif
+ifeq ($(PLATFORM),PLATFORM_DESKTOP)
+ # add standard directories for GNU/Linux
+ ifeq ($(PLATFORM_OS),LINUX)
+ LFLAGS = -L. -L../../src
+ else
+ LFLAGS = -L. -L../../src -LC:/raylib/raylib/src
+ # external libraries to link with
+ # GLFW3
+ LFLAGS += -L../../external/glfw3/lib/$(LIBPATH)
+ ifneq ($(PLATFORM_OS),OSX)
+ # OpenAL Soft
+ LFLAGS += -L../../external/openal_soft/lib/$(LIBPATH)
+ # GLEW
+ LFLAGS += -L../../external/glew/lib/$(LIBPATH)
+ endif
endif
endif
@@ -114,9 +148,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# libraries for Debian GNU/Linux desktop compiling
# requires the following packages:
# libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev
- LIBS = -lraylib -lglfw3 -lGLEW -lGL -lopenal -lm -pthread
- # on XWindow could require also below libraries, just uncomment
- #LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
+ LIBS = -lraylib -lglfw3 -lGL -lopenal -lm -pthread -ldl -lX11 \
+ -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor
else
ifeq ($(PLATFORM_OS),OSX)
# libraries for OS X 10.9 desktop compiling
@@ -202,9 +235,9 @@ EXAMPLES = \
fix_dylib \
-# typing 'make' will invoke the first target entry in the file,
+# typing 'make' will invoke the default target entry called 'all',
# in this case, the 'default' target entry is raylib
-default: examples
+all: examples
# compile all examples
examples: $(EXAMPLES)