Commit 67adf098 authored by Steel01's avatar Steel01
Browse files

Fix up android jni makefiles

This required some tweaks to the common makefile
parent d0e4a2c4
# ChaiLove
SOURCES_CXX += $(wildcard \
src/*.cpp \
src/love/*.cpp \
src/love/Types/Audio/*.cpp \
src/love/Types/FileSystem/*.cpp \
src/love/Types/Graphics/*.cpp \
src/love/Types/Input/*.cpp \
src/love/Types/Config/*.cpp \
test/native/*.cpp \
SOURCES_CXX := $(wildcard \
$(CORE_DIR)/src/*.cpp \
$(CORE_DIR)/src/love/*.cpp \
$(CORE_DIR)/src/love/Types/Audio/*.cpp \
$(CORE_DIR)/src/love/Types/FileSystem/*.cpp \
$(CORE_DIR)/src/love/Types/Graphics/*.cpp \
$(CORE_DIR)/src/love/Types/Input/*.cpp \
$(CORE_DIR)/src/love/Types/Config/*.cpp \
$(CORE_DIR)/test/native/*.cpp \
)
# semver
FLAGS += -Ivendor/semver
SOURCES_C += vendor/semver/semver.c
FLAGS := -I$(CORE_DIR)/vendor/semver
SOURCES_C := $(CORE_DIR)/vendor/semver/semver.c
# random
FLAGS += -Ivendor/random/include
FLAGS += -I$(CORE_DIR)/vendor/random/include
# filesystem
FLAGS += -Ivendor/filesystem
FLAGS += -I$(CORE_DIR)/vendor/filesystem
# libretro-common
FLAGS += -Ivendor/libretro-common/include
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
# zlib
SOURCES_C += \
vendor/zlib/zutil.c \
vendor/zlib/adler32.c \
vendor/zlib/crc32.c \
vendor/zlib/compress.c \
vendor/zlib/deflate.c \
vendor/zlib/gzclose.c \
vendor/zlib/gzlib.c \
vendor/zlib/gzread.c \
vendor/zlib/gzwrite.c \
vendor/zlib/infback.c \
vendor/zlib/inffast.c \
vendor/zlib/inftrees.c \
vendor/zlib/inflate.c \
vendor/zlib/trees.c
FLAGS += -Ivendor/zlib
$(CORE_DIR)/vendor/zlib/zutil.c \
$(CORE_DIR)/vendor/zlib/adler32.c \
$(CORE_DIR)/vendor/zlib/crc32.c \
$(CORE_DIR)/vendor/zlib/compress.c \
$(CORE_DIR)/vendor/zlib/deflate.c \
$(CORE_DIR)/vendor/zlib/gzclose.c \
$(CORE_DIR)/vendor/zlib/gzlib.c \
$(CORE_DIR)/vendor/zlib/gzread.c \
$(CORE_DIR)/vendor/zlib/gzwrite.c \
$(CORE_DIR)/vendor/zlib/infback.c \
$(CORE_DIR)/vendor/zlib/inffast.c \
$(CORE_DIR)/vendor/zlib/inftrees.c \
$(CORE_DIR)/vendor/zlib/inflate.c \
$(CORE_DIR)/vendor/zlib/trees.c
FLAGS += -I$(CORE_DIR)/vendor/zlib
FLAGS += -DWANT_ZLIB
# PhysFS
FLAGS += -Ivendor/physfs/src
FLAGS += -Ivendor/physfs/extras
FLAGS += -I$(CORE_DIR)/vendor/physfs/src
FLAGS += -I$(CORE_DIR)/vendor/physfs/extras
FLAGS += -DPHYSFS_NO_CDROM_SUPPORT=1
SOURCES_C += $(wildcard \
vendor/physfs/extras/physfsrwops.c \
vendor/physfs/src/*.c \
$(CORE_DIR)/vendor/physfs/extras/physfsrwops.c \
$(CORE_DIR)/vendor/physfs/src/*.c \
)
ifeq ($(platform), osx)
# LDFLAGS += -mmacosx-version-min=10.2
......@@ -58,21 +58,21 @@ ifeq ($(platform), osx)
endif
# SDL_tty
FLAGS += -Ivendor/SDL_tty/include
FLAGS += -I$(CORE_DIR)/vendor/SDL_tty/include
SOURCES_C += $(wildcard \
vendor/SDL_tty/src/SDL_tty.c \
vendor/SDL_tty/src/SDL_fnt.c \
$(CORE_DIR)/vendor/SDL_tty/src/SDL_tty.c \
$(CORE_DIR)/vendor/SDL_tty/src/SDL_fnt.c \
)
# SDL_gfx
FLAGS += -Ivendor/sdl-libretro/tests/SDL_gfx-2.0.26
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26
SOURCES_C += $(wildcard \
vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_gfx-2.0.26/*.c \
)
# FreeType2
# See https://github.com/emscripten-ports/FreeType/blob/master/builds/amiga/makefile
FLAGS += -Ivendor/freetype2/include
FLAGS += -I$(CORE_DIR)/vendor/freetype2/include
FLAGS += -DFT2_BUILD_LIBRARY \
-DFT_USE_AUTOFIT \
-DFT_USE_RASTER \
......@@ -86,63 +86,63 @@ FLAGS += -DFT2_BUILD_LIBRARY \
-DFT_USE_GXV
SOURCES_C += \
vendor/freetype2/src/base/ftbase.c \
vendor/freetype2/src/base/ftinit.c \
vendor/freetype2/src/base/ftsystem.c \
vendor/freetype2/src/base/ftdebug.c \
vendor/freetype2/src/base/ftbbox.c \
vendor/freetype2/src/base/ftbdf.c \
vendor/freetype2/src/base/ftstroke.c \
vendor/freetype2/src/base/ftbitmap.c \
vendor/freetype2/src/base/ftcid.c \
vendor/freetype2/src/base/ftfntfmt.c \
vendor/freetype2/src/base/ftfstype.c \
vendor/freetype2/src/base/ftgasp.c \
vendor/freetype2/src/base/ftglyph.c \
vendor/freetype2/src/base/ftgxval.c \
vendor/freetype2/src/base/ftlcdfil.c \
vendor/freetype2/src/base/ftmm.c \
vendor/freetype2/src/base/ftotval.c \
vendor/freetype2/src/base/ftpatent.c \
vendor/freetype2/src/base/ftpfr.c \
vendor/freetype2/src/base/ftsynth.c \
vendor/freetype2/src/base/fttype1.c \
vendor/freetype2/src/base/ftwinfnt.c \
vendor/freetype2/src/autofit/autofit.c \
vendor/freetype2/src/pshinter/pshinter.c \
vendor/freetype2/src/psaux/psaux.c \
vendor/freetype2/src/psnames/psnames.c \
vendor/freetype2/src/raster/raster.c \
vendor/freetype2/src/smooth/smooth.c \
vendor/freetype2/src/cache/ftcache.c \
vendor/freetype2/src/bdf/bdf.c \
vendor/freetype2/src/cff/cff.c \
vendor/freetype2/src/pcf/pcf.c \
vendor/freetype2/src/winfonts/winfnt.c \
vendor/freetype2/src/sfnt/sfnt.c \
vendor/freetype2/src/pfr/pfr.c \
vendor/freetype2/src/truetype/truetype.c \
vendor/freetype2/src/type1/type1.c \
vendor/freetype2/src/type42/type42.c \
vendor/freetype2/src/cid/type1cid.c \
vendor/freetype2/src/gzip/ftgzip.c \
vendor/freetype2/src/bzip2/ftbzip2.c \
vendor/freetype2/src/lzw/ftlzw.c
$(CORE_DIR)/vendor/freetype2/src/base/ftbase.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftinit.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftsystem.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftdebug.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbbox.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbdf.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftstroke.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftbitmap.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftcid.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftfntfmt.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftfstype.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftgasp.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftglyph.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftgxval.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftlcdfil.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftmm.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftotval.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftpatent.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftpfr.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftsynth.c \
$(CORE_DIR)/vendor/freetype2/src/base/fttype1.c \
$(CORE_DIR)/vendor/freetype2/src/base/ftwinfnt.c \
$(CORE_DIR)/vendor/freetype2/src/autofit/autofit.c \
$(CORE_DIR)/vendor/freetype2/src/pshinter/pshinter.c \
$(CORE_DIR)/vendor/freetype2/src/psaux/psaux.c \
$(CORE_DIR)/vendor/freetype2/src/psnames/psnames.c \
$(CORE_DIR)/vendor/freetype2/src/raster/raster.c \
$(CORE_DIR)/vendor/freetype2/src/smooth/smooth.c \
$(CORE_DIR)/vendor/freetype2/src/cache/ftcache.c \
$(CORE_DIR)/vendor/freetype2/src/bdf/bdf.c \
$(CORE_DIR)/vendor/freetype2/src/cff/cff.c \
$(CORE_DIR)/vendor/freetype2/src/pcf/pcf.c \
$(CORE_DIR)/vendor/freetype2/src/winfonts/winfnt.c \
$(CORE_DIR)/vendor/freetype2/src/sfnt/sfnt.c \
$(CORE_DIR)/vendor/freetype2/src/pfr/pfr.c \
$(CORE_DIR)/vendor/freetype2/src/truetype/truetype.c \
$(CORE_DIR)/vendor/freetype2/src/type1/type1.c \
$(CORE_DIR)/vendor/freetype2/src/type42/type42.c \
$(CORE_DIR)/vendor/freetype2/src/cid/type1cid.c \
$(CORE_DIR)/vendor/freetype2/src/gzip/ftgzip.c \
$(CORE_DIR)/vendor/freetype2/src/bzip2/ftbzip2.c \
$(CORE_DIR)/vendor/freetype2/src/lzw/ftlzw.c
# SDL_ttf
FLAGS += -Ivendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
SOURCES_C += vendor/sdl-libretro/tests/SDL_ttf-2.0.11/SDL_ttf.c
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/VisualC/external/include
SOURCES_C += $(CORE_DIR)/vendor/sdl-libretro/tests/SDL_ttf-2.0.11/SDL_ttf.c
# SDL_stbimage
FLAGS += -Ivendor/Snippets
FLAGS += -I$(CORE_DIR)/vendor/Snippets
# STB
FLAGS += -Ivendor/stb
FLAGS += -I$(CORE_DIR)/vendor/stb
# ChaiScript
ifeq ($(HAVE_CHAISCRIPT),)
FLAGS += -Ivendor/chaiscript/include
FLAGS += -Ivendor/ChaiScript_Extras/include
FLAGS += -I$(CORE_DIR)/vendor/chaiscript/include
FLAGS += -I$(CORE_DIR)/vendor/ChaiScript_Extras/include
FLAGS += -D__HAVE_CHAISCRIPT__
FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
endif
......@@ -151,19 +151,13 @@ endif
ifeq ($(platform), win)
SOURCES_C += $(wildcard ./vendor/sdl-libretro/src/*.c ./vendor/sdl-libretro/src/audio/*.c ./vendor/sdl-libretro/src/cdrom/dummy/*.c ./vendor/sdl-libretro/src/cdrom/*.c ./vendor/sdl-libretro/src/cpuinfo/*.c ./vendor/sdl-libretro/src/events/*.c ./vendor/sdl-libretro/src/file/*.c ./vendor/sdl-libretro/src/stdlib/*.c ./vendor/sdl-libretro/src/thread/*.c ./vendor/sdl-libretro/src/timer/*.c ./vendor/sdl-libretro/src/video/*.c ./vendor/sdl-libretro/src/joystick/*.c ./vendor/sdl-libretro/src/video/libretro/*.c ./vendor/sdl-libretro/src/joystick/libretro/*.c ./vendor/sdl-libretro/src/timer/libretro/*.c ./vendor/sdl-libretro/src/audio/libretro/*.c ./vendor/sdl-libretro/src/thread/win32/SDL_sysmutex.c ./vendor/sdl-libretro/src/thread/win32/SDL_syssem.c ./vendor/sdl-libretro/src/thread/win32/SDL_systhread.c ./vendor/sdl-libretro/src/thread/generic/SDL_syscond.c ./vendor/sdl-libretro/src/loadso/dummy/*.c)
else
SOURCES_C += $(wildcard ./vendor/sdl-libretro/src/*.c ./vendor/sdl-libretro/src/audio/*.c ./vendor/sdl-libretro/src/cdrom/dummy/*.c ./vendor/sdl-libretro/src/cdrom/*.c ./vendor/sdl-libretro/src/cpuinfo/*.c ./vendor/sdl-libretro/src/events/*.c ./vendor/sdl-libretro/src/file/*.c ./vendor/sdl-libretro/src/stdlib/*.c ./vendor/sdl-libretro/src/thread/*.c ./vendor/sdl-libretro/src/timer/*.c ./vendor/sdl-libretro/src/video/*.c ./vendor/sdl-libretro/src/joystick/*.c ./vendor/sdl-libretro/src/video/libretro/*.c ./vendor/sdl-libretro/src/thread/generic/*.c ./vendor/sdl-libretro/src/joystick/libretro/*.c ./vendor/sdl-libretro/src/timer/libretro/*.c ./vendor/sdl-libretro/src/audio/libretro/*.c ./vendor/sdl-libretro/src/loadso/dummy/*.c)
SOURCES_C += $(wildcard $(CORE_DIR)/vendor/sdl-libretro/src/*.c $(CORE_DIR)/vendor/sdl-libretro/src/audio/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/dummy/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cdrom/*.c $(CORE_DIR)/vendor/sdl-libretro/src/cpuinfo/*.c $(CORE_DIR)/vendor/sdl-libretro/src/events/*.c $(CORE_DIR)/vendor/sdl-libretro/src/file/*.c $(CORE_DIR)/vendor/sdl-libretro/src/stdlib/*.c $(CORE_DIR)/vendor/sdl-libretro/src/thread/*.c $(CORE_DIR)/vendor/sdl-libretro/src/timer/*.c $(CORE_DIR)/vendor/sdl-libretro/src/video/*.c $(CORE_DIR)/vendor/sdl-libretro/src/joystick/*.c $(CORE_DIR)/vendor/sdl-libretro/src/video/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/thread/generic/*.c $(CORE_DIR)/vendor/sdl-libretro/src/joystick/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/timer/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/audio/libretro/*.c $(CORE_DIR)/vendor/sdl-libretro/src/loadso/dummy/*.c)
endif
FLAGS += -DSDL_THREADS_DISABLED -DSDL_CDROM_DISABLED
FLAGS += -Ivendor/sdl-libretro/include
FLAGS += -I$(CORE_DIR)/vendor/sdl-libretro/include
OBJECTS += $(SOURCES_CXX:.cpp=.o) $(SOURCES_C:.c=.o)
ifeq ($(DEBUG), 0)
FLAGS += -O3 -ffast-math -fomit-frame-pointer
else
FLAGS += -O0 -g
endif
LDFLAGS += $(fpic) $(SHARED) $(EXTRA_LDF)
WARNINGS :=
......
......@@ -545,6 +545,12 @@ CORE_DIR := .
include Makefile.common
ifeq ($(DEBUG), 0)
FLAGS += -O3 -ffast-math -fomit-frame-pointer
else
FLAGS += -O0 -g
endif
CFLAGS += -DWANT_GRIFFIN
DEFINES := $(COREDEFINES) $(PLATFORM_DEFINES)
......
HAVE_GRIFFIN := 0
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
LOCAL_CXXFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
CORE_DIR = $(LOCAL_PATH)/..
CORE_DIR = ..
JIT=
DESMUME_JIT=0
include $(CORE_DIR)/Makefile.common
ifeq ($(TARGET_ARCH),arm)
LOCAL_CXXFLAGS := -DANDROID_ARM
LOCAL_ARM_MODE := arm
COREFLAGS := -D__LIBRETRO__ -DANDROID $(FLAGS)
DESMUME_JIT_ARM = 1
JIT = -D__RETRO_ARM__ -DHAVE_JIT
endif
ifeq ($(TARGET_ARCH),x86)
LOCAL_CXXFLAGS := -DANDROID_X86
DESMUME_JIT = 1
JIT = -DHAVE_JIT
endif
ifeq ($(TARGET_ARCH),mips)
LOCAL_CXXFLAGS := -DANDROID_MIPS -D__mips__ -D__MIPSEL__
endif
ifeq ($(TARGET_ARCH),mips64)
LOCAL_CXXFLAGS := -DANDROID_MIPS -D__mips__ -D__MIPSEL__
GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)"
ifneq ($(GIT_VERSION)," unknown")
COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\"
endif
LOCAL_MODULE := libretro
include ../Makefile.common
LOCAL_SRC_FILES := $(SOURCES_CXX) $(SOURCES_C)
GLOBAL_DEFINES := $(JIT) -fexceptions
LOCAL_CXXFLAGS += -O3 -D__LIBRETRO__ -Wno-write-strings -DANDROID -DFRONTEND_SUPPORTS_RGB565 $(GLOBAL_DEFINES) $(INCDIR)
LOCAL_CFLAGS = -O3 -D__LIBRETRO__ -Wno-psabi -Wno-write-strings -DANDROID -DFRONTEND_SUPPORTS_RGB565 $(GLOBAL_DEFINES) $(INCDIR)
LOCAL_C_INCLUDES = -I$(CORE_DIR)/libretro/zlib -iquote $(CORE_DIR) -iquote $(CORE_DIR)/libretro
LOCAL_LDLIBS += -lz
include $(CLEAR_VARS)
LOCAL_MODULE := retro
LOCAL_SRC_FILES := $(SOURCES_CXX) $(SOURCES_C)
LOCAL_CXXFLAGS := $(COREFLAGS) -std=c++14
LOCAL_CFLAGS := $(COREFLAGS)
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T
LOCAL_CPP_FEATURES := exceptions rtti
include $(BUILD_SHARED_LIBRARY)
APP_STL := gnustl_static
APP_ABI := all
APP_STL := c++_static
APP_ABI := armeabi armeabi-v7a arm64-v8a x86 x86_64
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment