libretro-super/libretro-build-common.sh

643 lines
18 KiB
Bash
Raw Normal View History

# vim: set ts=3 sw=3 noet ft=sh : bash
. "$BASE_DIR/script-modules/util.sh"
. "$BASE_DIR/script-modules/fetch-rules.sh"
. "$BASE_DIR/script-modules/cpu.sh"
. "$BASE_DIR/script-modules/modules.sh"
. "$BASE_DIR/rules.d/core-rules.sh"
2015-02-26 22:43:29 +00:00
die() {
echo $1
#exit 1
}
#
# Regarding COMPILER... It didn't used to be safe. Now it is, provided that
# you are using it in a command line passed to echo_cmd without additional
# quoting, like so:
#
# echo_cmd "$MAKE TARGET=\"libretro\" $COMPILER OTHERVAR=\"$SOMETHING\""
#
if [ "${CC}" ] && [ "${CXX}" ]; then
COMPILER="CC=\"${CC}\" CXX=\"${CXX}\""
else
COMPILER=""
fi
echo "Compiler: CC=\"$CC\" CXX=\"$CXX\""
[[ "${ARM_NEON}" ]] && echo '=== ARM NEON opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-neon"
[[ "${CORTEX_A8}" ]] && echo '=== Cortex A8 opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-cortexa8"
[[ "${CORTEX_A9}" ]] && echo '=== Cortex A9 opts enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-cortexa9"
[[ "${ARM_HARDFLOAT}" ]] && echo '=== ARM hardfloat ABI enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-hardfloat"
[[ "${ARM_SOFTFLOAT}" ]] && echo '=== ARM softfloat ABI enabled... ===' && export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-softfloat"
[[ "$X86" ]] && echo '=== x86 CPU detected... ==='
[[ "$X86" ]] && [[ "$X86_64" ]] && echo '=== x86_64 CPU detected... ==='
2014-07-13 23:54:37 +00:00
[[ "${IOS}" ]] && echo '=== iOS =='
echo "$FORMAT_COMPILER_TARGET"
echo "$FORMAT_COMPILER_TARGET_ALT"
RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET
RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
CORE_PREFIX=""
CORE_SUFFIX="_libretro${FORMAT}.$FORMAT_EXT"
if [ "$platform" = "theos_ios" ]; then
CORE_PREFIX="objs/obj/"
fi
build_summary_log() {
2015-02-23 06:28:29 +00:00
# Trailing spaces are intentional here
if [ "$1" -eq "0" ]; then
2015-02-21 04:57:20 +00:00
build_success="$build_success$2 "
else
2015-02-21 04:57:20 +00:00
build_fail="$build_fail$2 "
fi
}
2015-03-10 18:21:54 +00:00
copy_core_to_dist() {
[ -z "$1" ] && return 1
dest="${2:-$1}"
echo_cmd "cp \"$CORE_PREFIX$1$CORE_SUFFIX\" \"$RARCH_DIST_DIR/$dest$CORE_SUFFIX\""
ret=$?
build_summary_log $ret "$dest"
return $ret
}
build_should_skip() {
[ -z "$SKIP_UNCHANGED" ] && return 1
[ -z "$BUILD_REVISIONS_DIR" ] && BUILD_REVISIONS_DIR="$WORKDIR/build-revisions"
build_revision_file="$BUILD_REVISIONS_DIR/$1"
[ ! -r "$build_revision_file" ] && return 1
read previous_revision < "$build_revision_file"
[ "$previous_revision" != "$(fetch_revision $2)" ] && return 1
return 0
}
build_save_revision() {
[ -z "$SKIP_UNCHANGED" ] && return
[ "$1" != "0" ] && return
echo $(fetch_revision) > "$BUILD_REVISIONS_DIR/$2"
}
check_opengl() {
if [ "$BUILD_LIBRETRO_GL" ]; then
if [ "$ENABLE_GLES" ]; then
echo '=== OpenGL ES enabled ==='
export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-gles"
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
else
echo '=== OpenGL enabled ==='
export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-opengl"
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
fi
else
echo '=== OpenGL disabled in build ==='
return 1
fi
return 0
}
2013-07-13 22:10:43 +00:00
reset_compiler_targets() {
export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET
export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT
}
2015-02-06 12:00:22 +00:00
# $1 is corename
# $2 is subcorename
# $3 is subdir. In case there is no subdir, enter "." here
# $4 is Makefile name
# $5 is preferred platform
build_libretro_generic_makefile_subcore() {
build_dir="$WORKDIR/libretro-$1"
if [ -d "$build_dir" ]; then
echo "=== Building $2 ==="
2015-02-23 04:29:29 +00:00
echo_cmd "cd \"$build_dir/$3\""
if [ -z "$NOCLEAN" ]; then
2015-02-23 06:28:29 +00:00
echo_cmd "$MAKE -f \"$4\" platform=$5 -j$JOBS clean" || die "Failed to clean $2"
fi
2015-02-23 06:28:29 +00:00
echo_cmd "$MAKE -f $4 platform=$5 -j$JOBS" || die "Failed to build $2"
2015-03-10 18:21:54 +00:00
copy_core_to_dist "$2"
fi
2015-02-06 12:00:22 +00:00
}
build_libretro_fba_cps2() {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_cps2" "svn-current/trunk/fbacores/cps2" "makefile.libretro" $FORMAT_COMPILER_TARGET
2015-02-06 12:00:22 +00:00
}
build_libretro_fba_neogeo() {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_neo" "svn-current/trunk/fbacores/neogeo" "makefile.libretro" $FORMAT_COMPILER_TARGET
2015-02-06 12:00:22 +00:00
}
build_libretro_fba_cps1() {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_cps1" "svn-current/trunk/fbacores/cps1" "makefile.libretro" $FORMAT_COMPILER_TARGET
2015-02-06 12:00:22 +00:00
}
2015-02-13 03:13:25 +00:00
build_libretro_generic() {
2015-02-23 04:29:29 +00:00
echo_cmd "cd \"$5/$2\""
2015-02-06 12:00:22 +00:00
if [ -z "$NOCLEAN" ]; then
2015-02-23 06:28:29 +00:00
echo_cmd "$MAKE -f \"$3\" platform=\"$4\" \"-j$JOBS\" clean" || die "Failed to clean $1"
fi
echo_cmd "$MAKE -f \"$3\" platform=\"$4\" $COMPILER \"-j$JOBS\"" || die "Failed to build $1"
2015-02-06 12:00:22 +00:00
}
# build_libretro_generic_makefile
#
# $1 Name of the core
# $2 Subdirectory of makefile (use "." for none)
# $3 Name of makefile
# $4 Either FORMAT_COMPILER_TARGET or an alternative
# $5 Skip copying (for cores that don't produce exactly one core)
2015-02-13 03:13:25 +00:00
build_libretro_generic_makefile() {
build_dir="$WORKDIR/libretro-$1"
if build_should_skip $1 "$build_dir"; then
echo "Core $1 is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo "=== Building $1 ==="
build_libretro_generic $1 "$2" "$3" $4 "$build_dir"
if [ -z "$5" ]; then
copy_core_to_dist $1
build_save_revision $? $1
fi
else
echo "$1 not fetched, skipping ..."
fi
2015-02-13 03:13:25 +00:00
}
2015-02-26 22:43:29 +00:00
# build_makefile
#
# $core_build_subdir Subdir of the makefile (if any)
# $core_build_makefile Name of the makefile (if not {GNUm,m,M}akefile)
# $core_build_platform Usually some variant of $FORMAT_COMPILER_TARGET
2015-02-26 22:43:29 +00:00
build_makefile() {
[ -n "$core_build_subdir" ] && core_build_subdir="/$core_build_subdir"
make_cmdline="$MAKE"
if [ -n "$core_build_makefile" ]; then
make_cmdline="$make_cmdline -f $core_build_makefile"
fi
# TODO: Do this better
make_cmdline="$make_cmdline platform=\"$core_build_platform\""
2015-02-26 22:43:29 +00:00
[ -n "$JOBS" ] && make_cmdline="$make_cmdline -j$JOBS"
build_dir="$WORKDIR/$core_dir$core_build_subdir"
if build_should_skip $1 "$build_dir"; then
echo "Core $1 is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo_cmd "cd \"$build_dir\""
if [ -z "$NOCLEAN" ]; then
echo_cmd "$make_cmdline clean"
fi
make_cmdline="$make_cmdline $COMPILER"
echo_cmd "$make_cmdline"
# TODO: Make this a separate stage rule
copy_core_to_dist $1
else
echo "$1 not fetched, skipping ..."
fi
}
# libretro_build_core: Build the given core using its build rules
#
# $1 Name of the core to build
libretro_build_core() {
local opengl_type
2015-02-26 22:43:29 +00:00
eval "core_name=\$libretro_${1}_name"
[ -z "$core_name" ] && core_name="$1"
echo "$(color 34)=== $(color 1)$core_name$(color)"
2015-02-26 22:43:29 +00:00
eval "core_build_rule=\$libretro_${1}_build_rule"
[ -z "$core_build_rule" ] && core_build_rule=generic_makefile
2015-02-26 22:43:29 +00:00
eval "core_dir=\$libretro_${1}_dir"
[ -z "$core_dir" ] && core_dir="libretro-$1"
eval "core_build_opengl=\$libretro_${1}_build_opengl"
if [ -n "$core_build_opengl" ]; then
if [[ "$core_build_opengl" = "yes" || "$core_build_opengl" = "optional" ]]; then
if [ -n "$BUILD_LIBRETRO_GL" ]; then
if [ -n "$ENABLE_GLES" ]; then
opengl_type="-gles"
else
opengl_type="-opengl"
fi
else
if [ "$core_build_opengl" = "yes" ]; then
echo "$1 requires OpenGL (which is disabled), skipping..."
return 0
fi
fi
else
echo "libretro_build_core:Unknown OpenGL setting for $1: \"$core_build_opengl\"."
return 1
fi
fi
2015-02-26 22:43:29 +00:00
case "$core_build_rule" in
generic_makefile)
2015-02-26 22:43:29 +00:00
eval "core_build_makefile=\$libretro_${1}_build_makefile"
eval "core_build_subdir=\$libretro_${1}_build_subdir"
# TODO: Really, clean this up...
2015-02-26 22:43:29 +00:00
eval "core_build_platform=\$libretro_${1}_build_platform"
core_build_platform="${core_build_platform:-$FORMAT_COMPILER_TARGET}$opengl_type"
2015-02-26 22:43:29 +00:00
echo "Building ${1}..."
2015-03-06 04:50:49 +00:00
build_makefile $1
;;
2015-02-26 22:43:29 +00:00
legacy)
eval "core_build_legacy=\$libretro_${1}_build_legacy"
if [ -n "$core_build_legacy" ]; then
echo "Warning: $1 hasn't been ported to a modern build rule yet."
echo " Will build it using legacy \"$core_build_legacy\"..."
$core_build_legacy
fi
;;
none)
echo "Don't have a build rule for $1, skipping..."
2015-02-26 22:43:29 +00:00
;;
*)
echo "libretro_build_core:Unknown build rule for $1: \"$core_build_rule\"."
exit 1
;;
esac
}
build_libretro_test() {
2015-03-10 18:21:54 +00:00
build_dir="$WORKDIR/retroarch"
if build_should_skip "test" "$build_dir"; then
echo "Core test is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo "=== Building RetroArch test cores ==="
if check_opengl; then
build_libretro_generic "retroarch" "libretro-test-gl" "Makefile" $FORMAT_COMPILER_TARGET "$build_dir"
copy_core_to_dist "testgl"
fi
build_libretro_generic "retroarch" "libretro-test" "Makefile" $FORMAT_COMPILER_TARGET "$build_dir"
copy_core_to_dist "test"
# TODO: Check for more than test here...
build_save_revision $? "test"
else
echo "$1 not fetched, skipping ..."
fi
2015-02-13 03:13:25 +00:00
}
2015-02-06 12:00:22 +00:00
2015-02-19 22:04:00 +00:00
build_libretro_mame_modern() {
build_dir="$WORKDIR/libretro-mame"
if [ -d "$build_dir" ]; then
echo ''
2015-02-19 22:04:00 +00:00
echo "=== Building $1 ==="
2015-02-23 04:29:29 +00:00
echo_cmd "cd \"$build_dir\""
2015-02-21 07:31:40 +00:00
if [ -n "$IOS" ]; then
if [ -z "$NOCLEAN" ]; then
2015-02-23 06:28:29 +00:00
echo_cmd "$MAKE -f Makefile.libretro \"TARGET=$2\" \"PARTIAL=$3\" platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\" clean" || die 'Failed to clean MAME'
fi
echo_cmd "$MAKE -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" $COMPILER \"NATIVE=1\" buildtools \"-j$JOBS\""
ret=$?
if [ "$ret" = 0 ]; then
echo_cmd "$MAKE -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" emulator \"-j$JOBS\""
ret=$?
fi
else
[ "$X86_64" = "true" ] && PTR64=1
if [ -z "$NOCLEAN" ]; then
echo_cmd "$MAKE -f Makefile.libretro PTR64=\"$PTR64\" \"TARGET=$2\" \"PARTIAL=$3\" platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\" clean" || die 'Failed to clean MAME'
fi
echo_cmd "$MAKE -f Makefile.libretro PTR64=\"$PTR64\" \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" $COMPILER \"-j$JOBS\""
ret=$?
fi
[ "$ret" -gt 0 ] && die 'Failed to build MAME'
2015-02-19 22:04:00 +00:00
2015-03-10 18:21:54 +00:00
copy_core_to_dist "$2"
return $?
else
echo 'MAME not fetched, skipping ...'
fi
}
2015-02-19 22:04:00 +00:00
# radius uses these, let's not pull them out from under him just yet
build_libretro_mame() {
build_libretro_mame_modern "MAME" "mame" ""
}
2015-02-19 22:04:00 +00:00
build_libretro_mess() {
build_libretro_mame_modern "MESS" "mess" ""
}
rebuild_libretro_mess() {
build_libretro_mame_modern "MESS" "mess" "1"
}
2014-03-18 20:07:30 +00:00
build_libretro_ume() {
2015-02-19 22:04:00 +00:00
build_libretro_mame_modern "UME" "ume" ""
}
rebuild_libretro_ume() {
2015-02-19 22:04:00 +00:00
build_libretro_mame_modern "UME" "ume" "1"
2014-03-17 04:17:04 +00:00
}
build_summary() {
if [ -z "$NOBUILD_SUMMARY" ]; then
2015-02-21 04:57:20 +00:00
if command -v fmt > /dev/null; then
use_fmt=1
fi
printf -v summary "=== Core Build Summary ===\n\n"
if [ -n "$build_success" ]; then
printf -v summary "%s%s%d%s\n" "$summary" "$(color 32)" "$(echo $build_success | wc -w)" " core(s)$(color) successfully built:"
2015-02-21 04:57:20 +00:00
if [ -n "$use_fmt" ]; then
printf -v summary "%s%s\n\n" "$summary" "$(echo " $build_success" | fmt)"
else
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_success)"
fi
fi
if [ -n "$build_fail" ]; then
printf -v summary "%s%s%d%s\n" "$summary" "$(color 31)" "$(echo $build_fail | wc -w)" " core(s)$(color) failed to build:"
2015-02-21 04:57:20 +00:00
if [ -n "$use_fmt" ]; then
printf -v summary "%s%s\n\n" "$summary" "$(echo " $build_fail" | fmt)"
else
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_fail)"
fi
fi
2015-02-20 23:46:37 +00:00
if [[ -z "$build_success" && -z "$build_fail" ]]; then
printf -v summary "%s%s\n\n" "$summary" "No build actions performed."
fi
if [ -n "$BUILD_SUMMARY" ]; then
echo "$summary" > "$BUILD_SUMMARY"
fi
echo "$summary"
fi
}
create_dist_dir() {
mkdir -p "$RARCH_DIST_DIR"
}
create_dist_dir
########## LEGACY RULES
# TODO: Port these to modern rules
build_libretro_bnes() {
build_dir="$WORKDIR/libretro-bnes"
if build_should_skip bnes "$build_dir"; then
echo "Core bnes is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo '=== Building bNES ==='
echo_cmd "cd \"$build_dir\""
mkdir -p obj
if [ -z "$NOCLEAN" ]; then
echo_cmd "$MAKE -f Makefile \"-j$JOBS\" clean" || die 'Failed to clean bNES'
fi
echo_cmd "$MAKE -f Makefile $COMPILER \"-j$JOBS\" compiler=\"${CXX11}\"" || die 'Failed to build bNES'
copy_core_to_dist "bnes"
build_save_revision $? "bnes"
else
echo 'bNES not fetched, skipping ...'
fi
}
build_libretro_bsnes_modern() {
build_dir="$WORKDIR/libretro-$1"
if [ -d "$build_dir" ]; then
echo "=== Building $1 ==="
echo_cmd "cd \"$build_dir\""
if [ -z "$NOCLEAN" ]; then
echo_cmd "rm -f obj/*.{o,\"$FORMAT_EXT\"}"
echo_cmd "rm -f out/*.{o,\"$FORMAT_EXT\"}"
fi
cmdline="$MAKE target=libretro -j$JOBS"
cmdline="$cmdline platform=\"$FORMAT_COMPILER_TARGET\""
cmdline="$cmdline compiler=\"$CXX11\""
ret=0
for a in accuracy balanced performance; do
echo_cmd "$cmdline profile=$a"
copy_core_to_dist "out/${1}_$a" "${1}_$a"
[ $ret -eq 0 ] || break
done
return $ret
else
echo "$1 not fetched, skipping ..."
fi
}
build_libretro_bsnes() {
if build_should_skip bsnes "$WORKDIR/libretro-bsnes"; then
echo "Core bsnes is already built, skipping..."
return
fi
build_libretro_bsnes_modern "bsnes"
build_save_revision $? bsnes
}
build_libretro_bsnes_cplusplus98() {
CORENAME="bsnes_cplusplus98"
build_dir="$WORKDIR/libretro-$CORENAME"
if build_should_skip $CORENAME "$build_dir"; then
echo "Core $CORENAME is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo "=== Building $CORENAME ==="
echo_cmd "cd \"$build_dir\""
if [ -z "$NOCLEAN" ]; then
# byuu's "make clean" doesn't
echo_cmd "rm -f obj/*.{o,\"$FORMAT_EXT\"}"
echo_cmd "rm -f out/*.{o,\"$FORMAT_EXT\"}"
fi
echo_cmd "$MAKE platform=\"$FORMAT_COMPILER_TARGET\" $COMPILER \"-j$JOBS\""
copy_core_to_dist "out/$CORENAME" "$CORENAME"
build_save_revision $? $CORENAME
else
echo "$CORENAME not fetched, skipping ..."
fi
}
build_libretro_bsnes_mercury() {
if build_should_skip bsnes_mercury "$WORKDIR/libretro-bsnes"; then
echo "Core bsnes_mercury is already built, skipping..."
return
fi
build_libretro_bsnes_modern "bsnes_mercury"
build_save_revision $? bsnes_mercury
}
build_libretro_emux() {
if build_should_skip emux "$WORKDIR/libretro-emux"; then
echo "Cores for emux are already built, skipping..."
return
fi
build_libretro_generic_makefile "emux" "libretro" "Makefile" $FORMAT_COMPILER_TARGET 1
copy_core_to_dist "emux_chip8"
copy_core_to_dist "emux_gb"
copy_core_to_dist "emux_nes"
copy_core_to_dist "emux_sms"
# TODO: Check for more than emux_sms here...
build_save_revision $? "emux"
}
build_libretro_mupen64() {
if check_opengl; then
build_dir="$WORKDIR/libretro-mupen64plus"
if build_should_skip mupen64plus "$build_dir"; then
echo "Core mupen64plus is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo_cmd "cd \"$build_dir\""
mkdir -p obj
if iscpu_x86_64 $ARCH; then
dynarec="WITH_DYNAREC=x86_64"
elif iscpu_x86 $ARCH; then
dynarec="WITH_DYNAREC=x86"
elif [ "${CORTEX_A8}" ] || [ "${CORTEX_A9}" ] || [ "$platform" = "ios" ]; then
dynarec="WITH_DYNAREC=arm"
fi
echo '=== Building Mupen 64 Plus ==='
if [ -z "$NOCLEAN" ]; then
echo_cmd "$MAKE $dynarec platform=\"$FORMAT_COMPILER_TARGET_ALT\" \"-j$JOBS\" clean" || die 'Failed to clean Mupen 64'
fi
echo_cmd "$MAKE $dynarec platform=\"$FORMAT_COMPILER_TARGET_ALT\" $COMPILER \"-j$JOBS\"" || die 'Failed to build Mupen 64'
copy_core_to_dist "mupen64plus"
build_save_revision $? "mupen64plus"
else
echo 'Mupen64 Plus not fetched, skipping ...'
fi
reset_compiler_targets
fi
}
build_libretro_mame_prerule() {
build_dir="$WORKDIR/libretro-mame"
if build_should_skip mame "$build_dir"; then
echo "Core mame is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo ''
echo "=== Building MAME ==="
echo_cmd "cd \"$build_dir\""
local extra_args
[ "$X86_64" = "true" ] && extra_args="PTR64=1"
if [ -z "$NOCLEAN" ]; then
echo_cmd "$MAKE -f Makefile.libretro $extra_args platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\" clean" || die 'Failed to clean MAME'
fi
if [ -n "$IOS" ]; then
# FIXME: iOS doesn't build right now, so let's leave this simple until it does.
target=mame
echo_cmd "$MAKE -f Makefile.libretro \"TARGET=$target\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"NATIVE=1\" buildtools \"-j$JOBS\""
ret=$?
if [ "$ret" = 0 ]; then
echo_cmd "$MAKE -f Makefile.libretro \"TARGET=$target\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" emulator \"-j$JOBS\""
ret=$?
fi
[ "$ret" -gt 0 ] && die 'Failed to build MAME'
build_summary_log $ret "$target"
else
for target in mame mess ume; do
echo_cmd "$MAKE -f Makefile.libretro $extra_args \"TARGET=$target\" platform=\"$FORMAT_COMPILER_TARGET\" $COMPILER \"-j$JOBS\" emulator" || die "Failed to build $target"
copy_core_to_dist "$target"
ret=$?
# If a target fails, stop here...
[ $ret -eq 0 ] || break
done
fi
else
echo 'MAME not fetched, skipping ...'
fi
build_save_revision $ret mame
}
build_libretro_pcsx_rearmed() {
build_dir="$WORKDIR/libretro-pcsx_rearmed"
if build_should_skip "pcsx_rearmed" "$build_dir"; then
echo "Core pcsx_rearmed is already built, skipping..."
return
fi
if [ -d "$build_dir" ]; then
echo '=== Building PCSX ReARMed ==='
echo_cmd "cd \"$build_dir\""
if [ -z "$NOCLEAN" ]; then
echo_cmd "$MAKE -f Makefile.libretro platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\" clean" || die 'Failed to clean PCSX ReARMed'
fi
echo_cmd "$MAKE -f Makefile.libretro platform=\"$FORMAT_COMPILER_TARGET\" $COMPILER \"-j$JOBS\"" || die 'Failed to build PCSX ReARMed'
copy_core_to_dist "pcsx_rearmed"
ret=$?
if [ "$platform" = "ios" ]; then
copy_core_to_dist "pcsx_rearmed_interpreter"
ret=$?
fi
build_save_revision $ret "pcsx_rearmed"
else
echo 'PCSX ReARMed not fetched, skipping ...'
fi
}