diff options
| author | raysan5 <[email protected]> | 2016-11-18 14:05:49 +0100 |
|---|---|---|
| committer | raysan5 <[email protected]> | 2016-11-18 14:05:49 +0100 |
| commit | 0603e59cae0da924d7fe811b078972e04cdfe1e9 (patch) | |
| tree | 55aff2d0cb67ee60018911ecf04d0b1be25dd722 /examples/Makefile | |
| parent | 6b072e696d1b2b029ec1c8464ed22bf7ab65e5ee (diff) | |
| download | raylib-0603e59cae0da924d7fe811b078972e04cdfe1e9.tar.gz raylib-0603e59cae0da924d7fe811b078972e04cdfe1e9.zip | |
Review examples and added new ones
Diffstat (limited to 'examples/Makefile')
| -rw-r--r-- | examples/Makefile | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/examples/Makefile b/examples/Makefile index 378f5edf..da29e915 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,7 @@ EXAMPLES = \ text_format_text \ text_font_select \ text_writing_anim \ + text_ttf_loading \ models_geometric_shapes \ models_box_collisions \ models_billboard \ @@ -400,6 +414,10 @@ 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 [models] example - basic geometric 3d shapes models_geometric_shapes: models_geometric_shapes.c $(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDES) $(LFLAGS) $(LIBS) -D$(PLATFORM) $(WINFLAGS) |
