From 4a7e522d4bb376d2277895d1d99eb0382f8bbefb Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sun, 4 Jan 2015 18:05:50 +0100 Subject: [PATCH] Review build system for Android and RPI --- examples/makefile | 10 ++++++---- src/core.c | 14 +++++++------- src/makefile | 9 +++++---- src_android/jni/Android.mk | 1 - 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/examples/makefile b/examples/makefile index 4771d94de7c7..9763b2335053 100644 --- a/examples/makefile +++ b/examples/makefile @@ -32,7 +32,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 @@ -290,17 +290,19 @@ audio_music_stream: audio_music_stream.c # clean everything clean: ifeq ($(PLATFORM),PLATFORM_DESKTOP) + ifeq ($(SUBPLATFORM),OSX) + rm -f *.o + else ifeq ($(SUBPLATFORM),LINUX) find . -type f -executable -delete rm -f *.o - endif - ifeq ($(SUBPLATFORM),OSX) - rm -f *.o else del *.o *.exe endif + endif endif ifeq ($(PLATFORM),PLATFORM_RPI) + find . -type f -executable -delete rm -f *.o endif ifeq ($(PLATFORM),PLATFORM_WEB) diff --git a/src/core.c b/src/core.c index 65828c48b8a5..26b1dd6d68f9 100644 --- a/src/core.c +++ b/src/core.c @@ -170,7 +170,6 @@ static Matrix downscaleView; // Matrix to downscale view (in case #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_RPI) || defined(PLATFORM_WEB) static const char *windowTitle; // Window text title... -static char configFlags = 0; static bool customCursor = false; // Tracks if custom cursor has been set static bool cursorOnScreen = false; // Tracks if cursor is inside client area @@ -204,6 +203,7 @@ static double updateTime, drawTime; // Time measures for update and draw static double frameTime; // Time measure for one frame static double targetTime = 0.0; // Desired time for one frame, if 0 not applied +static char configFlags = 0; static bool showLogo = false; //---------------------------------------------------------------------------------- @@ -455,12 +455,6 @@ int GetScreenHeight(void) return screenHeight; } -// Get the last key pressed -int GetKeyPressed(void) -{ - return lastKeyPressed; -} - // Sets Background Color void ClearBackground(Color color) { @@ -674,6 +668,12 @@ bool IsKeyUp(int key) else return false; } +// Get the last key pressed +int GetKeyPressed(void) +{ + return lastKeyPressed; +} + // Detect if a mouse button has been pressed once bool IsMouseButtonPressed(int button) { diff --git a/src/makefile b/src/makefile index 6f402713ca50..8566abe4f3b0 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 diff --git a/src_android/jni/Android.mk b/src_android/jni/Android.mk index 56316b1746b9..73a2cc7f081d 100644 --- a/src_android/jni/Android.mk +++ b/src_android/jni/Android.mk @@ -40,7 +40,6 @@ LOCAL_SRC_FILES :=\ ../../src/core.c \ ../../src/rlgl.c \ ../../src/raymath.c \ - ../../src/stb_image.c \ ../../src/textures.c \ ../../src/text.c \ ../../src/shapes.c \