From b0977804de283fbed1987ea91ab954f8ddd83dd1 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 14:55:58 -0400 Subject: [PATCH 1/8] libretro: migrate to cmake: windows/linux --- .gitlab-ci.yml | 31 ++++++++++--------------------- CMakeLists.txt | 9 +++++++-- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38d7f008d45..7abf2831946 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,29 +10,18 @@ JNI_PATH: libretro-build MAKEFILE: Makefile.libretro CORENAME: mgba + CORE_ARGS: -DLIBMGBA_ONLY=ON -DBUILD_LIBRETRO=ON # Inclusion templates, required for the build to work include: ################################## DESKTOPS ################################ # Windows 64-bit - project: 'libretro-infrastructure/ci-templates' - file: '/windows-x64-mingw.yml' - - # Windows 32-bit - - project: 'libretro-infrastructure/ci-templates' - file: '/windows-i686-mingw.yml' - - # Linux 64-bit - - project: 'libretro-infrastructure/ci-templates' - file: '/linux-x64.yml' - - # Linux 32-bit - - project: 'libretro-infrastructure/ci-templates' - file: '/linux-i686.yml' + file: '/windows-cmake-mingw.yml' - # Linux 64-bit (ARM) + # Linux 64-bit - project: 'libretro-infrastructure/ci-templates' - file: '/linux-aarch64.yml' + file: '/linux-cmake.yml' # MacOS 64-bit - project: 'libretro-infrastructure/ci-templates' @@ -124,31 +113,31 @@ stages: # Windows 64-bit libretro-build-windows-x64: extends: - - .libretro-windows-x64-mingw-make-default + - .libretro-windows-cmake-x86_64 - .core-defs # Windows 32-bit libretro-build-windows-i686: extends: - - .libretro-windows-i686-mingw-make-default + - .libretro-windows-cmake-x86 - .core-defs # Linux 64-bit libretro-build-linux-x64: extends: - - .libretro-linux-x64-make-default + - .libretro-linux-cmake-x86_64 - .core-defs - + # Linux 32-bit libretro-build-linux-i686: extends: - - .libretro-linux-i686-make-default + - .libretro-linux-cmake-x86 - .core-defs # Linux 64-bit (ARM) libretro-build-linux-aarch64: extends: - - .libretro-linux-aarch64-make-default + - .libretro-linux-cmake-aarch64 - .core-defs # MacOS 64-bit diff --git a/CMakeLists.txt b/CMakeLists.txt index bab0090c33a..1f8a9c599e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1021,9 +1021,14 @@ endif() if(BUILD_LIBRETRO) file(GLOB RETRO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/libretro/*.c) - add_library(${BINARY_NAME}_libretro SHARED ${CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) + set(LIBRETRO_CORE_SRC ${CORE_SRC}) + list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/platform/(posix|windows)/memory\\.c$") + list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/core/(scripting|directories|library|mem-search|rewind|input)\\.c$") + list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/util/(audio-resampler|interpolator)\\.c$") + list(REMOVE_ITEM LIBRETRO_CORE_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) + add_library(${BINARY_NAME}_libretro SHARED ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info) - set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;MINIMAL_CORE=2") + set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;ENABLE_DIRECTORIES;MINIMAL_CORE=2") target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) if(MSVC) install(TARGETS ${BINARY_NAME}_libretro RUNTIME DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro) From 4f5499b5cd8a9e5471c03f2d7d2da7264f35a3fe Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 15:21:04 -0400 Subject: [PATCH 2/8] libretro: migrate to cmake: apple --- .gitlab-ci.yml | 34 +++++++++++++++------------------- CMakeLists.txt | 2 +- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7abf2831946..2f4f4cf206b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -25,11 +25,11 @@ include: # MacOS 64-bit - project: 'libretro-infrastructure/ci-templates' - file: '/osx-x64.yml' + file: '/osx-cmake-x86.yml' - # MacOS ARM 64-bit + # MacOS arm 64-bit - project: 'libretro-infrastructure/ci-templates' - file: '/osx-arm64.yml' + file: '/osx-cmake-arm64.yml' ################################## CELLULAR ################################ # Android @@ -38,11 +38,7 @@ include: # iOS - project: 'libretro-infrastructure/ci-templates' - file: '/ios-arm64.yml' - - # iOS (armv7) - - project: 'libretro-infrastructure/ci-templates' - file: '/ios9.yml' + file: '/ios-cmake.yml' ################################## CONSOLES ################################ @@ -86,9 +82,9 @@ include: - project: 'libretro-infrastructure/ci-templates' file: '/dingux-arm32.yml' - # tvOS (AppleTV) + # tvOS - project: 'libretro-infrastructure/ci-templates' - file: '/tvos-arm64.yml' + file: '/tvos-cmake.yml' #################################### MISC ################################## # Emscripten @@ -143,13 +139,13 @@ libretro-build-linux-aarch64: # MacOS 64-bit libretro-build-osx-x64: extends: - - .libretro-osx-x64-make-10-7 + - .libretro-osx-cmake-x86_64 - .core-defs -# MacOS ARM 64-bit +# MacOS arm 64-bit libretro-build-osx-arm64: extends: - - .libretro-osx-arm64-make-default + - .libretro-osx-cmake-arm64 - .core-defs ################################### CELLULAR ################################# @@ -177,22 +173,22 @@ android-x86: - .libretro-android-jni-x86 - .core-defs -# iOS +# iOS arm64 libretro-build-ios-arm64: extends: - - .libretro-ios-arm64-make-default + - .libretro-ios-cmake-arm64 - .core-defs -# iOS (armv7) [iOS 9 and up] +# iOS 9 libretro-build-ios9: extends: - - .libretro-ios9-make-default + - .libretro-ios-cmake-ios9 - .core-defs -# tvOS +# tvOS arm64 libretro-build-tvos-arm64: extends: - - .libretro-tvos-arm64-make-default + - .libretro-tvos-cmake-arm64 - .core-defs ################################### CONSOLES ################################# diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f8a9c599e1..56d4444cc69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ if(APPLE) list(APPEND OS_LIB "-framework Foundation") # Xcode 15 introduced a warning about duplicate libraries that CMake doesn't disable itself, we do it here globally - if(MACOSX_SDK VERSION_GREATER_EQUAL 10.15) + if(CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "15") add_link_options(LINKER:-no_warn_duplicate_libraries) endif() From e05e4cc53b5930ab0f3e1d4b8fd084d1107493ed Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 15:54:30 -0400 Subject: [PATCH 3/8] libretro: migrate to cmake: android, dingux, emscripten, webos --- .gitlab-ci.yml | 30 +++++++++++++----------------- CMakeLists.txt | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2f4f4cf206b..d699a36cf4d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -34,7 +34,7 @@ include: ################################## CELLULAR ################################ # Android - project: 'libretro-infrastructure/ci-templates' - file: '/android-jni.yml' + file: '/android-cmake.yml' # iOS - project: 'libretro-infrastructure/ci-templates' @@ -76,11 +76,7 @@ include: # OpenDingux - project: 'libretro-infrastructure/ci-templates' - file: '/dingux-mips32.yml' - - # OpenDingux (ARM) - - project: 'libretro-infrastructure/ci-templates' - file: '/dingux-arm32.yml' + file: '/dingux-cmake.yml' # tvOS - project: 'libretro-infrastructure/ci-templates' @@ -89,11 +85,11 @@ include: #################################### MISC ################################## # Emscripten - project: 'libretro-infrastructure/ci-templates' - file: '/emscripten-static.yml' + file: '/emscripten-static-cmake.yml' # webOS 32-bit (LGTV) - project: 'libretro-infrastructure/ci-templates' - file: '/webos-make.yml' + file: '/webos-cmake.yml' # Stages for building stages: @@ -152,25 +148,25 @@ libretro-build-osx-arm64: # Android ARMv7a android-armeabi-v7a: extends: - - .libretro-android-jni-armeabi-v7a + - .libretro-android-cmake-armeabi-v7a - .core-defs # Android ARMv8a android-arm64-v8a: extends: - - .libretro-android-jni-arm64-v8a + - .libretro-android-cmake-arm64-v8a - .core-defs # Android 64-bit x86 android-x86_64: extends: - - .libretro-android-jni-x86_64 + - .libretro-android-cmake-x86_64 - .core-defs # Android 32-bit x86 android-x86: extends: - - .libretro-android-jni-x86 + - .libretro-android-cmake-x86 - .core-defs # iOS arm64 @@ -243,30 +239,30 @@ libretro-build-libnx-aarch64: # OpenDingux libretro-build-dingux-mips32: extends: - - .libretro-dingux-mips32-make-default + - .libretro-dingux-cmake-mips32 - .core-defs # OpenDingux Beta libretro-build-dingux-odbeta-mips32: extends: - - .libretro-dingux-odbeta-mips32-make-default + - .libretro-dingux-odbeta-cmake-mips32 - .core-defs # Miyoo libretro-build-miyoo-arm32: extends: - - .libretro-miyoo-arm32-make-default + - .libretro-miyoo-cmake-arm32 - .core-defs #################################### MISC ################################## # Emscripten libretro-build-emscripten: extends: - - .libretro-emscripten-static-retroarch-master + - .libretro-emscripten-static-cmake-retroarch-master - .core-defs # webOS libretro-build-webos-armv7a: extends: - - .libretro-webos-armv7a-make-default + - .libretro-webos-armv7a-cmake - .core-defs diff --git a/CMakeLists.txt b/CMakeLists.txt index 56d4444cc69..093aa752eef 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,7 +35,7 @@ if(NOT MSVC) set(WARNING_FLAGS "${WARNING_FLAGS} -Wno-format") endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNING_FLAGS} -Werror=implicit-function-declaration -Werror=implicit-int -fwrapv") - if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS "5.0") # TODO: Remove this once mScript KV pairs support const correctness set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=incompatible-pointer-types") endif() @@ -231,7 +231,7 @@ if(WIN32) elseif(UNIX) set(USE_PTHREADS ON) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR EMSCRIPTEN) add_definitions(-D_GNU_SOURCE) endif() @@ -1026,7 +1026,16 @@ if(BUILD_LIBRETRO) list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/core/(scripting|directories|library|mem-search|rewind|input)\\.c$") list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/util/(audio-resampler|interpolator)\\.c$") list(REMOVE_ITEM LIBRETRO_CORE_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) - add_library(${BINARY_NAME}_libretro SHARED ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) + if(LIBRETRO_STATIC) + add_library(${BINARY_NAME}_libretro STATIC ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) + if(EMSCRIPTEN) + set_target_properties(${BINARY_NAME}_libretro PROPERTIES SUFFIX "${LIBRETRO_SUFFIX}.bc") + else() + set_target_properties(${BINARY_NAME}_libretro PROPERTIES SUFFIX "${LIBRETRO_SUFFIX}.a") + endif() + else() + add_library(${BINARY_NAME}_libretro SHARED ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) + endif() add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info) set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;ENABLE_DIRECTORIES;MINIMAL_CORE=2") target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) From 7ae70ca34c09c83504e6034b67860342c718b7e5 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 16:47:50 -0400 Subject: [PATCH 4/8] libretro: migrate to cmake: consoles --- .gitlab-ci.yml | 24 ++++++++++++------------ CMakeLists.txt | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d699a36cf4d..36fab09f20c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,20 +44,20 @@ include: # PlayStation Portable - project: 'libretro-infrastructure/ci-templates' - file: '/psp-static.yml' - + file: '/psp-static-cmake.yml' + # PlayStation Vita - project: 'libretro-infrastructure/ci-templates' - file: '/vita-static.yml' - + file: '/vita-static-cmake.yml' + # PlayStation2 - project: 'libretro-infrastructure/ci-templates' - file: '/ps2-static.yml' - + file: '/ps2-static-cmake.yml' + # Nintendo 3DS - project: 'libretro-infrastructure/ci-templates' file: '/ctr-static.yml' - + # Nintendo GameCube - project: 'libretro-infrastructure/ci-templates' file: '/ngc-static.yml' @@ -72,7 +72,7 @@ include: # Nintendo Switch - project: 'libretro-infrastructure/ci-templates' - file: '/libnx-static.yml' + file: '/libnx-static-cmake.yml' # OpenDingux - project: 'libretro-infrastructure/ci-templates' @@ -191,19 +191,19 @@ libretro-build-tvos-arm64: # PlayStation Portable libretro-build-psp: extends: - - .libretro-psp-static-retroarch-master + - .libretro-psp-static-cmake-retroarch-master - .core-defs # PlayStation Vita libretro-build-vita: extends: - - .libretro-vita-static-retroarch-master + - .libretro-vita-static-cmake-retroarch-master - .core-defs # PlayStation2 libretro-build-ps2: extends: - - .libretro-ps2-static-retroarch-master + - .libretro-ps2-static-cmake-retroarch-master - .core-defs # Nintendo 3DS @@ -233,7 +233,7 @@ libretro-build-wiiu: # Nintendo Switch libretro-build-libnx-aarch64: extends: - - .libretro-libnx-static-retroarch-master + - .libretro-libnx-static-cmake-retroarch-master - .core-defs # OpenDingux diff --git a/CMakeLists.txt b/CMakeLists.txt index 093aa752eef..1ed80948e7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1026,6 +1026,30 @@ if(BUILD_LIBRETRO) list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/core/(scripting|directories|library|mem-search|rewind|input)\\.c$") list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/util/(audio-resampler|interpolator)\\.c$") list(REMOVE_ITEM LIBRETRO_CORE_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) + include(CheckSymbolExists) + check_symbol_exists(PATH_MAX "limits.h" LIBRETRO_HAS_PATH_MAX) + set(LIBRETRO_EXTRA_DEFINES "") + if(NOT LIBRETRO_HAS_PATH_MAX) + list(APPEND LIBRETRO_EXTRA_DEFINES "PATH_MAX=4096") + endif() + # Embedded toolchains aren't covered by the OS detection above and need a + # VFile backend selected here (mirrors Makefile.common's HAVE_VFS_FD logic: + # consoles use stdio vfs-file — their newlibs lack e.g. ftruncate — except + # vita, which has a dedicated sceIo backend) + if(NOT "${OS_DEFINES}" MATCHES "ENABLE_VFS") + if(VITA) + list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/psp2/sce-vfs.c) + list(APPEND LIBRETRO_EXTRA_DEFINES PSP2 ENABLE_VFS_FD) + else() + list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-file.c) + list(APPEND LIBRETRO_EXTRA_DEFINES ENABLE_VFS_FILE) + endif() + endif() + # PS2's GS wants BGR555; libretro.c has a matching PS2 special case + set(LIBRETRO_COLOR_DEFINES "COLOR_16_BIT;COLOR_5_6_5") + if(PS2) + set(LIBRETRO_COLOR_DEFINES "COLOR_16_BIT") + endif() if(LIBRETRO_STATIC) add_library(${BINARY_NAME}_libretro STATIC ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) if(EMSCRIPTEN) @@ -1037,12 +1061,16 @@ if(BUILD_LIBRETRO) add_library(${BINARY_NAME}_libretro SHARED ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) endif() add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info) - set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" COMPILE_DEFINITIONS "__LIBRETRO__;COLOR_16_BIT;COLOR_5_6_5;DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;ENABLE_DIRECTORIES;MINIMAL_CORE=2") + # The make-era libretro builds all used the gnu dialect (-std=gnu99) plus + # _GNU_SOURCE; newlib toolchains hide POSIX declarations under strict c11 + set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" C_EXTENSIONS ON COMPILE_DEFINITIONS "__LIBRETRO__;_GNU_SOURCE;${LIBRETRO_COLOR_DEFINES};DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;ENABLE_DIRECTORIES;MINIMAL_CORE=2;${LIBRETRO_EXTRA_DEFINES}") target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) if(MSVC) install(TARGETS ${BINARY_NAME}_libretro RUNTIME DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro) else() - install(TARGETS ${BINARY_NAME}_libretro LIBRARY DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro NAMELINK_SKIP) + install(TARGETS ${BINARY_NAME}_libretro + LIBRARY DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro NAMELINK_SKIP + ARCHIVE DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro) endif() endif() From ecfc1e891946a24f477bc2ef5fa73d044be093b5 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 17:40:29 -0400 Subject: [PATCH 5/8] libretro: migrate to cmake: more consoles --- .gitlab-ci.yml | 18 ++++++++++-------- CMakeLists.txt | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 36fab09f20c..6790655b2fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -56,19 +56,19 @@ include: # Nintendo 3DS - project: 'libretro-infrastructure/ci-templates' - file: '/ctr-static.yml' + file: '/ctr-static-cmake.yml' # Nintendo GameCube - project: 'libretro-infrastructure/ci-templates' - file: '/ngc-static.yml' + file: '/ngc-static-cmake.yml' # Nintendo Wii - project: 'libretro-infrastructure/ci-templates' - file: '/wii-static.yml' + file: '/wii-static-cmake.yml' # Nintendo WiiU - project: 'libretro-infrastructure/ci-templates' - file: '/wiiu-static.yml' + file: '/wiiu-static-cmake.yml' # Nintendo Switch - project: 'libretro-infrastructure/ci-templates' @@ -209,25 +209,27 @@ libretro-build-ps2: # Nintendo 3DS libretro-build-ctr: extends: - - .libretro-ctr-static-retroarch-master + - .libretro-ctr-static-cmake-retroarch-master - .core-defs + variables: + CMAKE_TOOLCHAIN_FILE_DIR: /opt/cmake_toolchain_files # Nintendo GameCube libretro-build-ngc: extends: - - .libretro-ngc-static-retroarch-master + - .libretro-ngc-static-cmake-retroarch-master - .core-defs # Nintendo Wii libretro-build-wii: extends: - - .libretro-wii-static-retroarch-master + - .libretro-wii-static-cmake-retroarch-master - .core-defs # Nintendo WiiU libretro-build-wiiu: extends: - - .libretro-wiiu-static-retroarch-master + - .libretro-wiiu-static-cmake-retroarch-master - .core-defs # Nintendo Switch diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ed80948e7c..b8344a8c2ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.12) +cmake_minimum_required(VERSION 3.7...3.12) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/platform/cmake/") if(POLICY CMP0025) @@ -322,6 +322,7 @@ endif() include(CheckCCompilerFlag) include(CheckIncludeFiles) +include(CheckSymbolExists) set(FUNCTION_DEFINES) @@ -605,8 +606,9 @@ if(USE_ZLIB) set(HAVE_CRC32 ON) list(APPEND OS_LIB ${ZLIB_LIBRARIES}) else() - # zlib pulls in crc32 - check_function_exists(crc32 HAVE_CRC32) + # zlib pulls in crc32; probe via the header so a linkable symbol without + # reachable zlib headers doesn't false-positive + check_symbol_exists(crc32 "zlib.h" HAVE_CRC32) endif() if(HAVE_CRC32) @@ -893,20 +895,24 @@ source_group("Extra features" FILES ${FEATURE_SRC}) source_group("Third-party code" FILES ${THIRD_PARTY_SRC}) # Platform binaries -if(DEFINED 3DS) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/3ds ${CMAKE_CURRENT_BINARY_DIR}/3ds) -endif() +# These standalone frontends export OS_DEFINES/OS_LIB expecting their own +# sources to satisfy them; keep them out of core-only builds +if(NOT LIBMGBA_ONLY) + if(DEFINED 3DS) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/3ds ${CMAKE_CURRENT_BINARY_DIR}/3ds) + endif() -if(DEFINED WII) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/wii ${CMAKE_CURRENT_BINARY_DIR}/wii) -endif() + if(DEFINED WII) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/wii ${CMAKE_CURRENT_BINARY_DIR}/wii) + endif() -if(DEFINED PSP2) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/psp2 ${CMAKE_CURRENT_BINARY_DIR}/psp2) -endif() + if(DEFINED PSP2) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/psp2 ${CMAKE_CURRENT_BINARY_DIR}/psp2) + endif() -if(DEFINED SWITCH) - add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/switch ${CMAKE_CURRENT_BINARY_DIR}/switch) + if(DEFINED SWITCH) + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src/platform/switch ${CMAKE_CURRENT_BINARY_DIR}/switch) + endif() endif() # Binaries @@ -973,7 +979,7 @@ if(NOT SKIP_LIBRARY) file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/mgba-util) - if(BUILD_STATIC) + if(BUILD_STATIC AND DEPENDENCY_LIB) # Some versions of CMake are remarkably bad about deduplicating this list, # leading to issues with static linking. Let's do it manually. list(REVERSE DEPENDENCY_LIB) @@ -1026,7 +1032,12 @@ if(BUILD_LIBRETRO) list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/core/(scripting|directories|library|mem-search|rewind|input)\\.c$") list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/util/(audio-resampler|interpolator)\\.c$") list(REMOVE_ITEM LIBRETRO_CORE_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) - include(CheckSymbolExists) + if(CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "STATIC_LIBRARY") + # Link-based function probes always succeed under static try-compile, + # so every find_function result above is untrustworthy; use the set + # the make-era console builds shipped + set(FUNCTION_DEFINES HAVE_STRDUP HAVE_STRNDUP HAVE_LOCALE HAVE_STRTOF_L HAVE_LOCALTIME_R) + endif() check_symbol_exists(PATH_MAX "limits.h" LIBRETRO_HAS_PATH_MAX) set(LIBRETRO_EXTRA_DEFINES "") if(NOT LIBRETRO_HAS_PATH_MAX) From 6d4c5aa7df078facaf17bec5cbc6d5bee6158309 Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 18:59:43 -0400 Subject: [PATCH 6/8] libretro: migrate to cmake: bring some things over from Makefile --- .github/workflows/compilation.yml | 10 ++++++++-- .gitlab-ci.yml | 2 ++ CMakeLists.txt | 31 +++++++++++++++++++++++++++++-- 3 files changed, 39 insertions(+), 4 deletions(-) diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml index bf20f11aec4..75d0eb36385 100644 --- a/.github/workflows/compilation.yml +++ b/.github/workflows/compilation.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies run: | - apk add build-base + apk add build-base cmake - name: Get Information Variables id: core @@ -26,7 +26,13 @@ jobs: - name: Compile project run: | - make platform=${{ steps.core.outputs.platform }} clean all + cmake -DCMAKE_BUILD_TYPE=Release -DLIBMGBA_ONLY=ON -DBUILD_LIBRETRO=ON \ + -DLIBRETRO_STATIC=ON -DLIBRETRO_SUFFIX=_${{ steps.core.outputs.platform }} \ + -DBUILD_SHARED_LIBS=OFF -DPS2=ON \ + -DCMAKE_C_FLAGS="-DPS2 -DUSE_RGB565 -G0" -DCMAKE_CXX_FLAGS="-DPS2 -DUSE_RGB565 -G0" \ + -DCMAKE_TOOLCHAIN_FILE=/usr/local/ps2dev/ps2sdk/ps2dev.cmake . -Bbuild + cmake --build build --target ${{ steps.core.outputs.info }}_libretro -- -j$(nproc) + cp build/${{ steps.core.outputs.info }}_libretro_${{ steps.core.outputs.platform }}.a . - name: Upload artifacts if: ${{ success() }} diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6790655b2fb..fd9da0c87ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -150,6 +150,8 @@ android-armeabi-v7a: extends: - .libretro-android-cmake-armeabi-v7a - .core-defs + variables: + CORE_ARGS: -DLIBMGBA_ONLY=ON -DBUILD_LIBRETRO=ON -DANDROID_ARM_MODE=arm # Android ARMv8a android-arm64-v8a: diff --git a/CMakeLists.txt b/CMakeLists.txt index b8344a8c2ac..c7c2299a5ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1032,7 +1032,7 @@ if(BUILD_LIBRETRO) list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/core/(scripting|directories|library|mem-search|rewind|input)\\.c$") list(FILTER LIBRETRO_CORE_SRC EXCLUDE REGEX "/util/(audio-resampler|interpolator)\\.c$") list(REMOVE_ITEM LIBRETRO_CORE_SRC ${CMAKE_CURRENT_BINARY_DIR}/version.c) - if(CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "STATIC_LIBRARY") + if(CMAKE_TRY_COMPILE_TARGET_TYPE STREQUAL "STATIC_LIBRARY" AND NOT APPLE) # Link-based function probes always succeed under static try-compile, # so every find_function result above is untrustworthy; use the set # the make-era console builds shipped @@ -1040,26 +1040,46 @@ if(BUILD_LIBRETRO) endif() check_symbol_exists(PATH_MAX "limits.h" LIBRETRO_HAS_PATH_MAX) set(LIBRETRO_EXTRA_DEFINES "") + set(LIBRETRO_EXTRA_FLAGS "") if(NOT LIBRETRO_HAS_PATH_MAX) list(APPEND LIBRETRO_EXTRA_DEFINES "PATH_MAX=4096") endif() + # math.h M_PI is not guaranteed on newlib; common.h's fallback is float + list(APPEND LIBRETRO_EXTRA_DEFINES "M_PI=3.14159265358979323846") + if(GIT_COMMIT_SHORT) + list(APPEND LIBRETRO_EXTRA_DEFINES "GIT_VERSION=\" ${GIT_COMMIT_SHORT}\"") + endif() # Embedded toolchains aren't covered by the OS detection above and need a # VFile backend selected here (mirrors Makefile.common's HAVE_VFS_FD logic: # consoles use stdio vfs-file — their newlibs lack e.g. ftruncate — except - # vita, which has a dedicated sceIo backend) + # vita and 3DS, which have dedicated backends) if(NOT "${OS_DEFINES}" MATCHES "ENABLE_VFS") if(VITA) list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/psp2/sce-vfs.c) list(APPEND LIBRETRO_EXTRA_DEFINES PSP2 ENABLE_VFS_FD) + # Use the sceKernelLibcLocaltime_r shim, not newlib's localtime_r + list(REMOVE_ITEM FUNCTION_DEFINES HAVE_LOCALTIME_R) + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6k") + list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/3ds/3ds-vfs.c) + list(APPEND LIBRETRO_EXTRA_DEFINES ARM11 _3DS __3DS__ ENABLE_VFS_3DS ENABLE_VFS_FD) + list(APPEND LIBRETRO_EXTRA_FLAGS -mword-relocations -ffast-math) else() list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/util/vfs/vfs-file.c) list(APPEND LIBRETRO_EXTRA_DEFINES ENABLE_VFS_FILE) endif() endif() + if(NSWITCH) + list(APPEND LIBRETRO_EXTRA_FLAGS -ffast-math) + endif() + # devkitPPC's int32_t is long-based; the make builds always overrode it + if(CMAKE_C_FLAGS MATCHES "GEKKO") + list(APPEND LIBRETRO_EXTRA_FLAGS -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=int) + endif() # PS2's GS wants BGR555; libretro.c has a matching PS2 special case set(LIBRETRO_COLOR_DEFINES "COLOR_16_BIT;COLOR_5_6_5") if(PS2) set(LIBRETRO_COLOR_DEFINES "COLOR_16_BIT") + list(APPEND LIBRETRO_EXTRA_DEFINES HAVE_NO_LANGEXTRA) endif() if(LIBRETRO_STATIC) add_library(${BINARY_NAME}_libretro STATIC ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) @@ -1070,11 +1090,18 @@ if(BUILD_LIBRETRO) endif() else() add_library(${BINARY_NAME}_libretro SHARED ${LIBRETRO_CORE_SRC} ${RETRO_SRC} ${CORE_VFS_SRC}) + if(NOT APPLE AND NOT WIN32) + # Export only the retro_* API, as the make build always did + set_property(TARGET ${BINARY_NAME}_libretro APPEND_STRING PROPERTY LINK_FLAGS " -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/link.T") + endif() endif() add_dependencies(${BINARY_NAME}_libretro ${BINARY_NAME}-version-info) # The make-era libretro builds all used the gnu dialect (-std=gnu99) plus # _GNU_SOURCE; newlib toolchains hide POSIX declarations under strict c11 set_target_properties(${BINARY_NAME}_libretro PROPERTIES PREFIX "" C_EXTENSIONS ON COMPILE_DEFINITIONS "__LIBRETRO__;_GNU_SOURCE;${LIBRETRO_COLOR_DEFINES};DISABLE_THREADING;MGBA_STANDALONE;${OS_DEFINES};${FUNCTION_DEFINES};ENABLE_VFS;ENABLE_DIRECTORIES;MINIMAL_CORE=2;${LIBRETRO_EXTRA_DEFINES}") + if(LIBRETRO_EXTRA_FLAGS) + target_compile_options(${BINARY_NAME}_libretro PRIVATE ${LIBRETRO_EXTRA_FLAGS}) + endif() target_link_libraries(${BINARY_NAME}_libretro ${OS_LIB}) if(MSVC) install(TARGETS ${BINARY_NAME}_libretro RUNTIME DESTINATION ${LIBRETRO_LIBDIR} COMPONENT ${BINARY_NAME}_libretro) From 34f242a18b4ac4cf8ab281652cd6a1fd473a913c Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 19:20:18 -0400 Subject: [PATCH 7/8] libretro: migrate to cmake --- .gitlab-ci.yml | 2 - CMakeLists.txt | 5 +- Makefile | 1 - Makefile.libretro | 490 ----------------- libretro-build/Makefile.android_arm64-v8a | 96 ---- libretro-build/Makefile.android_armeabi | 96 ---- libretro-build/Makefile.android_armeabi-v7a | 96 ---- libretro-build/Makefile.android_mips | 96 ---- libretro-build/Makefile.android_mips64 | 96 ---- libretro-build/Makefile.android_x86 | 96 ---- libretro-build/Makefile.android_x86_64 | 96 ---- libretro-build/Makefile.common | 152 ------ libretro-build/Makefile.linux-portable_x86 | 96 ---- libretro-build/Makefile.linux-portable_x86_64 | 96 ---- libretro-build/Makefile.linux_x86 | 96 ---- libretro-build/Makefile.linux_x86_64 | 96 ---- libretro-build/Makefile.mingw_x86 | 96 ---- libretro-build/Makefile.mingw_x86_64 | 96 ---- libretro-build/Makefile.osx_x86 | 96 ---- libretro-build/Makefile.osx_x86_64 | 96 ---- libretro-build/Makefile.rules | 45 -- libretro-build/Makefile.vita_arm | 96 ---- libretro-build/Makefile.wii_ppc | 96 ---- libretro-build/Makefile.windows_x86 | 96 ---- libretro-build/Makefile.windows_x86_64 | 96 ---- libretro-build/include/libz/zconf.h | 511 ------------------ libretro-build/jni/Android.mk | 23 - libretro-build/jni/Application.mk | 2 - libretro-build/link.T | 5 - 29 files changed, 2 insertions(+), 3058 deletions(-) delete mode 100644 Makefile delete mode 100644 Makefile.libretro delete mode 100644 libretro-build/Makefile.android_arm64-v8a delete mode 100644 libretro-build/Makefile.android_armeabi delete mode 100644 libretro-build/Makefile.android_armeabi-v7a delete mode 100644 libretro-build/Makefile.android_mips delete mode 100644 libretro-build/Makefile.android_mips64 delete mode 100644 libretro-build/Makefile.android_x86 delete mode 100644 libretro-build/Makefile.android_x86_64 delete mode 100644 libretro-build/Makefile.common delete mode 100644 libretro-build/Makefile.linux-portable_x86 delete mode 100644 libretro-build/Makefile.linux-portable_x86_64 delete mode 100644 libretro-build/Makefile.linux_x86 delete mode 100644 libretro-build/Makefile.linux_x86_64 delete mode 100644 libretro-build/Makefile.mingw_x86 delete mode 100644 libretro-build/Makefile.mingw_x86_64 delete mode 100644 libretro-build/Makefile.osx_x86 delete mode 100644 libretro-build/Makefile.osx_x86_64 delete mode 100644 libretro-build/Makefile.rules delete mode 100644 libretro-build/Makefile.vita_arm delete mode 100644 libretro-build/Makefile.wii_ppc delete mode 100644 libretro-build/Makefile.windows_x86 delete mode 100644 libretro-build/Makefile.windows_x86_64 delete mode 100644 libretro-build/include/libz/zconf.h delete mode 100644 libretro-build/jni/Android.mk delete mode 100644 libretro-build/jni/Application.mk delete mode 100644 libretro-build/link.T diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd9da0c87ac..ad07f2e5966 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,8 +7,6 @@ # Core definitions .core-defs: variables: - JNI_PATH: libretro-build - MAKEFILE: Makefile.libretro CORENAME: mgba CORE_ARGS: -DLIBMGBA_ONLY=ON -DBUILD_LIBRETRO=ON diff --git a/CMakeLists.txt b/CMakeLists.txt index c7c2299a5ab..52980b7204d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1050,9 +1050,8 @@ if(BUILD_LIBRETRO) list(APPEND LIBRETRO_EXTRA_DEFINES "GIT_VERSION=\" ${GIT_COMMIT_SHORT}\"") endif() # Embedded toolchains aren't covered by the OS detection above and need a - # VFile backend selected here (mirrors Makefile.common's HAVE_VFS_FD logic: - # consoles use stdio vfs-file — their newlibs lack e.g. ftruncate — except - # vita and 3DS, which have dedicated backends) + # VFile backend selected here: consoles use stdio vfs-file — their newlibs + # lack e.g. ftruncate — except vita and 3DS, which have dedicated backends if(NOT "${OS_DEFINES}" MATCHES "ENABLE_VFS") if(VITA) list(APPEND LIBRETRO_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/psp2/sce-vfs.c) diff --git a/Makefile b/Makefile deleted file mode 100644 index 087932e64f6..00000000000 --- a/Makefile +++ /dev/null @@ -1 +0,0 @@ -include Makefile.libretro diff --git a/Makefile.libretro b/Makefile.libretro deleted file mode 100644 index 06fad52546b..00000000000 --- a/Makefile.libretro +++ /dev/null @@ -1,490 +0,0 @@ -DEBUG = 0 -HAVE_VFS_FD := 1 -CORE_DIR := . -BUILD_DIR := libretro-build - -ifeq ($(platform),windows_x86) - include $(BUILD_DIR)/Makefile.windows_x86 -#else ifeq ($(platform),wii_ppc) - #include $(BUILD_DIR)/Makefile.wii_ppc -else ifeq ($(platform),android_armeabi) - include $(BUILD_DIR)/Makefile.android_armeabi -else ifeq ($(platform),android_arm64-v8a) - include $(BUILD_DIR)/Makefile.android_arm64-v8a -else ifeq ($(platform),mingw_x86) - include $(BUILD_DIR)/Makefile.mingw_x86 -else ifeq ($(platform),mingw_x86_64) - include $(BUILD_DIR)/Makefile.mingw_x86_64 -else ifeq ($(platform),windows_x86_64) - include $(BUILD_DIR)/Makefile.windows_x86_64 -else ifeq ($(platform),linux_x86) - include $(BUILD_DIR)/Makefile.linux_x86 -else ifeq ($(platform),linux_x86_64) - include $(BUILD_DIR)/Makefile.linux_x86_64 -else ifeq ($(platform),android_armeabi-v7a) - include $(BUILD_DIR)/Makefile.android_armeabi-v7a -else ifeq ($(platform),android_x86) - include $(BUILD_DIR)/Makefile.android_x86 -else ifeq ($(platform),android_mips64) - include $(BUILD_DIR)/Makefile.android_mips64 -else ifeq ($(platform),android_x86_64) - include $(BUILD_DIR)/Makefile.android_x86_64 -else ifeq ($(platform),linux-portable_x86) - include $(BUILD_DIR)/Makefile.linux-portable_x86 -else ifeq ($(platform),linux-portable_x86_64) - include $(BUILD_DIR)/Makefile.linux-portable_x86_64 -else ifeq ($(platform),android_mips) - include $(BUILD_DIR)/Makefile.android_mips -else - -# system platform -ifeq ($(platform),) - platform = unix - ifeq ($(shell uname -s),) - EXE_EXT = .exe - platform = win - else ifneq ($(findstring MINGW,$(shell uname -s)),) - platform = win - else ifneq ($(findstring Darwin,$(shell uname -s)),) - platform = osx - arch = intel - ifeq ($(shell uname -p),arm64) - arch = arm - endif - ifeq ($(shell uname -p),powerpc) - arch = ppc - endif - else ifneq ($(findstring win,$(shell uname -s)),) - platform = win - endif -else ifneq (,$(findstring armv,$(platform))) - ifeq (,$(findstring classic_,$(platform))) - override platform += unix - endif -endif - -prefix := /usr -libdir := $(prefix)/lib - -LIBRETRO_DIR := libretro - -TARGET_NAME := mgba - -DEFINES := - -ifeq (,$(findstring msvc,$(platform))) -LIBS += -lm -endif - -# GIT HASH -GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" -ifneq ($(GIT_VERSION)," unknown") - DEFINES += -DGIT_VERSION=\"$(GIT_VERSION)\" -endif - -# Unix -ifneq (,$(findstring unix,$(platform))) - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T - DEFINES += -std=c99 -D_GNU_SOURCE -DHAVE_LOCALE - -# Raspberry Pi -else ifneq (,$(findstring rpi,$(platform))) - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T - DEFINES += -std=c99 -D_GNU_SOURCE -DHAVE_LOCALE - LDFLAGS += -flto - HAVE_VFS_FD = 0 - CFLAGS += -fomit-frame-pointer -ftree-vectorize -flto - ifneq (,$(findstring rpi3,$(platform))) - CFLAGS += -marm -mcpu=cortex-a53 -mfloat-abi=hard - else ifneq (,$(findstring rpi4_64,$(platform))) - CFLAGS += -march=armv8-a+crc+simd -mtune=cortex-a72 - endif - -# Go-Advance -else ifeq ($(platform), goadvance) - CPUFLAGS := -Ofast -march=armv8-a+crc+fp+simd -mcpu=cortex-a35 -flto -DUSE_RENDER_THREAD -DNO_ASM -DARM_ASM -frename-registers -ftree-vectorize - CFLAGS := -DNDEBUG -Ofast -fno-ident - LDFLAGS += -Ofast -fno-ident - CFLAGS += $(CPUFLAGS) -fpic -fomit-frame-pointer -fno-exceptions -fno-non-call-exceptions -Wno-psabi -Wno-format - LDFLAGS += $(CPUFLAGS) -lpthread -Wl,--gc-sections -shared - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T - DEFINES += -std=c99 -D_GNU_SOURCE -DHAVE_LOCALE - HAVE_VFS_FD = 0 - -# (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=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 - HAVE_VFS_FD = 0 - DEFINES += -std=c99 -D_GNU_SOURCE - DEFINES += -DHAVE_LOCALE - 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 - -# (armv8 a35, hard point, neon based) ### -# Playstation Classic -else ifeq ($(platform), classic_armv8_a35) - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,--version-script=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-a35 -mfpu=neon-fp-armv8 -mfloat-abi=hard - CXXFLAGS += $(CFLAGS) - CPPFLAGS += $(CFLAGS) - ASFLAGS += $(CFLAGS) - HAVE_NEON = 1 - ARCH = arm - BUILTIN_GPU = neon - HAVE_VFS_FD = 0 - DEFINES += -std=c99 -D_GNU_SOURCE - DEFINES += -DHAVE_LOCALE - CFLAGS += -march=armv8-a - LDFLAGS += -static-libgcc -static-libstdc++ -####################################### - -# OS X -else ifeq ($(platform), osx) - TARGET := $(TARGET_NAME)_libretro.dylib - fpic := -fPIC - SHARED := -dynamiclib - OSXVER = `sw_vers -productVersion | cut -d. -f 2` - OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"` - ifeq ($(OSX_LT_MAVERICKS),YES) - fpic += -mmacosx-version-min=10.1 - endif - ifndef ($(NOUNIVERSAL)) - CFLAGS += $(ARCHFLAGS) - LDFLAGS += $(ARCHFLAGS) - endif - ifeq ($(arch),ppc) - DEFINES += -D__POWERPC__ -D__PPC__ -DMSB_FIRST - endif - DEFINES += -std=gnu99 - DEFINES += -DHAVE_STRLCPY -DHAVE_LOCALE -DHAVE_XLOCALE - ifeq ($(CROSS_COMPILE),1) - TARGET_RULE = -target $(LIBRETRO_APPLE_PLATFORM) -isysroot $(LIBRETRO_APPLE_ISYSROOT) - CFLAGS += $(TARGET_RULE) - LDFLAGS += $(TARGET_RULE) - endif - -# iOS -else ifneq (,$(findstring ios,$(platform))) - TARGET := $(TARGET_NAME)_libretro_ios.dylib - fpic := -fPIC - SHARED := -dynamiclib - ifeq ($(IOSSDK),) - IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path) - endif - ifeq ($(platform),ios-arm64) - CC = cc -arch arm64 -isysroot $(IOSSDK) - else - CC = cc -arch armv7 -isysroot $(IOSSDK) - endif - ifeq ($(platform),$(filter $(platform),ios9 ios-arm64)) - CC += -miphoneos-version-min=8.0 - PLATFORM_DEFINES := -miphoneos-version-min=8.0 - else - CC += -miphoneos-version-min=5.0 - PLATFORM_DEFINES := -miphoneos-version-min=5.0 - endif - DEFINES += -std=c99 - DEFINES += -DHAVE_STRLCPY -DHAVE_LOCALE -DHAVE_XLOCALE - -# tvOS -else ifeq ($(platform), tvos-arm64) - TARGET := $(TARGET_NAME)_libretro_tvos.dylib - fpic := -fPIC - SHARED := -dynamiclib - CFLAGS := -DIOS - DEFINES += -std=c99 - DEFINES += -DHAVE_STRLCPY -DHAVE_LOCALE -DHAVE_XLOCALE - -ifeq ($(IOSSDK),) - IOSSDK := $(shell xcodebuild -version -sdk appletvos Path) -endif - CC = clang -arch arm64 -isysroot $(IOSSDK) - CXX = clang++ -arch arm64 -isysroot $(IOSSDK) - CC += -mappletvos-version-min=11.0 - PLATFORM_DEFINES := -mappletvos-version-min=11.0 - -# Theos -else ifeq ($(platform), theos_ios) - DEPLOYMENT_IOSVERSION = 5.0 - TARGET = iphone:latest:$(DEPLOYMENT_IOSVERSION) - ARCHS = armv7 armv7s - TARGET_IPHONEOS_DEPLOYMENT_VERSION=$(DEPLOYMENT_IOSVERSION) - THEOS_BUILD_DIR := objs - include $(THEOS)/makefiles/common.mk - LIBRARY_NAME = $(TARGET_NAME)_libretro_ios - DEFINES += -std=c99 - -# QNX -else ifeq ($(platform), qnx) - TARGET := $(TARGET_NAME)_libretro_qnx.so - fpic := -fPIC - SHARED := -lcpp -lm -shared -Wl,-version-script=link.T - CC = qcc -Vgcc_ntoarmv7le - AR = QCC -Vgcc_ntoarmv7le - PLATFORM_DEFINES := -D__BLACKBERRY_QNX__ -fexceptions -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp - DEFINES += -Wc,-std=c99 - -# PS3 -else ifneq (,$(filter $(platform), psl1ght)) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT) - AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__PPC__ -D__BIG_ENDIAN__ - STATIC_LINKING = 1 - DEFINES += -std=gnu99 -fms-extensions - HAVE_VFS_FD = 0 - -# PS2 -else ifeq ($(platform), ps2) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = mips64r5900el-ps2-elf-gcc$(EXE_EXT) - AR = mips64r5900el-ps2-elf-ar$(EXE_EXT) - PLATFORM_DEFINES := -DPS2 -DCC_RESAMPLER - CFLAGS += -G0 -DHAVE_NO_LANGEXTRA -DHAVE_STRTOF_L -D_GNU_SOURCE -DHAVE_LOCALE - STATIC_LINKING = 1 - DEFINES += -std=c99 - HAVE_VFS_FD = 0 - -# PSP -else ifeq ($(platform), psp1) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = psp-gcc$(EXE_EXT) - AR = psp-ar$(EXE_EXT) - PLATFORM_DEFINES := -DPSP -DCC_RESAMPLER -DHAVE_STRTOF_L - CFLAGS += -G0 -I$(shell psp-config --pspsdk-path)/include - STATIC_LINKING = 1 - DEFINES += -std=c99 - HAVE_VFS_FD = 0 - -# Vita -else ifeq ($(platform), vita) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = arm-vita-eabi-gcc$(EXE_EXT) - AR = arm-vita-eabi-ar$(EXE_EXT) - PLATFORM_DEFINES := -DVITA -DCC_RESAMPLER -DPSP2 -DHAVE_STRTOF_L - STATIC_LINKING = 1 - DEFINES += -std=c99 - -# CTR(3DS) -else ifeq ($(platform), ctr) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = $(DEVKITARM)/bin/arm-none-eabi-gcc$(EXE_EXT) - AR = $(DEVKITARM)/bin/arm-none-eabi-ar$(EXE_EXT) - PLATFORM_DEFINES := -DARM11 -D_3DS -D__3DS__ - PLATFORM_DEFINES += -DHAVE_STRTOF_L -DHAVE_LOCALE -D_GNU_SOURCE - - CFLAGS += -march=armv6k -mtune=mpcore -mfloat-abi=hard - CFLAGS += -Wall -mword-relocations - CFLAGS += -fomit-frame-pointer -ffast-math - CFLAGS += -I$(CTRULIB)/include - DEFINES += -std=c99 - - PLATFORM_DEFINES += -DENABLE_VFS_3DS - STATIC_LINKING = 1 - -# Xbox 360 -else ifeq ($(platform), xenon) - TARGET := $(TARGET_NAME)_libretro_xenon360.a - CC = xenon-gcc$(EXE_EXT) - AR = xenon-ar$(EXE_EXT) - PLATFORM_DEFINES := -D__LIBXENON__ - STATIC_LINKING = 1 - DEFINES += -std=c99 - HAVE_VFS_FD = 0 - -# Nintendo Game Cube / Wii / WiiU -else ifneq (,$(filter $(platform), ngc wii wiiu)) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT) - AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT) - PLATFORM_DEFINES += -DGEKKO -mcpu=750 -meabi -mhard-float -DHAVE_STRTOF_L - PLATFORM_DEFINES += -U__INT32_TYPE__ -U __UINT32_TYPE__ -D__INT32_TYPE__=int -D_GNU_SOURCE - STATIC_LINKING = 1 - DEFINES += -std=c99 - HAVE_VFS_FD = 0 - - # Nintendo WiiU - ifneq (,$(findstring wiiu,$(platform))) - PLATFORM_DEFINES += -DWIIU -DHW_RVL -mwup - - # Nintendo Wii - else ifneq (,$(findstring wii,$(platform))) - PLATFORM_DEFINES += -DHW_RVL -mrvl - - # Nintendo Game Cube - else ifneq (,$(findstring ngc,$(platform))) - PLATFORM_DEFINES += -DHW_DOL -mrvl - endif - - PLATFORM_DEFINES += -DHAVE_LOCALE - -# Nintendo Switch (libnx) -else ifeq ($(platform), libnx) - export DEPSDIR := $(CURDIR)/ - TARGET := $(TARGET_NAME)_libretro_$(platform).a - include $(DEVKITPRO)/libnx/switch_rules - STATIC_LINKING=1 - STATIC_LINKING_LINK=1 - HAVE_VFS_FD = 0 - CFLAGS += -O3 -fomit-frame-pointer -ffast-math -I$(LIBNX)/include/ -fPIE -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs - DEFINES += -std=gnu11 - ASFLAGS += -DHAVE_LIBNX - PLATFORM_DEFINES += -D__SWITCH__ -DHAVE_LIBNX -DHAVE_LOCALE - PLATFORM_DEFINES += -march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE -mcpu=cortex-a57+crc+fp+simd -DHAVE_INTTYPES -DLSB_FIRST -DINLINE=inline - -# Nintendo Switch (libtransistor) -else ifeq ($(platform), switch) - TARGET := $(TARGET_NAME)_libretro_$(platform).a - include $(LIBTRANSISTOR_HOME)/libtransistor.mk - STATIC_LINKING=1 - STATIC_LINKING_LINK=1 - HAVE_VFS_FD = 0 - CFLAGS += -fomit-frame-pointer -ffast-math - DEFINES += -std=c99 - -# Genode -else ifeq ($(platform), genode) - TARGET := $(TARGET_NAME)_libretro.lib.so - CC := $(shell pkg-config genode-base --variable=cc) - LD := $(shell pkg-config genode-base --variable=ld) - CFLAGS += $(shell pkg-config --cflags genode-libc) - LDFLAGS += -shared --version-script=link.T - LDFLAGS += $(shell pkg-config --libs genode-lib genode-libc) - LIBS = - -# emscripten -else ifeq ($(platform), emscripten) - TARGET := $(TARGET_NAME)_libretro_$(platform).bc - DEFINES += -std=gnu99 -DHAVE_LOCALE -D_GNU_SOURCE -DHAVE_STRTOF_L - STATIC_LINKING = 1 - -# GCW0 -else ifeq ($(platform), gcw0) - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T - CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc - AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar - PLATFORM_DEFINES += -D_GNU_SOURCE - CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float - CFLAGS += -fno-common -ftree-vectorize -funswitch-loops - DEFINES += -std=c99 - -# MIYOO -else ifeq ($(platform), miyoo) - TARGET := $(TARGET_NAME)_libretro.so - fpic := -fPIC - SHARED := -shared -Wl,-version-script=link.T - CC = /opt/miyoo/usr/bin/arm-linux-gcc - AR = /opt/miyoo/usr/bin/arm-linux-ar - PLATFORM_DEFINES += -D_GNU_SOURCE - CFLAGS += -fomit-frame-pointer -ffast-math -march=armv5te -mtune=arm926ej-s - CFLAGS += -fno-common -ftree-vectorize -funswitch-loops - DEFINES += -std=c99 - -# Windows -else - TARGET := $(TARGET_NAME)_libretro.dll - CC ?= gcc - SHARED := -shared -static-libgcc -static-libstdc++ -Wl,-no-undefined -Wl,-version-script=link.T - DEFINES += -std=c99 - -endif - -ifeq ($(DEBUG), 1) - CFLAGS += -O0 -g -else - CFLAGS += -O3 -endif - -DEFINES += -DHAVE_STRNDUP -DHAVE_STRDUP -DDISABLE_THREADING -DMINIMAL_CORE=2 - -include $(BUILD_DIR)/Makefile.common - -OBJS := $(SOURCES_C:.c=.o) $(SOURCES_ASM:.S=.o) - -DEFINES += $(PLATFORM_DEFINES) $(RETRODEFS) - -CFLAGS += $(CODE_DEFINES) $(fpic) $(DEFINES) - -%.o: %.c - $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) -%.o: %.S - $(CC) -c -o $@ $< $(CFLAGS) $(INCLUDES) - - -ifeq ($(platform), theos_ios) -COMMON_FLAGS := -DIOS $(COMMON_DEFINES) $(INCLUDES) -I$(THEOS_INCLUDE_PATH) -Wno-error -$(LIBRARY_NAME)_CFLAGS += $(CFLAGS) $(COMMON_FLAGS) -${LIBRARY_NAME}_FILES = $(SOURCES_C) -include $(THEOS_MAKE_PATH)/library.mk -else -all: $(TARGET) - -ifneq ($(platform),genode) -LD = $(CC) -endif - -$(TARGET): $(OBJS) -ifeq ($(STATIC_LINKING), 1) - $(AR) rcs $@ $(OBJS) -else - $(LD) -o $@ $(SHARED) $(OBJS) $(LDFLAGS) $(LIBS) -endif - -clean-objs: - rm -f $(OBJS) - -clean: - rm -f $(OBJS) - rm -f $(TARGET) - -install: - install -D -m 755 $(TARGET) $(DESTDIR)$(libdir)/$(LIBRETRO_DIR)/$(TARGET) - -uninstall: - rm $(DESTDIR)$(libdir)/$(LIBRETRO_DIR)/$(TARGET) - -.PHONY: clean clean-objs install uninstall -endif - -endif diff --git a/libretro-build/Makefile.android_arm64-v8a b/libretro-build/Makefile.android_arm64-v8a deleted file mode 100644 index 4b54b67647e..00000000000 --- a/libretro-build/Makefile.android_arm64-v8a +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_arm64-v8a - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/aarch64-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/aarch64-linux-android-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/aarch64-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/aarch64-linux-android-g++ -AS = $(NDK_ROOT_DIR)/toolchains/aarch64-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/aarch64-linux-android-as -AR = $(NDK_ROOT_DIR)/toolchains/aarch64-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/aarch64-linux-android-ar - -############ -# Extensions - -OBJEXT = .android_arm64-v8a.o -SOEXT = .android_arm64-v8a.so -LIBEXT = .android_arm64-v8a.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -DHAVE_LOCALE -PLATCFLAGS = -fpic -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 = -fpic -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-arm64 -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-arm64 -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++/$(NDK_TOOLCHAIN_VERSION)/libs/arm64-v8a/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-21/arch-arm64/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/arm64-v8a/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_armeabi b/libretro-build/Makefile.android_armeabi deleted file mode 100644 index 59b0a998f4f..00000000000 --- a/libretro-build/Makefile.android_armeabi +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_armeabi - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-g++ -AS = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-as -AR = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-ar - -############ -# Extensions - -OBJEXT = .android_armeabi.o -SOEXT = .android_armeabi.so -LIBEXT = .android_armeabi.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -PLATCFLAGS = -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -PLATCXXFLAGS = -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -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-9/arch-arm -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-9/arch-arm -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++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-9/arch-arm/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_armeabi-v7a b/libretro-build/Makefile.android_armeabi-v7a deleted file mode 100644 index cf2298295ad..00000000000 --- a/libretro-build/Makefile.android_armeabi-v7a +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_armeabi-v7a - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-g++ -AS = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-as -AR = $(NDK_ROOT_DIR)/toolchains/arm-linux-androideabi-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/arm-linux-androideabi-ar - -############ -# Extensions - -OBJEXT = .android_armeabi-v7a.o -SOEXT = .android_armeabi-v7a.so -LIBEXT = .android_armeabi-v7a.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -PLATCFLAGS = -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -PLATCXXFLAGS = -fpic -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -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-19/arch-arm -lgcc -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm -PLATLDXFLAGS = -shared --sysroot=$(NDK_ROOT_DIR)/platforms/android-19/arch-arm -lgcc -no-canonical-prefixes -march=armv7-a -Wl,--fix-cortex-a8 -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -lc -lm $(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi-v7a/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-19/arch-arm/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/armeabi/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_mips b/libretro-build/Makefile.android_mips deleted file mode 100644 index 495f5c39a03..00000000000 --- a/libretro-build/Makefile.android_mips +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_mips - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/mipsel-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mipsel-linux-android-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/mipsel-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mipsel-linux-android-g++ -AS = $(NDK_ROOT_DIR)/toolchains/mipsel-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mipsel-linux-android-as -AR = $(NDK_ROOT_DIR)/toolchains/mipsel-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mipsel-linux-android-ar - -############ -# Extensions - -OBJEXT = .android_mips.o -SOEXT = .android_mips.so -LIBEXT = .android_mips.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -PLATCFLAGS = -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -no-canonical-prefixes -fomit-frame-pointer -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -PLATCXXFLAGS = -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -no-canonical-prefixes -fomit-frame-pointer -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -fno-exceptions -fno-rtti -PLATLDFLAGS = -shared --sysroot=$(NDK_ROOT_DIR)/platforms/android-9/arch-mips -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-9/arch-mips -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++/$(NDK_TOOLCHAIN_VERSION)/libs/mips/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-9/arch-mips/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/mips/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_mips64 b/libretro-build/Makefile.android_mips64 deleted file mode 100644 index 735618b21e3..00000000000 --- a/libretro-build/Makefile.android_mips64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_mips64 - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/mips64el-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mips64el-linux-android-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/mips64el-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mips64el-linux-android-g++ -AS = $(NDK_ROOT_DIR)/toolchains/mips64el-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mips64el-linux-android-as -AR = $(NDK_ROOT_DIR)/toolchains/mips64el-linux-android-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/mips64el-linux-android-ar - -############ -# Extensions - -OBJEXT = .android_mips64.o -SOEXT = .android_mips64.so -LIBEXT = .android_mips64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -PLATCFLAGS = -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -no-canonical-prefixes -fomit-frame-pointer -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -PLATCXXFLAGS = -fpic -fno-strict-aliasing -finline-functions -ffunction-sections -funwind-tables -fmessage-length=0 -fno-inline-functions-called-once -fgcse-after-reload -frerun-cse-after-loop -frename-registers -no-canonical-prefixes -fomit-frame-pointer -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-mips64 -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-mips64 -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++/$(NDK_TOOLCHAIN_VERSION)/libs/mips64/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-21/arch-mips64/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/mips64/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_x86 b/libretro-build/Makefile.android_x86 deleted file mode 100644 index 59df307300d..00000000000 --- a/libretro-build/Makefile.android_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_x86 - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/x86-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/i686-linux-android-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/x86-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/i686-linux-android-g++ -AS = $(NDK_ROOT_DIR)/toolchains/x86-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/i686-linux-android-as -AR = $(NDK_ROOT_DIR)/toolchains/x86-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/i686-linux-android-ar - -############ -# Extensions - -OBJEXT = .android_x86.o -SOEXT = .android_x86.so -LIBEXT = .android_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -DBSPF_UNIX -DHAVE_INTTYPES -DLSB_FIRST -PLATCFLAGS = -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300 -Wa,--noexecstack -Wformat -Werror=format-security -PLATCXXFLAGS = -ffunction-sections -funwind-tables -no-canonical-prefixes -fstack-protector -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-9/arch-x86 -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-9/arch-x86 -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++/$(NDK_TOOLCHAIN_VERSION)/libs/x86/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = -I$(NDK_ROOT_DIR)/platforms/android-9/arch-x86/usr/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/x86/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.android_x86_64 b/libretro-build/Makefile.android_x86_64 deleted file mode 100644 index 842792a12dd..00000000000 --- a/libretro-build/Makefile.android_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux, Windows and Darwin -# Download the Android NDK, unpack somewhere, and set NDK_ROOT_DIR to it - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = android_x86_64 - -################# -# Toolchain setup - -CC = $(NDK_ROOT_DIR)/toolchains/x86_64-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-gcc -CXX = $(NDK_ROOT_DIR)/toolchains/x86_64-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-g++ -AS = $(NDK_ROOT_DIR)/toolchains/x86_64-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-as -AR = $(NDK_ROOT_DIR)/toolchains/x86_64-$(NDK_TOOLCHAIN_VERSION)/prebuilt/$(HOST_PLATFORM)-x86_64/bin/x86_64-linux-android-ar - -############ -# Extensions - -OBJEXT = .android_x86_64.o -SOEXT = .android_x86_64.so -LIBEXT = .android_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = android -PLATDEFS = -DANDROID -DINLINE=inline -DHAVE_STDINT_H -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++/$(NDK_TOOLCHAIN_VERSION)/libs/x86_64/libgnustl_static.a - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# 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++/$(NDK_TOOLCHAIN_VERSION)/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/libs/x86_64/include -I$(NDK_ROOT_DIR)/sources/cxx-stl/gnu-libstdc++/$(NDK_TOOLCHAIN_VERSION)/include/backward - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.common b/libretro-build/Makefile.common deleted file mode 100644 index 77383459d3f..00000000000 --- a/libretro-build/Makefile.common +++ /dev/null @@ -1,152 +0,0 @@ -#plain 'make' doesn't include the file that sets this. force it set anyways. -RETRODEFS ?= -D__LIBRETRO__ -RETRODEFS += -DMINIMAL_CORE=2 -DM_CORE_GBA -DM_CORE_GB -DENABLE_VFS -DENABLE_DIRECTORIES - -INCLUDES += -I$(CORE_DIR)/src -I$(CORE_DIR)/src/arm -I$(CORE_DIR)/include -I$(CORE_DIR)/src/platform/libretro -RETRODEFS += -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DINLINE=inline -DCOLOR_16_BIT -DRESAMPLE_LIBRARY=2 -DM_PI=3.14159265358979323846 -DMGBA_STANDALONE -ifeq ($(platform), ps3) -RETRODEFS += -DPATH_MAX=1024 -else -RETRODEFS += -DPATH_MAX=4096 -endif -ifneq ($(TARGET_PLATFORM), android_arm64-v8a) - RETRODEFS += -DSSIZE_MAX=2147483648 -endif - -ifeq ($(STATIC_LINKING), 1) -INCLUDES += -I$(CORE_DIR)/src/third-party/zlib \ - -I$(CORE_DIR)/libretro-build/include/libz -endif - -ifneq ($(DEBUG), 1) - RETRODEFS += -DNDEBUG -endif - -ifneq ($(HAVE_VFS_FD),1) -RETRODEFS += -DENABLE_VFS_FILE -endif - -ifeq (,$(findstring win,$(platform))) -ifeq (,$(findstring mingw,$(platform))) -ifneq ($(platform), vita) -ifneq ($(platform), ps3) -RETRODEFS += -DHAVE_LOCALTIME_R -endif -endif -endif -endif - -ifneq ($(platform), ps2) -RETRODEFS += -DCOLOR_5_6_5 -endif - -SOURCES_C := $(CORE_DIR)/src/arm/arm.c \ - $(CORE_DIR)/src/arm/decoder.c \ - $(CORE_DIR)/src/arm/decoder-arm.c \ - $(CORE_DIR)/src/arm/decoder-thumb.c \ - $(CORE_DIR)/src/arm/isa-thumb.c \ - $(CORE_DIR)/src/arm/isa-arm.c \ - $(CORE_DIR)/src/core/bitmap-cache.c \ - $(CORE_DIR)/src/core/cache-set.c \ - $(CORE_DIR)/src/core/cheats.c \ - $(CORE_DIR)/src/core/config.c \ - $(CORE_DIR)/src/core/core.c \ - $(CORE_DIR)/src/core/interface.c \ - $(CORE_DIR)/src/core/lockstep.c \ - $(CORE_DIR)/src/core/log.c \ - $(CORE_DIR)/src/core/map-cache.c \ - $(CORE_DIR)/src/core/sync.c \ - $(CORE_DIR)/src/core/thread.c \ - $(CORE_DIR)/src/core/tile-cache.c \ - $(CORE_DIR)/src/core/core-serialize.c \ - $(CORE_DIR)/src/core/timing.c \ - $(CORE_DIR)/src/gb/audio.c \ - $(CORE_DIR)/src/gb/cheats.c \ - $(CORE_DIR)/src/gb/core.c \ - $(CORE_DIR)/src/gb/gb.c \ - $(CORE_DIR)/src/gb/io.c \ - $(CORE_DIR)/src/gb/mbc.c \ - $(CORE_DIR)/src/gb/mbc/huc-3.c \ - $(CORE_DIR)/src/gb/mbc/licensed.c \ - $(CORE_DIR)/src/gb/mbc/mbc.c \ - $(CORE_DIR)/src/gb/mbc/pocket-cam.c \ - $(CORE_DIR)/src/gb/mbc/tama5.c \ - $(CORE_DIR)/src/gb/mbc/unlicensed.c \ - $(CORE_DIR)/src/gb/memory.c \ - $(CORE_DIR)/src/gb/overrides.c \ - $(CORE_DIR)/src/gb/renderers/cache-set.c \ - $(CORE_DIR)/src/gb/renderers/software.c \ - $(CORE_DIR)/src/gb/serialize.c \ - $(CORE_DIR)/src/gb/sio.c \ - $(CORE_DIR)/src/gb/timer.c \ - $(CORE_DIR)/src/gb/video.c \ - $(CORE_DIR)/src/gba/audio.c \ - $(CORE_DIR)/src/gba/bios.c \ - $(CORE_DIR)/src/gba/cheats.c \ - $(CORE_DIR)/src/gba/cheats/gameshark.c \ - $(CORE_DIR)/src/gba/cheats/parv3.c \ - $(CORE_DIR)/src/gba/cheats/codebreaker.c \ - $(CORE_DIR)/src/gba/core.c \ - $(CORE_DIR)/src/gba/dma.c \ - $(CORE_DIR)/src/gba/gba.c \ - $(CORE_DIR)/src/gba/cart/gpio.c \ - $(CORE_DIR)/src/gba/cart/ereader.c \ - $(CORE_DIR)/src/gba/cart/unlicensed.c \ - $(CORE_DIR)/src/gba/hle-bios.c \ - $(CORE_DIR)/src/gba/input.c \ - $(CORE_DIR)/src/gba/io.c \ - $(CORE_DIR)/src/gba/cart/matrix.c \ - $(CORE_DIR)/src/gba/memory.c \ - $(CORE_DIR)/src/gba/overrides.c \ - $(CORE_DIR)/src/gba/renderers/cache-set.c \ - $(CORE_DIR)/src/gba/renderers/common.c \ - $(CORE_DIR)/src/gba/renderers/software-mode0.c \ - $(CORE_DIR)/src/gba/renderers/software-obj.c \ - $(CORE_DIR)/src/gba/renderers/software-bg.c \ - $(CORE_DIR)/src/gba/renderers/video-software.c \ - $(CORE_DIR)/src/gba/savedata.c \ - $(CORE_DIR)/src/gba/serialize.c \ - $(CORE_DIR)/src/gba/sio.c \ - $(CORE_DIR)/src/gba/sio/gbp.c \ - $(CORE_DIR)/src/gba/timer.c \ - $(CORE_DIR)/src/gba/cart/vfame.c \ - $(CORE_DIR)/src/gba/video.c \ - $(CORE_DIR)/src/platform/libretro/memory.c \ - $(CORE_DIR)/src/platform/libretro/libretro.c \ - $(CORE_DIR)/src/platform/libretro/libretro-vfs.c \ - $(CORE_DIR)/src/platform/libretro/libretro-audio.c \ - $(CORE_DIR)/src/sm83/isa-sm83.c \ - $(CORE_DIR)/src/sm83/sm83.c \ - $(CORE_DIR)/src/third-party/inih/ini.c \ - $(CORE_DIR)/src/util/audio-buffer.c \ - $(CORE_DIR)/src/util/circle-buffer.c \ - $(CORE_DIR)/src/util/configuration.c \ - $(CORE_DIR)/src/util/formatting.c \ - $(CORE_DIR)/src/util/gbk-table.c \ - $(CORE_DIR)/src/util/geometry.c \ - $(CORE_DIR)/src/util/hash.c \ - $(CORE_DIR)/src/util/image.c \ - $(CORE_DIR)/src/util/md5.c \ - $(CORE_DIR)/src/util/sha1.c \ - $(CORE_DIR)/src/util/patch.c \ - $(CORE_DIR)/src/util/patch-ips.c \ - $(CORE_DIR)/src/util/patch-ups.c \ - $(CORE_DIR)/src/util/string.c \ - $(CORE_DIR)/src/util/table.c \ - $(CORE_DIR)/src/util/vector.c \ - $(CORE_DIR)/src/util/vfs.c \ - $(CORE_DIR)/src/util/vfs/vfs-mem.c \ - $(CORE_DIR)/src/util/crc32.c - -ifeq ($(HAVE_VFS_FD),1) -RETRODEFS += -DENABLE_VFS_FD -ifeq ($(platform), vita) -SOURCES_C += $(CORE_DIR)/src/platform/psp2/sce-vfs.c -else ifeq ($(platform), ctr) -SOURCES_C += $(CORE_DIR)/src/platform/3ds/3ds-vfs.c -else -SOURCES_C += $(CORE_DIR)/src/util/vfs/vfs-fd.c -endif -else -SOURCES_C += $(CORE_DIR)/src/util/vfs/vfs-file.c -endif diff --git a/libretro-build/Makefile.linux-portable_x86 b/libretro-build/Makefile.linux-portable_x86 deleted file mode 100644 index 61c06906e6e..00000000000 --- a/libretro-build/Makefile.linux-portable_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# apt-get install g++-multilib libc6-dev-i386 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = linux-portable_x86 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .linux-portable_x86.o -SOEXT = .linux-portable_x86.so -LIBEXT = .linux-portable_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = unix -PLATDEFS = -PLATCFLAGS = -m32 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m32 -fpic -fstrict-aliasing -PLATLDFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -PLATLDXFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.linux-portable_x86_64 b/libretro-build/Makefile.linux-portable_x86_64 deleted file mode 100644 index ecfbcf54bda..00000000000 --- a/libretro-build/Makefile.linux-portable_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = linux-portable_x86_64 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .linux-portable_x86_64.o -SOEXT = .linux-portable_x86_64.so -LIBEXT = .linux-portable_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = unix -PLATDEFS = -PLATCFLAGS = -m64 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m64 -fpic -fstrict-aliasing -PLATLDFLAGS = -m64 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -PLATLDXFLAGS = -m64 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.linux_x86 b/libretro-build/Makefile.linux_x86 deleted file mode 100644 index 68b5fa8687c..00000000000 --- a/libretro-build/Makefile.linux_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# apt-get install g++-multilib libc6-dev-i386 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = linux_x86 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .linux_x86.o -SOEXT = .linux_x86.so -LIBEXT = .linux_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = unix -PLATDEFS = -PLATCFLAGS = -m32 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m32 -fpic -fstrict-aliasing -PLATLDFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined -PLATLDXFLAGS = -m32 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.linux_x86_64 b/libretro-build/Makefile.linux_x86_64 deleted file mode 100644 index 7a304bdb0fd..00000000000 --- a/libretro-build/Makefile.linux_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = linux_x86_64 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .linux_x86_64.o -SOEXT = .linux_x86_64.so -LIBEXT = .linux_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = unix -PLATDEFS = -PLATCFLAGS = -m64 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m64 -fpic -fstrict-aliasing -PLATLDFLAGS = -m64 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined -PLATLDXFLAGS = -m64 -shared -lm -Wl,-version-script=$(BUILD_DIR)/link.T -Wl,-no-undefined - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.mingw_x86 b/libretro-build/Makefile.mingw_x86 deleted file mode 100644 index 3c286f6108a..00000000000 --- a/libretro-build/Makefile.mingw_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Windows -# Install MSYS2 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = mingw_x86 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .mingw_x86.o -SOEXT = .mingw_x86.dll -LIBEXT = .mingw_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = win -PLATDEFS = -PLATCFLAGS = -m32 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m32 -fpic -fstrict-aliasing -PLATLDFLAGS = -m32 -shared -lm -PLATLDXFLAGS = -m32 -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.mingw_x86_64 b/libretro-build/Makefile.mingw_x86_64 deleted file mode 100644 index 45dbdfd5c33..00000000000 --- a/libretro-build/Makefile.mingw_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Windows -# Install MSYS2 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = mingw_x86_64 - -################# -# Toolchain setup - -CC = gcc -CXX = g++ -AS = as -AR = ar - -############ -# Extensions - -OBJEXT = .mingw_x86_64.o -SOEXT = .mingw_x86_64.dll -LIBEXT = .mingw_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = win -PLATDEFS = -PLATCFLAGS = -m64 -fpic -fstrict-aliasing -PLATCXXFLAGS = -m64 -fpic -fstrict-aliasing -PLATLDFLAGS = -m64 -shared -lm -PLATLDXFLAGS = -m64 -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.osx_x86 b/libretro-build/Makefile.osx_x86 deleted file mode 100644 index 7c119552bda..00000000000 --- a/libretro-build/Makefile.osx_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# Compile and install OSXCROSS: https://github.com/tpoechtrager/osxcross - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = osx_x86 - -################# -# Toolchain setup - -CC = $(OSXCROSS_ROOT_DIR)/target/bin/i386-apple-darwin13-cc -CXX = $(OSXCROSS_ROOT_DIR)/target/bin/i386-apple-darwin13-c++ -AS = $(OSXCROSS_ROOT_DIR)/target/bin/i386-apple-darwin13-as -AR = $(OSXCROSS_ROOT_DIR)/target/bin/i386-apple-darwin13-ar - -############ -# Extensions - -OBJEXT = .osx_x86.o -SOEXT = .osx_x86.dylib -LIBEXT = .osx_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = osx -PLATDEFS = -PLATCFLAGS = -fstrict-aliasing -PLATCXXFLAGS = -fstrict-aliasing -PLATLDFLAGS = -shared -lm -PLATLDXFLAGS = -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -DHAVE_STRLCPY -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.osx_x86_64 b/libretro-build/Makefile.osx_x86_64 deleted file mode 100644 index 58ac79c7420..00000000000 --- a/libretro-build/Makefile.osx_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# Compile and install OSXCROSS: https://github.com/tpoechtrager/osxcross - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = osx_x86_64 - -################# -# Toolchain setup - -CC = $(OSXCROSS_ROOT_DIR)/target/bin/x86_64-apple-darwin13-cc -CXX = $(OSXCROSS_ROOT_DIR)/target/bin/x86_64-apple-darwin13-c++ -AS = $(OSXCROSS_ROOT_DIR)/target/bin/x86_64-apple-darwin13-as -AR = $(OSXCROSS_ROOT_DIR)/target/bin/x86_64-apple-darwin13-ar - -############ -# Extensions - -OBJEXT = .osx_x86_64.o -SOEXT = .osx_x86_64.dylib -LIBEXT = .osx_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = osx -PLATDEFS = -PLATCFLAGS = -fpic -fstrict-aliasing -PLATCXXFLAGS = -fpic -fstrict-aliasing -PLATLDFLAGS = -shared -lm -PLATLDXFLAGS = -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -DHAVE_STRLCPY -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.rules b/libretro-build/Makefile.rules deleted file mode 100644 index 127cd8a3cec..00000000000 --- a/libretro-build/Makefile.rules +++ /dev/null @@ -1,45 +0,0 @@ -TARGET_NAME ?= mgba - -GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" -ifneq ($(GIT_VERSION)," unknown") - DEFINES += -DGIT_VERSION=\"$(GIT_VERSION)\" -endif - -ifeq ($(STATIC_LINKING), 1) - TARGET = $(TARGET_NAME)_libretro_$(platform).a -else - TARGET = $(TARGET_NAME)_libretro$(SOEXT) -endif - -DEFINES += -CFLAGS += -Wall -std=c99 -CXXFLAGS += -Wall -LDFLAGS += - -OBJS = $(SOURCES_C:.c=$(OBJEXT)) $(SOURCES_CXX:.cpp=$(OBJEXT)) - -%$(OBJEXT): %.cpp - $(CXX) -c -o $@ $< $(CXXFLAGS) - -%$(OBJEXT): %.c - $(CC) -c -o $@ $< $(CFLAGS) - -%$(OBJEXT): %.S - $(CC_AS) -c -o $@ $< $(CFLAGS) - -all: $(TARGET) - -$(TARGET): $(HEADERS) $(OBJS) -ifeq ($(STATIC_LINKING), 1) - $(AR) rcs $@ $(OBJS) -else - $(CC) -o $@ $(OBJS) $(LDFLAGS) -endif - -clean-objs: - rm -f $(OBJS) - -clean: clean-objs - rm -f $(TARGET) - -.PHONY: clean-objs clean dist-clean FORCE diff --git a/libretro-build/Makefile.vita_arm b/libretro-build/Makefile.vita_arm deleted file mode 100644 index 557ef95ba45..00000000000 --- a/libretro-build/Makefile.vita_arm +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# Install vitasdk - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = vita_arm - -################# -# Toolchain setup - -CC = $(VITASDK)/bin/arm-vita-eabi-gcc -CXX = $(VITASDK)/bin/arm-vita-eabi-g++ -AS = $(VITASDK)/bin/arm-vita-eabi-as -AR = $(VITASDK)/bin/arm-vita-eabi-ar - -############ -# Extensions - -OBJEXT = .vita_arm.o -SOEXT = .vita_arm.so -LIBEXT = .vita_arm.a - -################ -# Platform setup - -STATIC_LINKING = 1 -platform = vita -PLATDEFS = -DVITA -PLATCFLAGS = -ftree-vectorize -mfloat-abi=hard -ffast-math -fsingle-precision-constant -funroll-loops -fno-short-enums -PLATCXXFLAGS = -ftree-vectorize -mfloat-abi=hard -ffast-math -fsingle-precision-constant -funroll-loops -fno-short-enums -PLATLDFLAGS = -shared -lm -mthumb -mcpu=cortex-a9 -mfloat-abi=hard -PLATLDXFLAGS = -shared -lm -mthumb -mcpu=cortex-a9 -mfloat-abi=hard - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.wii_ppc b/libretro-build/Makefile.wii_ppc deleted file mode 100644 index 89bd5d15ebe..00000000000 --- a/libretro-build/Makefile.wii_ppc +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# Install devkitppc - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = wii_ppc - -################# -# Toolchain setup - -CC = $(DEVKITPPC_ROOT_DIR)/bin/powerpc-eabi-gcc -CXX = $(DEVKITPPC_ROOT_DIR)/bin/powerpc-eabi-g++ -AS = $(DEVKITPPC_ROOT_DIR)/bin/powerpc-eabi-as -AR = $(DEVKITPPC_ROOT_DIR)/bin/powerpc-eabi-ar - -############ -# Extensions - -OBJEXT = .wii_ppc.o -SOEXT = .wii_ppc.so -LIBEXT = .wii_ppc.a - -################ -# Platform setup - -STATIC_LINKING = 1 -platform = wii -PLATDEFS = -DGEKKO -DHW_RVL -PLATCFLAGS = -m32 -fstrict-aliasing -mrvl -mcpu=750 -meabi -mhard-float -PLATCXXFLAGS = -m32 -fstrict-aliasing -mrvl -mcpu=750 -meabi -mhard-float -PLATLDFLAGS = -shared -lm -PLATLDXFLAGS = -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.windows_x86 b/libretro-build/Makefile.windows_x86 deleted file mode 100644 index 48940305504..00000000000 --- a/libretro-build/Makefile.windows_x86 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# apt-get install mingw-w64 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = windows_x86 - -################# -# Toolchain setup - -CC = i686-w64-mingw32-gcc -CXX = i686-w64-mingw32-g++ -AS = i686-w64-mingw32-as -AR = i686-w64-mingw32-ar - -############ -# Extensions - -OBJEXT = .windows_x86.o -SOEXT = .windows_x86.dll -LIBEXT = .windows_x86.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = win -PLATDEFS = -PLATCFLAGS = -fstrict-aliasing -PLATCXXFLAGS = -fstrict-aliasing -PLATLDFLAGS = -shared -lm -PLATLDXFLAGS = -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/Makefile.windows_x86_64 b/libretro-build/Makefile.windows_x86_64 deleted file mode 100644 index 4d61da7f2ce..00000000000 --- a/libretro-build/Makefile.windows_x86_64 +++ /dev/null @@ -1,96 +0,0 @@ -############## -# Works on hosts Linux -# apt-get install mingw-w64 - -######################### -# Check 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 - -######################### -# Set the target platform - -TARGET_PLATFORM = windows_x86_64 - -################# -# Toolchain setup - -CC = x86_64-w64-mingw32-gcc -CXX = x86_64-w64-mingw32-g++ -AS = x86_64-w64-mingw32-as -AR = x86_64-w64-mingw32-ar - -############ -# Extensions - -OBJEXT = .windows_x86_64.o -SOEXT = .windows_x86_64.dll -LIBEXT = .windows_x86_64.a - -################ -# Platform setup - -STATIC_LINKING = 0 -platform = win -PLATDEFS = -PLATCFLAGS = -fpic -fstrict-aliasing -PLATCXXFLAGS = -fpic -fstrict-aliasing -PLATLDFLAGS = -shared -lm -PLATLDXFLAGS = -shared -lm - -################ -# libretro setup - -RETRODEFS = -D__LIBRETRO__ -RETROCFLAGS = -RETROCXXFLAGS = -RETROLDFLAGS = -RETROLDXFLAGS = - -################# -# Final variables - -DEFINES = $(PLATDEFS) $(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 - -#################################### -# Variable setup for Makefile.common - -CORE_DIR ?= .. -BUILD_DIR ?= . -INCLUDES = - -include $(BUILD_DIR)/Makefile.common - -############### -# Include rules - -include $(BUILD_DIR)/Makefile.rules diff --git a/libretro-build/include/libz/zconf.h b/libretro-build/include/libz/zconf.h deleted file mode 100644 index 9987a775530..00000000000 --- a/libretro-build/include/libz/zconf.h +++ /dev/null @@ -1,511 +0,0 @@ -/* zconf.h -- configuration of the zlib compression library - * Copyright (C) 1995-2013 Jean-loup Gailly. - * For conditions of distribution and use, see copyright notice in zlib.h - */ - -/* @(#) $Id$ */ - -#ifndef ZCONF_H -#define ZCONF_H - -/* - * If you *really* need a unique prefix for all types and library functions, - * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. - * Even better than compiling with -DZ_PREFIX would be to use configure to set - * this permanently in zconf.h using "./configure --zprefix". - */ -#ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ -# define Z_PREFIX_SET - -/* all linked symbols */ -# define _dist_code z__dist_code -# define _length_code z__length_code -# define _tr_align z__tr_align -# define _tr_flush_bits z__tr_flush_bits -# define _tr_flush_block z__tr_flush_block -# define _tr_init z__tr_init -# define _tr_stored_block z__tr_stored_block -# define _tr_tally z__tr_tally -# define adler32 z_adler32 -# define adler32_combine z_adler32_combine -# define adler32_combine64 z_adler32_combine64 -# ifndef Z_SOLO -# define compress z_compress -# define compress2 z_compress2 -# define compressBound z_compressBound -# endif -# define crc32 z_crc32 -# define crc32_combine z_crc32_combine -# define crc32_combine64 z_crc32_combine64 -# define deflate z_deflate -# define deflateBound z_deflateBound -# define deflateCopy z_deflateCopy -# define deflateEnd z_deflateEnd -# define deflateInit2_ z_deflateInit2_ -# define deflateInit_ z_deflateInit_ -# define deflateParams z_deflateParams -# define deflatePending z_deflatePending -# define deflatePrime z_deflatePrime -# define deflateReset z_deflateReset -# define deflateResetKeep z_deflateResetKeep -# define deflateSetDictionary z_deflateSetDictionary -# define deflateSetHeader z_deflateSetHeader -# define deflateTune z_deflateTune -# define deflate_copyright z_deflate_copyright -# define get_crc_table z_get_crc_table -# ifndef Z_SOLO -# define gz_error z_gz_error -# define gz_intmax z_gz_intmax -# define gz_strwinerror z_gz_strwinerror -# define gzbuffer z_gzbuffer -# define gzclearerr z_gzclearerr -# define gzclose z_gzclose -# define gzclose_r z_gzclose_r -# define gzclose_w z_gzclose_w -# define gzdirect z_gzdirect -# define gzdopen z_gzdopen -# define gzeof z_gzeof -# define gzerror z_gzerror -# define gzflush z_gzflush -# define gzgetc z_gzgetc -# define gzgetc_ z_gzgetc_ -# define gzgets z_gzgets -# define gzoffset z_gzoffset -# define gzoffset64 z_gzoffset64 -# define gzopen z_gzopen -# define gzopen64 z_gzopen64 -# ifdef _WIN32 -# define gzopen_w z_gzopen_w -# endif -# define gzprintf z_gzprintf -# define gzvprintf z_gzvprintf -# define gzputc z_gzputc -# define gzputs z_gzputs -# define gzread z_gzread -# define gzrewind z_gzrewind -# define gzseek z_gzseek -# define gzseek64 z_gzseek64 -# define gzsetparams z_gzsetparams -# define gztell z_gztell -# define gztell64 z_gztell64 -# define gzungetc z_gzungetc -# define gzwrite z_gzwrite -# endif -# define inflate z_inflate -# define inflateBack z_inflateBack -# define inflateBackEnd z_inflateBackEnd -# define inflateBackInit_ z_inflateBackInit_ -# define inflateCopy z_inflateCopy -# define inflateEnd z_inflateEnd -# define inflateGetHeader z_inflateGetHeader -# define inflateInit2_ z_inflateInit2_ -# define inflateInit_ z_inflateInit_ -# define inflateMark z_inflateMark -# define inflatePrime z_inflatePrime -# define inflateReset z_inflateReset -# define inflateReset2 z_inflateReset2 -# define inflateSetDictionary z_inflateSetDictionary -# define inflateGetDictionary z_inflateGetDictionary -# define inflateSync z_inflateSync -# define inflateSyncPoint z_inflateSyncPoint -# define inflateUndermine z_inflateUndermine -# define inflateResetKeep z_inflateResetKeep -# define inflate_copyright z_inflate_copyright -# define inflate_fast z_inflate_fast -# define inflate_table z_inflate_table -# ifndef Z_SOLO -# define uncompress z_uncompress -# endif -# define zError z_zError -# ifndef Z_SOLO -# define zcalloc z_zcalloc -# define zcfree z_zcfree -# endif -# define zlibCompileFlags z_zlibCompileFlags -# define zlibVersion z_zlibVersion - -/* all zlib typedefs in zlib.h and zconf.h */ -# define Byte z_Byte -# define Bytef z_Bytef -# define alloc_func z_alloc_func -# define charf z_charf -# define free_func z_free_func -# ifndef Z_SOLO -# define gzFile z_gzFile -# endif -# define gz_header z_gz_header -# define gz_headerp z_gz_headerp -# define in_func z_in_func -# define intf z_intf -# define out_func z_out_func -# define uInt z_uInt -# define uIntf z_uIntf -# define uLong z_uLong -# define uLongf z_uLongf -# define voidp z_voidp -# define voidpc z_voidpc -# define voidpf z_voidpf - -/* all zlib structs in zlib.h and zconf.h */ -# define gz_header_s z_gz_header_s -# define internal_state z_internal_state - -#endif - -#if defined(__MSDOS__) && !defined(MSDOS) -# define MSDOS -#endif -#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) -# define OS2 -#endif -#if defined(_WINDOWS) && !defined(WINDOWS) -# define WINDOWS -#endif -#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) -# ifndef WIN32 -# define WIN32 -# endif -#endif -#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) -# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) -# ifndef SYS16BIT -# define SYS16BIT -# endif -# endif -#endif - -/* - * Compile with -DMAXSEG_64K if the alloc function cannot allocate more - * than 64k bytes at a time (needed on systems with 16-bit int). - */ -#ifdef SYS16BIT -# define MAXSEG_64K -#endif -#ifdef MSDOS -# define UNALIGNED_OK -#endif - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif -#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus)) -# define STDC -#endif -#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__)) -# define STDC -#endif -#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32)) -# define STDC -#endif -#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__)) -# define STDC -#endif - -#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */ -# define STDC -#endif - -#ifndef STDC -# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */ -# define const /* note: need a more gentle solution here */ -# endif -#endif - -#if defined(ZLIB_CONST) && !defined(z_const) -# define z_const const -#else -# define z_const -#endif - -/* Some Mac compilers merge all .h files incorrectly: */ -#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__) -# define NO_DUMMY_DECL -#endif - -/* Maximum value for memLevel in deflateInit2 */ -#ifndef MAX_MEM_LEVEL -# ifdef MAXSEG_64K -# define MAX_MEM_LEVEL 8 -# else -# define MAX_MEM_LEVEL 9 -# endif -#endif - -/* Maximum value for windowBits in deflateInit2 and inflateInit2. - * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files - * created by gzip. (Files created by minigzip can still be extracted by - * gzip.) - */ -#ifndef MAX_WBITS -# define MAX_WBITS 15 /* 32K LZ77 window */ -#endif - -/* The memory requirements for deflate are (in bytes): - (1 << (windowBits+2)) + (1 << (memLevel+9)) - that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values) - plus a few kilobytes for small objects. For example, if you want to reduce - the default memory requirements from 256K to 128K, compile with - make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7" - Of course this will generally degrade compression (there's no free lunch). - - The memory requirements for inflate are (in bytes) 1 << windowBits - that is, 32K for windowBits=15 (default value) plus a few kilobytes - for small objects. -*/ - - /* Type declarations */ - -#ifndef OF /* function prototypes */ -# ifdef STDC -# define OF(args) args -# else -# define OF(args) () -# endif -#endif - -#ifndef Z_ARG /* function prototypes for stdarg */ -# if defined(STDC) || defined(Z_HAVE_STDARG_H) -# define Z_ARG(args) args -# else -# define Z_ARG(args) () -# endif -#endif - -/* The following definitions for FAR are needed only for MSDOS mixed - * model programming (small or medium model with some far allocations). - * This was tested only with MSC; for other MSDOS compilers you may have - * to define NO_MEMCPY in zutil.h. If you don't need the mixed model, - * just define FAR to be empty. - */ -#ifdef SYS16BIT -# if defined(M_I86SM) || defined(M_I86MM) - /* MSC small or medium model */ -# define SMALL_MEDIUM -# ifdef _MSC_VER -# define FAR _far -# else -# define FAR far -# endif -# endif -# if (defined(__SMALL__) || defined(__MEDIUM__)) - /* Turbo C small or medium model */ -# define SMALL_MEDIUM -# ifdef __BORLANDC__ -# define FAR _far -# else -# define FAR far -# endif -# endif -#endif - -#if defined(WINDOWS) || defined(WIN32) - /* If building or using zlib as a DLL, define ZLIB_DLL. - * This is not mandatory, but it offers a little performance increase. - */ -# ifdef ZLIB_DLL -# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500)) -# ifdef ZLIB_INTERNAL -# define ZEXTERN extern __declspec(dllexport) -# else -# define ZEXTERN extern __declspec(dllimport) -# endif -# endif -# endif /* ZLIB_DLL */ - /* If building or using zlib with the WINAPI/WINAPIV calling convention, - * define ZLIB_WINAPI. - * Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI. - */ -# ifdef ZLIB_WINAPI -# ifdef FAR -# undef FAR -# endif -# include - /* No need for _export, use ZLIB.DEF instead. */ - /* For complete Windows compatibility, use WINAPI, not __stdcall. */ -# define ZEXPORT WINAPI -# ifdef WIN32 -# define ZEXPORTVA WINAPIV -# else -# define ZEXPORTVA FAR CDECL -# endif -# endif -#endif - -#if defined (__BEOS__) -# ifdef ZLIB_DLL -# ifdef ZLIB_INTERNAL -# define ZEXPORT __declspec(dllexport) -# define ZEXPORTVA __declspec(dllexport) -# else -# define ZEXPORT __declspec(dllimport) -# define ZEXPORTVA __declspec(dllimport) -# endif -# endif -#endif - -#ifndef ZEXTERN -# define ZEXTERN extern -#endif -#ifndef ZEXPORT -# define ZEXPORT -#endif -#ifndef ZEXPORTVA -# define ZEXPORTVA -#endif - -#ifndef FAR -# define FAR -#endif - -#if !defined(__MACTYPES__) -typedef unsigned char Byte; /* 8 bits */ -#endif -typedef unsigned int uInt; /* 16 bits or more */ -typedef unsigned long uLong; /* 32 bits or more */ - -#ifdef SMALL_MEDIUM - /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */ -# define Bytef Byte FAR -#else - typedef Byte FAR Bytef; -#endif -typedef char FAR charf; -typedef int FAR intf; -typedef uInt FAR uIntf; -typedef uLong FAR uLongf; - -#ifdef STDC - typedef void const *voidpc; - typedef void FAR *voidpf; - typedef void *voidp; -#else - typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; -#endif - -#if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC) -# include -# if (UINT_MAX == 0xffffffffUL) -# define Z_U4 unsigned -# elif (ULONG_MAX == 0xffffffffUL) -# define Z_U4 unsigned long -# elif (USHRT_MAX == 0xffffffffUL) -# define Z_U4 unsigned short -# endif -#endif - -#ifdef Z_U4 - typedef Z_U4 z_crc_t; -#else - typedef unsigned long z_crc_t; -#endif - -#ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_UNISTD_H -#endif - -#ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ -# define Z_HAVE_STDARG_H -#endif - -#ifdef STDC -# ifndef Z_SOLO -# include /* for off_t */ -# endif -#endif - -#if defined(STDC) || defined(Z_HAVE_STDARG_H) -# ifndef Z_SOLO -# include /* for va_list */ -# endif -#endif - -#ifdef _WIN32 -# ifndef Z_SOLO -# include /* for wchar_t */ -# endif -#endif - -/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and - * "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even - * though the former does not conform to the LFS document), but considering - * both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as - * equivalently requesting no 64-bit operations - */ -#if defined(_LARGEFILE64_SOURCE) && -_LARGEFILE64_SOURCE - -1 == 1 -# undef _LARGEFILE64_SOURCE -#endif - -#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H) -# define Z_HAVE_UNISTD_H -#endif -#ifndef Z_SOLO -# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) -# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */ -# ifdef VMS -# include /* for off_t */ -# endif -# ifndef z_off_t -# define z_off_t off_t -# endif -# endif -#endif - -#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0 -# define Z_LFS64 -#endif - -#if defined(_LARGEFILE64_SOURCE) && defined(Z_LFS64) -# define Z_LARGE64 -#endif - -#if defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS-0 == 64 && defined(Z_LFS64) -# define Z_WANT64 -#endif - -#if !defined(SEEK_SET) && !defined(Z_SOLO) -# define SEEK_SET 0 /* Seek from beginning of file. */ -# define SEEK_CUR 1 /* Seek from current position. */ -# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ -#endif - -#ifndef z_off_t -# define z_off_t long -#endif - -#if !defined(_WIN32) && defined(Z_LARGE64) -# define z_off64_t off64_t -#else -# if defined(_WIN32) && !defined(__GNUC__) && !defined(Z_SOLO) -# define z_off64_t __int64 -# else -# define z_off64_t z_off_t -# endif -#endif - -/* MVS linker does not support external names larger than 8 bytes */ -#if defined(__MVS__) - #pragma map(deflateInit_,"DEIN") - #pragma map(deflateInit2_,"DEIN2") - #pragma map(deflateEnd,"DEEND") - #pragma map(deflateBound,"DEBND") - #pragma map(inflateInit_,"ININ") - #pragma map(inflateInit2_,"ININ2") - #pragma map(inflateEnd,"INEND") - #pragma map(inflateSync,"INSY") - #pragma map(inflateSetDictionary,"INSEDI") - #pragma map(compressBound,"CMBND") - #pragma map(inflate_table,"INTABL") - #pragma map(inflate_fast,"INFA") - #pragma map(inflate_copyright,"INCOPY") -#endif - -#endif /* ZCONF_H */ diff --git a/libretro-build/jni/Android.mk b/libretro-build/jni/Android.mk deleted file mode 100644 index 74654986bdc..00000000000 --- a/libretro-build/jni/Android.mk +++ /dev/null @@ -1,23 +0,0 @@ -LOCAL_PATH := $(call my-dir) - -CORE_DIR := $(LOCAL_PATH)/../.. - -HAVE_VFS_FD = 1 - -include $(CORE_DIR)/libretro-build/Makefile.common - -COREFLAGS := -DHAVE_XLOCALE -DHAVE_STRTOF_L -DDISABLE_THREADING -DMINIMAL_CORE=2 $(RETRODEFS) $(INCLUDES) - -GIT_VERSION := " $(shell git rev-parse --short HEAD || echo unknown)" -ifneq ($(GIT_VERSION)," unknown") - COREFLAGS += -DGIT_VERSION=\"$(GIT_VERSION)\" -endif - -include $(CLEAR_VARS) -LOCAL_MODULE := retro -LOCAL_SRC_FILES := $(SOURCES_C) $(SOURCES_CXX) -LOCAL_CPPFLAGS := -O3 $(COREFLAGS) -LOCAL_CFLAGS := -O3 $(COREFLAGS) -LOCAL_LDFLAGS := -Wl,-version-script=$(CORE_DIR)/link.T -LOCAL_ARM_MODE := arm -include $(BUILD_SHARED_LIBRARY) diff --git a/libretro-build/jni/Application.mk b/libretro-build/jni/Application.mk deleted file mode 100644 index bdf815d1e94..00000000000 --- a/libretro-build/jni/Application.mk +++ /dev/null @@ -1,2 +0,0 @@ -APP_ABI := all -APP_PLATFORM := android-16 diff --git a/libretro-build/link.T b/libretro-build/link.T deleted file mode 100644 index b0c262db9ef..00000000000 --- a/libretro-build/link.T +++ /dev/null @@ -1,5 +0,0 @@ -{ - global: retro_*; - local: *; -}; - From 84f494edcb3e8c8b342a8677dca948b7444592da Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Mon, 3 Aug 2026 19:50:12 -0400 Subject: [PATCH 8/8] libretro: migrate to cmake --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52980b7204d..55a6225d6b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1074,6 +1074,12 @@ if(BUILD_LIBRETRO) if(CMAKE_C_FLAGS MATCHES "GEKKO") list(APPEND LIBRETRO_EXTRA_FLAGS -U__INT32_TYPE__ -U__UINT32_TYPE__ -D__INT32_TYPE__=int) endif() + # Buildroot-style toolchain files blank CMAKE_C_FLAGS_RELEASE and carry + # optimization in cached CMAKE_C_FLAGS, which CI's -DCMAKE_C_FLAGS + # override discards — leaving -O0. Pin the optimization level. + if(NOT MSVC) + list(APPEND LIBRETRO_EXTRA_FLAGS -O3) + endif() # PS2's GS wants BGR555; libretro.c has a matching PS2 special case set(LIBRETRO_COLOR_DEFINES "COLOR_16_BIT;COLOR_5_6_5") if(PS2)