aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fabo@debian.org>2011-10-22 12:28:24 +0300
committerFathi Boudra <fabo@debian.org>2011-10-22 12:28:24 +0300
commit16ae224ccd9b59a029bf2779aa2a45ff34ea17f1 (patch)
tree095b1bfa652d1db7c7e4b59fd6f865a5d0177a3c
parent5f0186fc25de5922d30f36732eb2626d7de843e4 (diff)
downloadirrlicht-gles-16ae224ccd9b59a029bf2779aa2a45ff34ea17f1.tar.gz
simplify build system to easily switch GLES2/GLES1HEADmaster
-rw-r--r--examples/01.HelloWorld/Makefile4
-rw-r--r--examples/02.Quake3Map/Makefile4
-rw-r--r--examples/03.CustomSceneNode/Makefile4
-rw-r--r--examples/04.Movement/Makefile4
-rw-r--r--examples/05.UserInterface/Makefile4
-rw-r--r--examples/06.2DGraphics/Makefile4
-rw-r--r--examples/07.Collision/Makefile4
-rw-r--r--examples/08.SpecialFX/Makefile4
-rw-r--r--examples/09.Meshviewer/Makefile4
-rw-r--r--examples/10.Shaders/Makefile4
-rw-r--r--examples/11.PerPixelLighting/Makefile4
-rw-r--r--examples/12.TerrainRendering/Makefile4
-rw-r--r--examples/13.RenderToTexture/Makefile4
-rw-r--r--examples/15.LoadIrrFile/Makefile4
-rw-r--r--examples/16.Quake3MapShader/Makefile4
-rw-r--r--examples/18.SplitScreen/Makefile4
-rw-r--r--examples/19.MouseAndJoystick/Makefile4
-rw-r--r--examples/20.ManagedLights/Makefile4
-rw-r--r--examples/21.Quake3Explorer/Makefile4
-rw-r--r--examples/22.MaterialViewer/Makefile4
-rw-r--r--examples/23.SMeshHandling/Makefile4
-rw-r--r--examples/24.CursorControl/Makefile4
-rw-r--r--examples/25.XmlHandling/Makefile4
-rw-r--r--examples/26.OcclusionQuery/Makefile4
-rw-r--r--examples/Demo/Makefile4
-rw-r--r--source/Irrlicht/Makefile4
-rw-r--r--source/Irrlicht/global-settings.mk13
-rw-r--r--tests/Makefile4
28 files changed, 67 insertions, 54 deletions
diff --git a/examples/01.HelloWorld/Makefile b/examples/01.HelloWorld/Makefile
index 3f3db52..4d92d8b 100644
--- a/examples/01.HelloWorld/Makefile
+++ b/examples/01.HelloWorld/Makefile
@@ -31,10 +31,10 @@ LDFLAGS = $(USERLDFLAGS)
#default target is Linux
all: all_linux
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
+-include ../../source/Irrlicht/global-settings.mk
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
-all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe
diff --git a/examples/02.Quake3Map/Makefile b/examples/02.Quake3Map/Makefile
index c387093..327fce2 100644
--- a/examples/02.Quake3Map/Makefile
+++ b/examples/02.Quake3Map/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht
static_win32: LDFLAGS += -lgdi32 -lopengl32 -ld3dx9d -lwinmm -lm
diff --git a/examples/03.CustomSceneNode/Makefile b/examples/03.CustomSceneNode/Makefile
index 294d948..3609c40 100644
--- a/examples/03.CustomSceneNode/Makefile
+++ b/examples/03.CustomSceneNode/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/04.Movement/Makefile b/examples/04.Movement/Makefile
index 070a1c5..8cb46c2 100644
--- a/examples/04.Movement/Makefile
+++ b/examples/04.Movement/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
diff --git a/examples/05.UserInterface/Makefile b/examples/05.UserInterface/Makefile
index 119b944..8d39bcb 100644
--- a/examples/05.UserInterface/Makefile
+++ b/examples/05.UserInterface/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/06.2DGraphics/Makefile b/examples/06.2DGraphics/Makefile
index 26c4159..68a8598 100644
--- a/examples/06.2DGraphics/Makefile
+++ b/examples/06.2DGraphics/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/07.Collision/Makefile b/examples/07.Collision/Makefile
index 49ebb93..447f182 100644
--- a/examples/07.Collision/Makefile
+++ b/examples/07.Collision/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/08.SpecialFX/Makefile b/examples/08.SpecialFX/Makefile
index 6d98ae8..bef5bea 100644
--- a/examples/08.SpecialFX/Makefile
+++ b/examples/08.SpecialFX/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/09.Meshviewer/Makefile b/examples/09.Meshviewer/Makefile
index e3c4858..986ecb6 100644
--- a/examples/09.Meshviewer/Makefile
+++ b/examples/09.Meshviewer/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/10.Shaders/Makefile b/examples/10.Shaders/Makefile
index ad2a85a..1eb1ad9 100644
--- a/examples/10.Shaders/Makefile
+++ b/examples/10.Shaders/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/11.PerPixelLighting/Makefile b/examples/11.PerPixelLighting/Makefile
index b68b54e..4d8c907 100644
--- a/examples/11.PerPixelLighting/Makefile
+++ b/examples/11.PerPixelLighting/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/12.TerrainRendering/Makefile b/examples/12.TerrainRendering/Makefile
index 19cb1f7..4ff4086 100644
--- a/examples/12.TerrainRendering/Makefile
+++ b/examples/12.TerrainRendering/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/13.RenderToTexture/Makefile b/examples/13.RenderToTexture/Makefile
index 72dab7c..66c88a0 100644
--- a/examples/13.RenderToTexture/Makefile
+++ b/examples/13.RenderToTexture/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/15.LoadIrrFile/Makefile b/examples/15.LoadIrrFile/Makefile
index d97d00d..8b2cfab 100644
--- a/examples/15.LoadIrrFile/Makefile
+++ b/examples/15.LoadIrrFile/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/16.Quake3MapShader/Makefile b/examples/16.Quake3MapShader/Makefile
index 9cd7f5e..290cdec 100644
--- a/examples/16.Quake3MapShader/Makefile
+++ b/examples/16.Quake3MapShader/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/18.SplitScreen/Makefile b/examples/18.SplitScreen/Makefile
index 6921f0f..47ad9fc 100644
--- a/examples/18.SplitScreen/Makefile
+++ b/examples/18.SplitScreen/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/19.MouseAndJoystick/Makefile b/examples/19.MouseAndJoystick/Makefile
index 295647b..d55354f 100644
--- a/examples/19.MouseAndJoystick/Makefile
+++ b/examples/19.MouseAndJoystick/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
diff --git a/examples/20.ManagedLights/Makefile b/examples/20.ManagedLights/Makefile
index 324dd42..2b39143 100644
--- a/examples/20.ManagedLights/Makefile
+++ b/examples/20.ManagedLights/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
diff --git a/examples/21.Quake3Explorer/Makefile b/examples/21.Quake3Explorer/Makefile
index 186f65e..20be549 100644
--- a/examples/21.Quake3Explorer/Makefile
+++ b/examples/21.Quake3Explorer/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/22.MaterialViewer/Makefile b/examples/22.MaterialViewer/Makefile
index 4114bcc..e8300db 100644
--- a/examples/22.MaterialViewer/Makefile
+++ b/examples/22.MaterialViewer/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/23.SMeshHandling/Makefile b/examples/23.SMeshHandling/Makefile
index 3d07339..4677262 100644
--- a/examples/23.SMeshHandling/Makefile
+++ b/examples/23.SMeshHandling/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32 clean_win32: SYSTEM=Win32-gcc
diff --git a/examples/24.CursorControl/Makefile b/examples/24.CursorControl/Makefile
index dc7d09f..f5e6069 100644
--- a/examples/24.CursorControl/Makefile
+++ b/examples/24.CursorControl/Makefile
@@ -31,10 +31,10 @@ LDFLAGS = $(USERLDFLAGS)
#default target is Linux
all: all_linux
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
+-include ../../source/Irrlicht/global-settings.mk
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
-all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe
diff --git a/examples/25.XmlHandling/Makefile b/examples/25.XmlHandling/Makefile
index f1b810f..0aa0828 100644
--- a/examples/25.XmlHandling/Makefile
+++ b/examples/25.XmlHandling/Makefile
@@ -31,10 +31,10 @@ LDFLAGS = $(USERLDFLAGS)
#default target is Linux
all: all_linux
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
+-include ../../source/Irrlicht/global-settings.mk
all_linux all_win32 static_win32: LDFLAGS += -L$(IrrlichtHome)/lib/$(SYSTEM) -lIrrlicht
-all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32 clean_win32 static_win32: SYSTEM=Win32-gcc
all_win32 clean_win32 static_win32: SUF=.exe
diff --git a/examples/26.OcclusionQuery/Makefile b/examples/26.OcclusionQuery/Makefile
index 23824dc..d5ab7d1 100644
--- a/examples/26.OcclusionQuery/Makefile
+++ b/examples/26.OcclusionQuery/Makefile
@@ -16,9 +16,9 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+-include ../../source/Irrlicht/global-settings.mk
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_linux clean_linux: SYSTEM=Linux
all_win32: LDFLAGS = -L../../lib/Win32-gcc -lIrrlicht -lopengl32 -lm
all_win32: CPPFLAGS += -D__GNUWIN32__ -D_WIN32 -DWIN32 -D_WINDOWS -D_MBCS -D_USRDLL
diff --git a/examples/Demo/Makefile b/examples/Demo/Makefile
index 116a658..deec601 100644
--- a/examples/Demo/Makefile
+++ b/examples/Demo/Makefile
@@ -11,10 +11,10 @@ endif
all: all_linux
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
+-include ../../source/Irrlicht/global-settings.mk
all_linux: SYSTEM=Linux
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../../lib/Linux -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32: LDFLAGS = -L../../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm
diff --git a/source/Irrlicht/Makefile b/source/Irrlicht/Makefile
index b08e979..4ba6f5d 100644
--- a/source/Irrlicht/Makefile
+++ b/source/Irrlicht/Makefile
@@ -77,15 +77,15 @@ ifeq ($(HOSTTYPE), x86_64)
LIBSELECT=64
endif
-OGLESLIBS := -lEGL -lGLESv2
#Linux specific options
+-include global-settings.mk
staticlib sharedlib install: SYSTEM = Linux
STATIC_LIB = libIrrlicht.a
LIB_PATH = ../../lib/$(SYSTEM)
INSTALL_DIR = /usr/local/lib
sharedlib install: SHARED_LIB = libIrrlicht.so
staticlib sharedlib: LDFLAGS += --no-export-all-symbols --add-stdcall-alias
-sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLESLIBS) -lXxf86vm -lX11 -lz -lpng -ljpeg -lbz2
+sharedlib: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
staticlib sharedlib: CXXINCS += -I/usr/X11R6/include
#OSX specific options
diff --git a/source/Irrlicht/global-settings.mk b/source/Irrlicht/global-settings.mk
new file mode 100644
index 0000000..13c57cd
--- /dev/null
+++ b/source/Irrlicht/global-settings.mk
@@ -0,0 +1,13 @@
+# Global compiler settings
+
+# OpenGL libraries: "-lGL" or "-lEGL -lGLESv2" or "-lGLESv1_CM"
+OGLLIBS := -lEGL -lGLESv2
+
+# X11 libaries
+X11LIBS := -lXxf86vm -lXext -lX11 -lXcursor
+
+# Extra libraries (archives format, images format, etc...)
+EXTRALIBS := -lz -lbz2 -lpng -ljpeg -lbz2
+
+# Default flags
+LDFLAGS := -s -Wl,--no-undefined -Wl,--as-needed
diff --git a/tests/Makefile b/tests/Makefile
index e74bb78..0f5448d 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -12,10 +12,10 @@ endif
all: all_linux
-OGLESLIBS := -lEGL -lGLESv2
# target specific settings
+-include ../source/Irrlicht/global-settings.mk
all_linux: SYSTEM=Linux
-all_linux: LDFLAGS = -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht $(OGLESLIBS) -lXxf86vm -lXext -lX11 -lXcursor -lz -lpng -ljpeg -lbz2
+all_linux: LDFLAGS += -L/usr/X11R6/lib$(LIBSELECT) -L../lib/$(SYSTEM) -lIrrlicht $(OGLLIBS) $(X11LIBS) $(EXTRALIBS)
all_win32 clean_win32: SYSTEM=Win32-gcc
all_win32: LDFLAGS = -L../lib/$(SYSTEM) -lIrrlicht -lopengl32 -lm