diff options
| author | Ray <raysan5@gmail.com> | 2016-06-06 20:46:06 +0200 |
|---|---|---|
| committer | Ray <raysan5@gmail.com> | 2016-06-06 20:46:06 +0200 |
| commit | 1c98e6b698b8002e0c6c769c6d9f23a6e15f3bdf (patch) | |
| tree | 0aba231bb77034cae38dc44e39d53b63197c6a2c /templates/basic_test | |
| parent | 75a73d94171051037fcf670852877977d9251520 (diff) | |
| parent | 4dada3269374a82fa2c4a06bd29dfc0f37a64380 (diff) | |
| download | raylib-1c98e6b698b8002e0c6c769c6d9f23a6e15f3bdf.tar.gz raylib-1c98e6b698b8002e0c6c769c6d9f23a6e15f3bdf.zip | |
Merge pull request #125 from raysan5/develop
Develop branch integration
Diffstat (limited to 'templates/basic_test')
| -rw-r--r-- | templates/basic_test/Makefile (renamed from templates/basic_test/makefile) | 69 |
1 files changed, 41 insertions, 28 deletions
diff --git a/templates/basic_test/makefile b/templates/basic_test/Makefile index a0ed2608..b6fd44a7 100644 --- a/templates/basic_test/makefile +++ b/templates/basic_test/Makefile @@ -23,6 +23,8 @@ # #************************************************************************************************** +.PHONY: all clean + # define raylib platform to compile for # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB # WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop() @@ -82,30 +84,41 @@ 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 -IC:/raylib/raylib/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 +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 + # 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 -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 +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + # add standard directories for GNU/Linux + ifeq ($(PLATFORM_OS),LINUX) + LFLAGS = -L. -L../../src + else + LFLAGS = -L. -L../../src + ifeq ($(PLATFORM_OS),WINDOWS) + LFLAGS += -LC:/raylib/raylib/src + endif + # 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) + endif endif endif @@ -115,16 +128,15 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) 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 -lglfw3 -lGLEW -lGL -lopenal -lm -pthread - # on XWindow could require also below libraries, just uncomment - #LIBS += -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor + # libglfw3-dev libopenal-dev libegl1-mesa-dev + 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 # requires the following packages: - # libglfw3-dev libopenal-dev libglew-dev libegl1-mesa-dev - LIBS = -lraylib -lglfw -framework OpenGL -framework OpenAl -framework Cocoa + # libglfw3-dev libopenal-dev libegl1-mesa-dev + LIBS = -lraylib -lglfw3 -framework OpenGL -framework OpenAl -framework Cocoa else # libraries for Windows desktop compiling # NOTE: GLFW3 and OpenAL Soft libraries should be installed @@ -153,9 +165,9 @@ ifeq ($(PLATFORM),PLATFORM_WEB) EXT = .html endif -# 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 basic_test -default: basic_test +all: basic_test # compile template - basic_test basic_test: basic_test.c @@ -169,7 +181,8 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) rm -f *.o else ifeq ($(PLATFORM_OS),LINUX) - find -type f -executable | xargs file -i | grep -E 'x-object|x-archive|x-sharedlib|x-executable' | rev | cut -d ':' -f 2- | rev | xargs rm -f + find . -type f -executable -delete + rm -f *.o else del *.o *.exe endif |
