From 8dc60d0b87d77db1effa7ba1c6003775affc16db Mon Sep 17 00:00:00 2001 From: radius Date: Sat, 10 Oct 2020 03:52:22 +0000 Subject: [PATCH] update makefile --- libretro/Makefile | 35 +++++++++++++++++++++++++++++++++-- libretro/Makefile.common | 2 ++ libretro/jni/Android.mk | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/libretro/Makefile b/libretro/Makefile index 366ec17..c72b1f7 100644 --- a/libretro/Makefile +++ b/libretro/Makefile @@ -51,7 +51,7 @@ ifeq ($(platform), win) INCFLAGS += -I Windows endif -CORE_DIR += .. +CORE_DIR = ../ TARGET_NAME = sameboy LIBM = -lm @@ -90,7 +90,38 @@ else ifeq ($(platform), linux-portable) TARGET := $(TARGET_NAME)_libretro.$(EXT) fpic := -fPIC -nostdlib SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T - LIBM := + LIBM := +# (armv7 a7, hard point, neon based) ### +# NESC, SNESC, C64 mini +else ifeq ($(platform), classic_armv7_a7) + TARGET := $(TARGET_NAME)_libretro.so + fpic := -fPIC + SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined + CFLAGS += -Ofast \ + -flto=4 -fwhole-program -fuse-linker-plugin \ + -fdata-sections -ffunction-sections -Wl,--gc-sections \ + -fno-stack-protector -fno-ident -fomit-frame-pointer \ + -falign-functions=1 -falign-jumps=1 -falign-loops=1 \ + -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-unroll-loops \ + -fmerge-all-constants -fno-math-errno \ + -marm -mtune=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard + CXXFLAGS += $(CFLAGS) + CPPFLAGS += $(CFLAGS) + ASFLAGS += $(CFLAGS) + HAVE_NEON = 1 + ARCH = arm + BUILTIN_GPU = neon + USE_DYNAREC = 1 + ifeq ($(shell echo `$(CC) -dumpversion` "< 4.9" | bc -l), 1) + CFLAGS += -march=armv7-a + else + CFLAGS += -march=armv7ve + # If gcc is 5.0 or later + ifeq ($(shell echo `$(CC) -dumpversion` ">= 5" | bc -l), 1) + LDFLAGS += -static-libgcc -static-libstdc++ + endif + endif +####################################### # Nintendo Switch (libtransistor) else ifeq ($(platform), switch) TARGET := $(TARGET_NAME)_libretro_$(platform).a diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 7f7688a..430c03d 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -1,3 +1,5 @@ +VERSION := 0.13.6 + INCFLAGS := -I$(CORE_DIR) SOURCES_C := $(CORE_DIR)/Core/gb.c \ diff --git a/libretro/jni/Android.mk b/libretro/jni/Android.mk index 3b2d74b..e0646b9 100644 --- a/libretro/jni/Android.mk +++ b/libretro/jni/Android.mk @@ -8,7 +8,7 @@ include $(CORE_DIR)/libretro/Makefile.common GENERATED_SOURCES := $(filter %_boot.c,$(SOURCES_C)) -COREFLAGS := -DINLINE=inline -D__LIBRETRO__ -DGB_INTERNAL $(INCFLAGS) -DSAMEBOY_CORE_VERSION=\"$(VERSION)\" -Wno-multichar +COREFLAGS := -DINLINE=inline -D__LIBRETRO__ -DGB_INTERNAL $(INCFLAGS) -DSAMEBOY_CORE_VERSION=\"$(VERSION)\" -Wno-multichar -DANDROID GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" ifneq ($(GIT_VERSION)," unknown")