mirror of
https://github.com/libretro/PokeMini.git
synced 2024-11-23 07:49:39 +00:00
1c74d02782
- Update Makefiles
92 lines
3.2 KiB
Makefile
92 lines
3.2 KiB
Makefile
##############
|
|
# Works on hosts Linux, Windows and Darwin
|
|
# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it
|
|
|
|
##########################
|
|
# Checks the host platform
|
|
|
|
HOST_PLATFORM = linux
|
|
ifeq ($(shell uname -a),)
|
|
HOST_PLATFORM = windows
|
|
else ifneq ($(findstring MINGW,$(shell uname -a)),)
|
|
HOST_PLATFORM = windows
|
|
else ifneq ($(findstring Darwin,$(shell uname -a)),)
|
|
HOST_PLATFORM = darwin
|
|
else ifneq ($(findstring win,$(shell uname -a)),)
|
|
HOST_PLATFORM = windows
|
|
endif
|
|
|
|
|
|
####################################
|
|
# Variable setup for Makefile.common
|
|
|
|
CORE_DIR ?= ..
|
|
BUILD_DIR ?= .
|
|
INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-21/arch-x86_64/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/4.9/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
|
|
|
|
include $(BUILD_DIR)/Makefile.common
|
|
|
|
#################
|
|
# Toolchain setup
|
|
|
|
CC = $(NDK_ROOT_DIR)/toolchains/x86_64-4.9/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-gcc
|
|
CXX = $(NDK_ROOT_DIR)/toolchains/x86_64-4.9/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-g++
|
|
AS = $(NDK_ROOT_DIR)/toolchains/x86_64-4.9/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-as
|
|
AR = $(NDK_ROOT_DIR)/toolchains/x86_64-4.9/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-ar
|
|
|
|
############
|
|
# Extensions
|
|
|
|
OBJEXT = .android_x86_64.o
|
|
SOEXT = .android_x86_64.so
|
|
|
|
################
|
|
# Platform setup
|
|
|
|
STATIC_LINKING = 0
|
|
platform = android
|
|
PLATDEFS = -DANDROID -DINLINE=inline -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST
|
|
PLATCFLAGS = -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security
|
|
PLATCXXFLAGS = -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti
|
|
PLATLDFLAGS = -shared --sysroot=$(NDK_ROOT_DIR)/platforms/android-21/arch-x86_64 -lgcc -no-canonical-prefixes -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm
|
|
PLATLDXFLAGS = -shared --sysroot=$(NDK_ROOT_DIR)/platforms/android-21/arch-x86_64 -lgcc -no-canonical-prefixes -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm $(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/4.9/libs/x86_64/libgnustl_static.a
|
|
|
|
################
|
|
# libretro setup
|
|
|
|
RETRODEFS = -D__LIBRETRO__
|
|
RETROCFLAGS =
|
|
RETROCXXFLAGS =
|
|
RETROLDFLAGS =
|
|
RETROLDXFLAGS =
|
|
|
|
#################
|
|
# Final variables
|
|
|
|
DEFINES = $(PLATDEFS) $(COREDEFINES) $(RETRODEFS)
|
|
CFLAGS = $(PLATCFLAGS) $(RETROCFLAGS) $(DEFINES) $(INCLUDES)
|
|
CXXFLAGS = $(PLATCXXFLAGS) $(RETROCXXFLAGS) $(DEFINES) $(INCLUDES)
|
|
LDFLAGS = $(PLATLDFLAGS) $(RETROLDFLAGS)
|
|
LDXFLAGS = $(PLATLDXFLAGS) $(RETROLDXFLAGS)
|
|
|
|
########
|
|
# Tuning
|
|
|
|
ifneq ($(DEBUG),)
|
|
CFLAGS += -O0 -g
|
|
CXXFLAGS += -O0 -g
|
|
else
|
|
CFLAGS += -O3 -DNDEBUG
|
|
CXXFLAGS += -O3 -DNDEBUG
|
|
endif
|
|
|
|
ifneq ($(LOG_PERFORMANCE),)
|
|
CFLAGS += -DLOG_PERFORMANCE
|
|
CXXFLAGS += -DLOG_PERFORMANCE
|
|
endif
|
|
|
|
###############
|
|
# Include rules
|
|
|
|
include $(BUILD_DIR)/Makefile.rules
|