From ab05ace3ce8b999ab665194e63b8b5d03a7787ac Mon Sep 17 00:00:00 2001 From: ratalaika Date: Sat, 22 Nov 2014 00:13:09 +0100 Subject: Added first version of OS X compilation support --- src/makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index 0c078e86..780aa16b 100644 --- a/src/makefile +++ b/src/makefile @@ -24,8 +24,8 @@ #************************************************************************************************** # define raylib platform (by default, compile for RPI) -# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX -PLATFORM ?= PLATFORM_RPI +# Other possible platforms: PLATFORM_DESKTOP PLATFORM_DESKTOP_LINUX PLATFORM_DESKTOP_OSX +PLATFORM ?= PLATFORM_DESKTOP_OSX # define raylib graphics api depending on selected platform ifeq ($(PLATFORM),PLATFORM_RPI) @@ -57,7 +57,7 @@ endif ifeq ($(PLATFORM),PLATFORM_RPI) INCLUDES = -I. -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads else - INCLUDES = -I. + INCLUDES = -I. -I../external/glfw3/include/ -I../external/openal_soft/include/ endif # define all object files required @@ -123,9 +123,13 @@ else ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) find . -type f -executable -delete rm -f *.o libraylib.a +else +ifeq ($(PLATFORM),PLATFORM_DESKTOP_OSX) + rm -f *.o libraylib.a else del *.o libraylib.a endif +endif endif @echo Cleaning done -- cgit v1.2.3 From 7ea8326b52f596d16fe059d34ce6673c4b401f90 Mon Sep 17 00:00:00 2001 From: raysan5 Date: Fri, 2 Jan 2015 20:59:05 +0100 Subject: makefiles reorganization Edited to better accomodate to multiple platforms --- src/makefile | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index ed595f64..6f402713 100644 --- a/src/makefile +++ b/src/makefile @@ -25,6 +25,23 @@ # possible platforms: PLATFORM_DESKTOP PLATFORM_RPI PLATFORM_WEB PLATFORM ?= PLATFORM_DESKTOP +# determine SUBPLATFORM 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 + else + UNAMEOS = $(shell uname -s) + ifeq ($(UNAMEOS),Linux) + SUBPLATFORM=LINUX + else + ifeq ($(UNAMEOS),Darwin) + SUBPLATFORM=OSX + endif + endif + endif +endif + # define raylib graphics api depending on selected platform ifeq ($(PLATFORM),PLATFORM_RPI) # define raylib graphics api to use (on RPI, OpenGL ES 2.0 must be used) @@ -34,7 +51,6 @@ else GRAPHICS ?= GRAPHICS_API_OPENGL_11 #GRAPHICS = GRAPHICS_API_OPENGL_33 # Uncomment to use OpenGL 3.3 endif - ifeq ($(PLATFORM),PLATFORM_WEB) GRAPHICS = GRAPHICS_API_OPENGL_ES2 endif @@ -127,23 +143,22 @@ stb_vorbis.o: stb_vorbis.c # clean everything clean: +ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(SUBPLATFORM),LINUX) + find . -type f -executable -delete + rm -f *.o libraylib.a + endif + ifeq ($(SUBPLATFORM),OSX) + rm -f *.o libraylib.a + else + del *.o libraylib.a + endif +endif ifeq ($(PLATFORM),PLATFORM_RPI) rm -f *.o libraylib.a -else -ifeq ($(PLATFORM),PLATFORM_DESKTOP_LINUX) - find . -type f -executable -delete - rm -f *.o libraylib.a -else -ifeq ($(PLATFORM),PLATFORM_DESKTOP_OSX) - rm -f *.o libraylib.a -else +endif ifeq ($(PLATFORM),PLATFORM_WEB) del *.o libraylib.bc -else - del *.o libraylib.a -endif -endif -endif endif @echo Cleaning done -- cgit v1.2.3 From 4a7e522d4bb376d2277895d1d99eb0382f8bbefb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 4 Jan 2015 18:05:50 +0100 Subject: Review build system for Android and RPI --- src/makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/makefile') diff --git a/src/makefile b/src/makefile index 6f402713..8566abe4 100644 --- a/src/makefile +++ b/src/makefile @@ -31,7 +31,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) ifeq ($(OS),Windows_NT) SUBPLATFORM=WINDOWS else - UNAMEOS = $(shell uname -s) + UNAMEOS:=$(shell uname) ifeq ($(UNAMEOS),Linux) SUBPLATFORM=LINUX else @@ -144,15 +144,16 @@ stb_vorbis.o: stb_vorbis.c # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(SUBPLATFORM),OSX) + rm -f *.o libraylib.a + else ifeq ($(SUBPLATFORM),LINUX) find . -type f -executable -delete rm -f *.o libraylib.a - endif - ifeq ($(SUBPLATFORM),OSX) - rm -f *.o libraylib.a else del *.o libraylib.a endif + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) rm -f *.o libraylib.a -- cgit v1.2.3