summaryrefslogtreecommitdiffhomepage
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile48
-rw-r--r--examples/Makefile.Android36
2 files changed, 30 insertions, 54 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 14c7ec9e..cb015fa7 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -26,7 +26,7 @@
# Define required raylib variables
PROJECT_NAME ?= raylib_examples
RAYLIB_VERSION ?= 2.5.0
-RAYLIB_API_VERSION ?= 1
+RAYLIB_API_VERSION ?= 2
RAYLIB_PATH ?= ..
# Define default options
@@ -62,8 +62,6 @@ USE_EXTERNAL_GLFW ?= FALSE
# by default it uses X11 windowing system
USE_WAYLAND_DISPLAY ?= FALSE
-# NOTE: On PLATFORM_WEB OpenAL Soft backend is used by default (check raylib/src/Makefile)
-
# Determine PLATFORM_OS in case PLATFORM_DESKTOP selected
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
# No uname.exe on MinGW!, but OS=Windows_NT on Windows!
@@ -127,27 +125,8 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
endif
# Define raylib release directory for compiled library.
-# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version.
-ifeq ($(PLATFORM),PLATFORM_DESKTOP)
- ifeq ($(PLATFORM_OS),WINDOWS)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
- endif
- ifeq ($(PLATFORM_OS),LINUX)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
- endif
- ifeq ($(PLATFORM_OS),OSX)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
- endif
- ifeq ($(PLATFORM_OS),BSD)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
- endif
-endif
-ifeq ($(PLATFORM),PLATFORM_RPI)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-endif
-ifeq ($(PLATFORM),PLATFORM_WEB)
- RAYLIB_RELEASE_PATH = $(RAYLIB_PATH)/src
-endif
+# RAYLIB_RELEASE_PATH points to provided binaries or your freshly built version
+RAYLIB_RELEASE_PATH ?= $(RAYLIB_PATH)/src
# EXAMPLE_RUNTIME_PATH embeds a custom runtime location of libraylib.so or other desired libraries
# into each example binary compiled with RAYLIB_LIBTYPE=SHARED. It defaults to RAYLIB_RELEASE_PATH
@@ -155,7 +134,7 @@ endif
# without formal installation from ../src/Makefile. It aids portability and is useful if you have
# multiple versions of raylib, have raylib installed to a non-standard location, or want to
# bundle libraylib.so with your game. Change it to your liking.
-# Note: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
+# NOTE: If, at runtime, there is a libraylib.so at both EXAMPLE_RUNTIME_PATH and RAYLIB_INSTALL_PATH,
# The library at EXAMPLE_RUNTIME_PATH, if present, will take precedence over RAYLIB_INSTALL_PATH,
# Implemented for LINUX below with CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
# To see the result, run readelf -d core/core_basic_window; looking at the RPATH or RUNPATH attribute.
@@ -185,8 +164,9 @@ ifeq ($(PLATFORM),PLATFORM_RPI)
endif
endif
ifeq ($(PLATFORM),PLATFORM_WEB)
- # WARNING: To compile to HTML5, code must be redesigned to use emscripten.h and emscripten_set_main_loop()
# HTML5 emscripten compiler
+ # WARNING: To compile to HTML5, code must be redesigned
+ # to use emscripten.h and emscripten_set_main_loop()
CC = emcc
endif
@@ -224,11 +204,11 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
ifeq ($(PLATFORM_OS),LINUX)
ifeq ($(RAYLIB_LIBTYPE),STATIC)
- CFLAGS += -D_DEFAULT_SOURCE
+ CFLAGS += -D_DEFAULT_SOURCE
endif
ifeq ($(RAYLIB_LIBTYPE),SHARED)
- # Explicitly enable runtime link to libraylib.so
- CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
+ # Explicitly enable runtime link to libraylib.so
+ CFLAGS += -Wl,-rpath,$(EXAMPLE_RUNTIME_PATH)
endif
endif
endif
@@ -363,7 +343,7 @@ ifeq ($(PLATFORM),PLATFORM_WEB)
LDLIBS = $(RAYLIB_RELEASE_PATH)/libraylib.bc
endif
-# Define all object files required
+# Define all source files required
EXAMPLES = \
core/core_basic_window \
core/core_input_keys \
@@ -477,12 +457,6 @@ else
$(CC) -o $@$(EXT) $< $(CFLAGS) $(INCLUDE_PATHS) $(LDFLAGS) $(LDLIBS) -D$(PLATFORM)
endif
-# fix dylib install path name for each executable (MAC)
-fix_dylib:
-ifeq ($(PLATFORM_OS),OSX)
- find . -type f -perm +ugo+x -print0 | xargs -t -0 -R 1 -I file install_name_tool -change libglfw.3.0.dylib ../external/glfw3/lib/osx/libglfw.3.0.dylib file
-endif
-
# Clean everything
clean:
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
@@ -490,7 +464,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
del *.o *.exe /s
endif
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 -fv
+ 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 -fv
endif
ifeq ($(PLATFORM_OS),OSX)
find . -type f -perm +ugo+x -delete
diff --git a/examples/Makefile.Android b/examples/Makefile.Android
index b6c68417..29d437b1 100644
--- a/examples/Makefile.Android
+++ b/examples/Makefile.Android
@@ -22,33 +22,33 @@
#**************************************************************************************************
# Define required raylib variables
-PLATFORM ?= PLATFORM_ANDROID
-RAYLIB_PATH ?= ..\..
+PLATFORM ?= PLATFORM_ANDROID
+RAYLIB_PATH ?= ..\..
# Define Android architecture (armeabi-v7a, arm64-v8a, x86, x86-64) and API version
-ANDROID_ARCH ?= ARM
-ANDROID_API_VERSION = 21
+ANDROID_ARCH ?= ARM
+ANDROID_API_VERSION = 21
ifeq ($(ANDROID_ARCH),ARM)
- ANDROID_ARCH_NAME = armeabi-v7a
+ ANDROID_ARCH_NAME = armeabi-v7a
endif
ifeq ($(ANDROID_ARCH),ARM64)
- ANDROID_ARCH_NAME = arm64-v8a
+ ANDROID_ARCH_NAME = arm64-v8a
endif
# Required path variables
# NOTE: JAVA_HOME must be set to JDK
-JAVA_HOME ?= C:/JavaJDK
-ANDROID_HOME = C:/android-sdk
-ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
-ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1
-ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
+JAVA_HOME ?= C:/JavaJDK
+ANDROID_HOME = C:/android-sdk
+ANDROID_TOOLCHAIN = C:/android_toolchain_$(ANDROID_ARCH)_API$(ANDROID_API_VERSION)
+ANDROID_BUILD_TOOLS = $(ANDROID_HOME)/build-tools/28.0.1
+ANDROID_PLATFORM_TOOLS = $(ANDROID_HOME)/platform-tools
# Android project configuration variables
-PROJECT_NAME ?= raylib_game
-PROJECT_LIBRARY_NAME ?= main
-PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME)
+PROJECT_NAME ?= raylib_game
+PROJECT_LIBRARY_NAME ?= main
+PROJECT_BUILD_PATH ?= android.$(PROJECT_NAME)
PROJECT_RESOURCES_PATH ?= resources
-PROJECT_SOURCE_FILES ?= raylib_game.c
+PROJECT_SOURCE_FILES ?= raylib_game.c
# Some source files are placed in directories, when compiling to some
# output directory other than source, that directory must pre-exist.
@@ -70,7 +70,9 @@ APP_KEYSTORE_PASS ?= raylib
# Library type used for raylib: STATIC (.a) or SHARED (.so/.dll)
RAYLIB_LIBTYPE ?= STATIC
-RAYLIB_LIB_PATH = $(RAYLIB_PATH)\release\libs\android\$(ANDROID_ARCH_NAME)
+
+# Library path for libraylib.a/libraylib.so
+RAYLIB_LIB_PATH = $(RAYLIB_PATH)\src
# Shared libs must be added to APK if required
# NOTE: Generated NativeLoader.java automatically load those libraries
@@ -104,7 +106,7 @@ CFLAGS += -Wall -Wa,--noexecstack -Wformat -Werror=format-security -no-canonical
CFLAGS += -DANDROID -DPLATFORM_ANDROID -D__ANDROID_API__=$(ANDROID_API_VERSION)
# Paths containing required header files
-INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/release/include -I$(RAYLIB_PATH)/src/external/android/native_app_glue
+INCLUDE_PATHS = -I. -I$(RAYLIB_PATH)/src -I$(RAYLIB_PATH)/src/external/android/native_app_glue
# Linker options
LDFLAGS = -Wl,-soname,lib$(PROJECT_LIBRARY_NAME).so -Wl,--exclude-libs,libatomic.a