mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-07 02:10:48 +02:00
Update libretro build
This commit is contained in:
2
Makefile
2
Makefile
@@ -636,7 +636,7 @@ $(BIN)/BootROMs/%.bin: BootROMs/%.asm $(OBJ)/BootROMs/SameBoyLogo.pb12
|
|||||||
|
|
||||||
# Libretro Core (uses its own build system)
|
# Libretro Core (uses its own build system)
|
||||||
libretro:
|
libretro:
|
||||||
CFLAGS="$(WARNINGS)" $(MAKE) -C libretro BOOTROMS_DIR=$(abspath $(BOOTROMS_DIR))
|
CFLAGS="$(WARNINGS)" $(MAKE) -C libretro BOOTROMS_DIR=$(BOOTROMS_DIR) BIN=$(BIN)
|
||||||
|
|
||||||
# install for Linux/FreeDesktop/etc.
|
# install for Linux/FreeDesktop/etc.
|
||||||
# Does not install mimetype icons because FreeDesktop is cursed abomination with no right to exist.
|
# Does not install mimetype icons because FreeDesktop is cursed abomination with no right to exist.
|
||||||
|
@@ -188,7 +188,7 @@ endif
|
|||||||
|
|
||||||
DEFINES := -DIOS
|
DEFINES := -DIOS
|
||||||
ifeq ($(platform),ios-arm64)
|
ifeq ($(platform),ios-arm64)
|
||||||
CC = cc -arch armv64 -isysroot $(IOSSDK)
|
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
||||||
else
|
else
|
||||||
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
||||||
endif
|
endif
|
||||||
@@ -211,7 +211,7 @@ endif
|
|||||||
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
||||||
|
|
||||||
else ifneq (,$(findstring qnx,$(platform)))
|
else ifneq (,$(findstring qnx,$(platform)))
|
||||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||||
fpic := -fPIC
|
fpic := -fPIC
|
||||||
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
|
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
|
||||||
else ifeq ($(platform), emscripten)
|
else ifeq ($(platform), emscripten)
|
||||||
@@ -326,7 +326,15 @@ else
|
|||||||
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
|
SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TARGET := $(CORE_DIR)/build/bin/$(TARGET)
|
ifeq ($(STATIC_LINKING), 1)
|
||||||
|
# For some reason libretro's buildbot expects the output to be at ./libretro/ for static targets
|
||||||
|
BIN ?= $(realpath -m $(CORE_DIR)/libretro)
|
||||||
|
else
|
||||||
|
BIN ?= $(realpath -m $(CORE_DIR))
|
||||||
|
endif
|
||||||
|
override BIN := $(shell cd .. && realpath -m $(BIN))
|
||||||
|
TARGET := $(BIN)/$(TARGET)
|
||||||
|
|
||||||
|
|
||||||
# To force use of the Unix version instead of the Windows version
|
# To force use of the Unix version instead of the Windows version
|
||||||
MKDIR := $(shell which mkdir)
|
MKDIR := $(shell which mkdir)
|
||||||
@@ -365,6 +373,8 @@ CFLAGS += -D__LIBRETRO__ $(fpic) $(INCFLAGS) -std=gnu11 -D_GNU_SOURCE -D_USE_M
|
|||||||
|
|
||||||
all: $(TARGET)
|
all: $(TARGET)
|
||||||
|
|
||||||
|
override BOOTROMS_DIR := $(shell cd .. && realpath -m $(BOOTROMS_DIR))
|
||||||
|
|
||||||
$(CORE_DIR)/libretro/%_boot.c: $(BOOTROMS_DIR)/%_boot.bin
|
$(CORE_DIR)/libretro/%_boot.c: $(BOOTROMS_DIR)/%_boot.bin
|
||||||
echo "/* AUTO-GENERATED */" > $@
|
echo "/* AUTO-GENERATED */" > $@
|
||||||
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
||||||
|
@@ -7,15 +7,10 @@
|
|||||||
# Core definitions
|
# Core definitions
|
||||||
.core-defs:
|
.core-defs:
|
||||||
variables:
|
variables:
|
||||||
|
JNI_PATH: libretro
|
||||||
MAKEFILE_PATH: libretro
|
MAKEFILE_PATH: libretro
|
||||||
CORENAME: sameboy
|
CORENAME: sameboy
|
||||||
BOOTROMS_DIR: ../BootROMs/prebuilt
|
BOOTROMS_DIR: BootROMs/prebuilt
|
||||||
|
|
||||||
.core-defs-android:
|
|
||||||
extends: .core-defs
|
|
||||||
variables:
|
|
||||||
JNI_PATH: libretro
|
|
||||||
BOOTROMS_DIR: ../../BootROMs/prebuilt
|
|
||||||
|
|
||||||
# Inclusion templates, required for the build to work
|
# Inclusion templates, required for the build to work
|
||||||
include:
|
include:
|
||||||
@@ -128,25 +123,25 @@ libretro-build-osx-arm64:
|
|||||||
android-armeabi-v7a:
|
android-armeabi-v7a:
|
||||||
extends:
|
extends:
|
||||||
- .libretro-android-jni-armeabi-v7a
|
- .libretro-android-jni-armeabi-v7a
|
||||||
- .core-defs-android
|
- .core-defs
|
||||||
|
|
||||||
# Android ARMv8a
|
# Android ARMv8a
|
||||||
android-arm64-v8a:
|
android-arm64-v8a:
|
||||||
extends:
|
extends:
|
||||||
- .libretro-android-jni-arm64-v8a
|
- .libretro-android-jni-arm64-v8a
|
||||||
- .core-defs-android
|
- .core-defs
|
||||||
|
|
||||||
# Android 64-bit x86
|
# Android 64-bit x86
|
||||||
android-x86_64:
|
android-x86_64:
|
||||||
extends:
|
extends:
|
||||||
- .libretro-android-jni-x86_64
|
- .libretro-android-jni-x86_64
|
||||||
- .core-defs-android
|
- .core-defs
|
||||||
|
|
||||||
# Android 32-bit x86
|
# Android 32-bit x86
|
||||||
android-x86:
|
android-x86:
|
||||||
extends:
|
extends:
|
||||||
- .libretro-android-jni-x86
|
- .libretro-android-jni-x86
|
||||||
- .core-defs-android
|
- .core-defs
|
||||||
|
|
||||||
# iOS
|
# iOS
|
||||||
libretro-build-ios-arm64:
|
libretro-build-ios-arm64:
|
||||||
|
@@ -22,7 +22,9 @@ LOCAL_CFLAGS := -std=c99 $(COREFLAGS) $(CFLAGS)
|
|||||||
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/libretro/link.T
|
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/libretro/link.T
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
|
||||||
$(CORE_DIR)/libretro/%_boot.c: $(CORE_DIR)/build/bin/BootROMs/%_boot.bin
|
override BOOTROMS_DIR := $(shell cd ../.. && realpath -m $(BOOTROMS_DIR))
|
||||||
|
|
||||||
|
$(CORE_DIR)/libretro/%_boot.c: $(BOOTROMS_DIR)/%_boot.bin
|
||||||
echo "/* AUTO-GENERATED */" > $@
|
echo "/* AUTO-GENERATED */" > $@
|
||||||
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
||||||
hexdump -v -e '/1 "0x%02x, "' $< >> $@
|
hexdump -v -e '/1 "0x%02x, "' $< >> $@
|
||||||
|
Reference in New Issue
Block a user