diff options
| author | raysan5 <raysan5@gmail.com> | 2015-01-08 21:10:06 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2015-01-08 21:10:06 +0100 |
| commit | d739895e4a8602034d7a65a3be0c90163dabb817 (patch) | |
| tree | 608e21363ecf36d6f520781df8d0f67b0c25e7a6 /examples/makefile | |
| parent | e37ef10595867e4f189fff0f87db5e6fdfcfc4d0 (diff) | |
| download | raylib-d739895e4a8602034d7a65a3be0c90163dabb817.tar.gz raylib-d739895e4a8602034d7a65a3be0c90163dabb817.zip | |
Reorganized external folders by platform
Improved makefiles!
Diffstat (limited to 'examples/makefile')
| -rw-r--r-- | examples/makefile | 45 |
1 files changed, 34 insertions, 11 deletions
diff --git a/examples/makefile b/examples/makefile index 9763b233..500ba715 100644 --- a/examples/makefile +++ b/examples/makefile @@ -26,18 +26,21 @@ # WARNING: To compile examples to HTML5, they must be redesigned to use emscripten.h and emscripten_set_main_loop() PLATFORM ?= PLATFORM_DESKTOP -# determine SUBPLATFORM in case PLATFORM_DESKTOP selected +# 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 ifeq ($(OS),Windows_NT) - SUBPLATFORM=WINDOWS + PLATFORM_OS=WINDOWS + LIBPATH=win32 else UNAMEOS:=$(shell uname) ifeq ($(UNAMEOS),Linux) - SUBPLATFORM=LINUX + PLATFORM_OS=LINUX + LIBPATH=linux else ifeq ($(UNAMEOS),Darwin) - SUBPLATFORM=OSX + PLATFORM_OS=OSX + LIBPATH=osx endif endif endif @@ -48,9 +51,14 @@ ifeq ($(PLATFORM),PLATFORM_WEB) # define emscripten compiler CC = emcc else +ifeq ($(PLATFORM_OS),OSX) + # define llvm compiler for mac + CC = clang +else # define default gcc compiler CC = gcc endif +endif # define compiler flags: # -O2 defines optimization level @@ -74,25 +82,39 @@ 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 + INCLUDES += -I../external/glew/include +# OpenAL Soft + INCLUDES += -I../external/openal_soft/include endif # define library paths containing required libs ifeq ($(PLATFORM),PLATFORM_RPI) LFLAGS = -L. -L../src -L/opt/vc/lib else - LFLAGS = -L. -L../src -L../external/glfw3/lib/ -I../external/openal_soft/lib/ + LFLAGS = -L. -L../src +# external libraries to link with +# GLFW3 + LFLAGS += -L../external/glfw3/lib/$(LIBPATH) +# GLEW + LFLAGS += -L../external/openal_soft/lib/$(LIBPATH) +# OpenAL Soft + LFLAGS += -L../external/glew/lib/$(LIBPATH) endif # define any libraries to link into executable # if you want to link libraries (libname.so or libname.a), use the -lname ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(SUBPLATFORM),LINUX) + ifeq ($(PLATFORM_OS),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 endif - ifeq ($(SUBPLATFORM),OSX) + ifeq ($(PLATFORM_OS),OSX) # libraries for OS X 10.9 desktop compiling # requires the following packages: # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev @@ -101,7 +123,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed - LIBS = -lraylib -lglfw3 -lglew32 -lopengl32 -lopenal32 -lgdi32 + LIBS = -lraylib -lglfw3 -lglew32 -lopengl32 -lopenal32 -lgdi32 endif endif ifeq ($(PLATFORM),PLATFORM_RPI) @@ -114,7 +136,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB) endif # define additional parameters and flags for windows -ifeq ($(PLATFORM),PLATFORM_DESKTOP) +ifeq ($(PLATFORM_OS),WINDOWS) # resources file contains windows exe icon # -Wl,--subsystem,windows hides the console window WINFLAGS = ../src/resources -Wl,--subsystem,windows @@ -290,10 +312,11 @@ audio_music_stream: audio_music_stream.c # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) - ifeq ($(SUBPLATFORM),OSX) + ifeq ($(PLATFORM_OS),OSX) + find . -type f -perm +ugo+x -delete rm -f *.o else - ifeq ($(SUBPLATFORM),LINUX) + ifeq ($(PLATFORM_OS),LINUX) find . -type f -executable -delete rm -f *.o else |
