summaryrefslogtreecommitdiffhomepage
path: root/examples/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Makefile')
-rw-r--r--examples/Makefile54
1 files changed, 51 insertions, 3 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 378f5edf..710e97c4 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -2,6 +2,8 @@
#
# raylib makefile for desktop platforms, Raspberry Pi and HTML5 (emscripten)
#
+# NOTE: By default examples are compiled using raylib static library and OpenAL Soft shared library
+#
# Copyright (c) 2013-2016 Ramon Santamaria (@raysan5)
#
# This software is provided "as-is", without any express or implied warranty. In no event
@@ -26,6 +28,9 @@
# WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
PLATFORM ?= PLATFORM_DESKTOP
+# define NO to use OpenAL Soft as static library (shared by default)
+SHARED_OPENAL ?= YES
+
# determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows! ifeq ($(UNAME),Msys) -> Windows
@@ -62,12 +67,13 @@ endif
# define compiler flags:
# -O2 defines optimization level
+# -s strip unnecessary data from build
# -Wall turns on most, but not all, compiler warnings
# -std=c99 use standard C from 1999 revision
ifeq ($(PLATFORM),PLATFORM_RPI)
- CFLAGS = -O2 -Wall -std=gnu99 -fgnu89-inline
+ CFLAGS = -O2 -s -Wall -std=gnu99 -fgnu89-inline
else
- CFLAGS = -O2 -Wall -std=c99
+ CFLAGS = -O2 -s -Wall -std=c99
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
CFLAGS = -O1 -Wall -std=c99 -s USE_GLFW=3 -s ASSERTIONS=1 --preload-file resources
@@ -151,7 +157,14 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
else
# libraries for Windows desktop compiling
# NOTE: GLFW3 and OpenAL Soft libraries should be installed
- LIBS = -lraylib -lglfw3 -lopengl32 -lopenal32 -lgdi32
+ LIBS = -lraylib -lglfw3 -lopengl32 -lgdi32
+ # if static OpenAL Soft required, define the corresponding libs
+ ifeq ($(SHARED_OPENAL),NO)
+ LIBS += -lopenal32 -lwinmm
+ CFLAGS += -Wl,-allow-multiple-definition
+ else
+ LIBS += -lopenal32dll
+ endif
endif
endif
endif
@@ -215,6 +228,8 @@ EXAMPLES = \
text_format_text \
text_font_select \
text_writing_anim \
+ text_ttf_loading \
+ text_bmfont_unordered \
models_geometric_shapes \
models_box_collisions \
models_billboard \
@@ -230,6 +245,11 @@ EXAMPLES = \
audio_music_stream \
audio_module_playing \
audio_raw_stream \
+ physics_demo \
+ physics_friction \
+ physics_movement \
+ physics_restitution \
+ physics_shatter \
fix_dylib \
@@ -400,6 +420,14 @@ text_font_select: text_font_select.c
text_writing_anim: text_writing_anim.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
+# compile [text] example - text ttf loading
+text_ttf_loading: text_ttf_loading.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
+
+# compile [text] example - text bmfont unordered
+text_bmfont_unordered: text_bmfont_unordered.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
+
# compile [models] example - basic geometric 3d shapes
models_geometric_shapes: models_geometric_shapes.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
@@ -464,6 +492,26 @@ audio_module_playing: audio_module_playing.c
audio_raw_stream: audio_raw_stream.c
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS)
+# compile [physac] example - physics demo
+physics_demo: physics_demo.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
+
+# compile [physac] example - physics friction
+physics_friction: physics_friction.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
+
+# compile [physac] example - physics movement
+physics_movement: physics_movement.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
+
+# compile [physac] example - physics restitution
+physics_restitution: physics_restitution.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
+
+# compile [physac] example - physics shatter
+physics_shatter: physics_shatter.c
+ $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -lpthread -D$(PLATFORM) $(WINFLAGS)
+
# fix dylib install path name for each executable (MAC)
fix_dylib:
ifeq ($(PLATFORM_OS),OSX)