Fixes Android builds on Linux environments (#1530)

* simple_game: Configure Make and makefile for Linux environments

* simple_game: Fix build issues on Android plaform with Linux HOST

The Makefile.Android.linux file was out of date with the rest of the
project, so this commit updates the paths, as well as leaving some as
optional, if it is already configured as an environment variable.

In addition, it corrects the build error related to static raylib:
the makefile was trying to generate libmain.so using the path of the
NDK libraries, instead of using those of the Android system, which
resulted in crashes in the generated apk.
This commit is contained in:
Davidson Francis 2021-01-13 19:07:34 -03:00 • committed by GitHub
commit 3d22709808
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -101,6 +101,15 @@ ifeq ($(PLATFORM),PLATFORM_DRM)
PLATFORM_OS=LINUX
endif
endif
ifeq ($(PLATFORM),PLATFORM_ANDROID)
UNAMEOS=$(shell uname)
ifeq ($(UNAMEOS),Linux)
PLATFORM_OS=LINUX
endif
ifeq ($(UNAMEOS),Darwin)
PLATFORM_OS=OSX
endif
endif
# RAYLIB_PATH adjustment for different platforms.
# If using GNU make, we can get the full path to the top of the tree. Windows? BSD?
@ -388,6 +397,15 @@ OBJS = $(patsubst %.c, %.o, $(PROJECT_SOURCE_FILES))
# For Android platform we call a custom Makefile.Android
ifeq ($(PLATFORM),PLATFORM_ANDROID)
MAKEFILE_PARAMS = -f Makefile.Android
# For Linux and macOS set make and makefile
ifeq ($(PLATFORM_OS),LINUX)
MAKE = make
MAKEFILE_PARAMS = -f Makefile.Android.linux
endif
ifeq ($(PLATFORM_OS),OSX)
MAKE = make
MAKEFILE_PARAMS = -f Makefile.Android.macos
endif
export PROJECT_NAME
export PROJECT_SOURCE_FILES
else