mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-09-03 09:02:34 +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:
|
||||
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.
|
||||
# Does not install mimetype icons because FreeDesktop is cursed abomination with no right to exist.
|
||||
|
@@ -188,7 +188,7 @@ endif
|
||||
|
||||
DEFINES := -DIOS
|
||||
ifeq ($(platform),ios-arm64)
|
||||
CC = cc -arch armv64 -isysroot $(IOSSDK)
|
||||
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
||||
else
|
||||
CC = cc -arch armv7 -isysroot $(IOSSDK)
|
||||
endif
|
||||
@@ -211,7 +211,7 @@ endif
|
||||
CC = cc -arch arm64 -isysroot $(IOSSDK)
|
||||
|
||||
else ifneq (,$(findstring qnx,$(platform)))
|
||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||
TARGET := $(TARGET_NAME)_libretro_qnx.so
|
||||
fpic := -fPIC
|
||||
SHARED := -shared -Wl,--version-script=$(CORE_DIR)/libretro/link.T -Wl,--no-undefined
|
||||
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
|
||||
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
|
||||
MKDIR := $(shell which mkdir)
|
||||
@@ -365,6 +373,8 @@ CFLAGS += -D__LIBRETRO__ $(fpic) $(INCFLAGS) -std=gnu11 -D_GNU_SOURCE -D_USE_M
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
override BOOTROMS_DIR := $(shell cd .. && realpath -m $(BOOTROMS_DIR))
|
||||
|
||||
$(CORE_DIR)/libretro/%_boot.c: $(BOOTROMS_DIR)/%_boot.bin
|
||||
echo "/* AUTO-GENERATED */" > $@
|
||||
echo "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
||||
|
@@ -7,15 +7,10 @@
|
||||
# Core definitions
|
||||
.core-defs:
|
||||
variables:
|
||||
JNI_PATH: libretro
|
||||
MAKEFILE_PATH: libretro
|
||||
CORENAME: sameboy
|
||||
BOOTROMS_DIR: ../BootROMs/prebuilt
|
||||
|
||||
.core-defs-android:
|
||||
extends: .core-defs
|
||||
variables:
|
||||
JNI_PATH: libretro
|
||||
BOOTROMS_DIR: ../../BootROMs/prebuilt
|
||||
BOOTROMS_DIR: BootROMs/prebuilt
|
||||
|
||||
# Inclusion templates, required for the build to work
|
||||
include:
|
||||
@@ -128,25 +123,25 @@ libretro-build-osx-arm64:
|
||||
android-armeabi-v7a:
|
||||
extends:
|
||||
- .libretro-android-jni-armeabi-v7a
|
||||
- .core-defs-android
|
||||
- .core-defs
|
||||
|
||||
# Android ARMv8a
|
||||
android-arm64-v8a:
|
||||
extends:
|
||||
- .libretro-android-jni-arm64-v8a
|
||||
- .core-defs-android
|
||||
- .core-defs
|
||||
|
||||
# Android 64-bit x86
|
||||
android-x86_64:
|
||||
extends:
|
||||
- .libretro-android-jni-x86_64
|
||||
- .core-defs-android
|
||||
- .core-defs
|
||||
|
||||
# Android 32-bit x86
|
||||
android-x86:
|
||||
extends:
|
||||
- .libretro-android-jni-x86
|
||||
- .core-defs-android
|
||||
- .core-defs
|
||||
|
||||
# iOS
|
||||
libretro-build-ios-arm64:
|
||||
|
@@ -22,7 +22,9 @@ LOCAL_CFLAGS := -std=c99 $(COREFLAGS) $(CFLAGS)
|
||||
LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/libretro/link.T
|
||||
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 "const unsigned char $(notdir $(@:%.c=%))[] = {" >> $@
|
||||
hexdump -v -e '/1 "0x%02x, "' $< >> $@
|
||||
|
Reference in New Issue
Block a user