diff options
| author | raysan5 <raysan5@gmail.com> | 2015-01-02 20:59:05 +0100 |
|---|---|---|
| committer | raysan5 <raysan5@gmail.com> | 2015-01-02 20:59:05 +0100 |
| commit | 7ea8326b52f596d16fe059d34ce6673c4b401f90 (patch) | |
| tree | f9cb3b164c870ed47e42d4a9dc3f9f7a828ea434 /src/makefile | |
| parent | 8847602061d964592c468757eb535770771af1f0 (diff) | |
| download | raylib-7ea8326b52f596d16fe059d34ce6673c4b401f90.tar.gz raylib-7ea8326b52f596d16fe059d34ce6673c4b401f90.zip | |
makefiles reorganization
Edited to better accomodate to multiple platforms
Diffstat (limited to 'src/makefile')
| -rw-r--r-- | src/makefile | 43 |
1 files changed, 29 insertions, 14 deletions
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 |
