2015-02-17 03:19:30 +00:00
|
|
|
# vim: set ts=3 sw=3 noet ft=sh : bash
|
2013-04-30 02:45:55 +00:00
|
|
|
|
2015-02-19 06:31:02 +00:00
|
|
|
. ${BASE_DIR}/script-modules/fetch-rules.sh
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
die() {
|
2015-02-17 03:19:30 +00:00
|
|
|
echo $1
|
|
|
|
#exit 1
|
2013-04-30 02:45:55 +00:00
|
|
|
}
|
|
|
|
|
2015-02-10 21:13:41 +00:00
|
|
|
#
|
|
|
|
# FIXME: Okay regarding COMPILER... It's no longer used to build any targets
|
|
|
|
# in this file because it doesn't let you specify arguments to the compiler
|
|
|
|
# such as CC="gcc -something". We need to be able to do that on the Mac in
|
|
|
|
# particular because we need to be able to specify -arch to build on a CPU
|
|
|
|
# other than the default.
|
|
|
|
#
|
|
|
|
# Basically, if you use this variable, you should stop. :)
|
|
|
|
#
|
2013-10-09 00:52:48 +00:00
|
|
|
if [ "${CC}" ] && [ "${CXX}" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
COMPILER="CC=\"${CC}\" CXX=\"${CXX}\""
|
2013-05-19 10:03:25 +00:00
|
|
|
else
|
2015-02-17 03:19:30 +00:00
|
|
|
COMPILER=""
|
2013-05-19 10:03:25 +00:00
|
|
|
fi
|
|
|
|
|
2015-02-14 02:41:38 +00:00
|
|
|
echo "Compiler: CC=\"$CC\" CXX=\"$CXX\""
|
2013-05-19 10:03:25 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
[[ "${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 =='
|
2013-08-12 02:47:00 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$FORMAT_COMPILER_TARGET"
|
|
|
|
echo "$FORMAT_COMPILER_TARGET_ALT"
|
2014-10-05 11:09:13 +00:00
|
|
|
RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET
|
|
|
|
RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
|
2013-07-13 15:32:29 +00:00
|
|
|
|
2015-01-31 03:01:14 +00:00
|
|
|
build_summary_log() {
|
2015-02-17 20:03:38 +00:00
|
|
|
if [ "$1" -eq "0" ]; then
|
|
|
|
printf -v build_success "%s%s\n" "$build_success" "$2"
|
|
|
|
else
|
|
|
|
printf -v build_fail "%s%s\n" "$build_fail" "$2"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-01-31 03:01:14 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 06:31:02 +00:00
|
|
|
build_should_skip() {
|
|
|
|
[ -z "$SKIP_UNCHANGED" ] && return 1
|
2015-02-19 06:45:23 +00:00
|
|
|
|
|
|
|
[ -z "$BUILD_REVISIONS_DIR" ] && BUILD_REVISIONS_DIR="$WORKDIR/build-revisions"
|
|
|
|
build_revision_file="$BUILD_REVISIONS_DIR/$1"
|
|
|
|
|
2015-02-19 06:31:02 +00:00
|
|
|
[ ! -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
|
2015-02-20 22:43:28 +00:00
|
|
|
echo $(fetch_revision) > "$BUILD_REVISIONS_DIR/$2"
|
2015-02-19 06:31:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-10-05 10:28:08 +00:00
|
|
|
check_opengl() {
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ "${BUILD_LIBRETRO_GL}" ]; then
|
|
|
|
if [ "${ENABLE_GLES}" ]; then
|
|
|
|
echo '=== OpenGL ES enabled ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-gles"
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo '=== OpenGL enabled ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
export FORMAT_COMPILER_TARGET="$FORMAT_COMPILER_TARGET-opengl"
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT="$FORMAT_COMPILER_TARGET"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo '=== OpenGL disabled in build ==='
|
|
|
|
fi
|
2014-10-05 10:28:08 +00:00
|
|
|
}
|
2013-07-13 22:10:43 +00:00
|
|
|
|
2014-10-05 11:09:13 +00:00
|
|
|
reset_compiler_targets() {
|
2015-02-17 03:19:30 +00:00
|
|
|
export FORMAT_COMPILER_TARGET=$RESET_FORMAT_COMPILER_TARGET
|
|
|
|
export FORMAT_COMPILER_TARGET_ALT=$RESET_FORMAT_COMPILER_TARGET_ALT
|
2014-10-05 11:09:13 +00:00
|
|
|
}
|
|
|
|
|
2013-12-19 23:31:05 +00:00
|
|
|
build_libretro_pcsx_rearmed_interpreter() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-pcsx_rearmed"
|
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
echo '=== Building PCSX ReARMed Interpreter ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cd \"$build_dir\""
|
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE -f Makefile.libretro platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE -f Makefile.libretro platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" clean || die 'Failed to clean PCSX ReARMed'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE -f Makefile.libretro USE_DYNAREC=0 platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE -f Makefile.libretro USE_DYNAREC=0 platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build PCSX ReARMed'
|
|
|
|
echo "cp \"pcsx_rearmed_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/pcsx_rearmed_interpreter${FORMAT}.$FORMAT_EXT\""
|
|
|
|
cp "pcsx_rearmed_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/pcsx_rearmed_interpreter${FORMAT}.$FORMAT_EXT"
|
|
|
|
build_summary_log $? "pcsx_rearmed_interpreter"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo 'PCSX ReARMed not fetched, skipping ...'
|
|
|
|
fi
|
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() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-$1"
|
|
|
|
if [ -d "$build_dir" ]; then
|
|
|
|
echo "=== Building $2 ==="
|
|
|
|
echo "cd \"$build_dir/$3\""
|
|
|
|
cd "$build_dir/$3"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE -f \"$4\" platform=$5 -j$JOBS clean"
|
|
|
|
$MAKE -f "$4" platform=$5 -j$JOBS clean || die "Failed to clean $2"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE -f $4 platform=$5 -j$JOBS"
|
|
|
|
$MAKE -f $4 platform=$5 -j$JOBS || die "Failed to build $2"
|
|
|
|
echo "cp ${2}_libretro${FORMAT}.$FORMAT_EXT $RARCH_DIST_DIR/${2}_libretro${FORMAT}.$FORMAT_EXT"
|
|
|
|
cp ${2}_libretro${FORMAT}.$FORMAT_EXT $RARCH_DIST_DIR/${2}_libretro${FORMAT}.$FORMAT_EXT
|
|
|
|
build_summary_log $? "$2"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_fba_cps2() {
|
2015-02-18 06:32:27 +00:00
|
|
|
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() {
|
2015-02-18 06:32:27 +00:00
|
|
|
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() {
|
2015-02-18 06:32:27 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
copy_core_to_dist() {
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ "$FORMAT_COMPILER_TARGET" = "theos_ios" ]; then
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cp \"objs/obj/${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\""
|
|
|
|
cp "objs/obj/${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cp \"${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\""
|
|
|
|
cp "${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret "$1"
|
|
|
|
return $ret
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
2015-02-13 03:13:25 +00:00
|
|
|
build_libretro_generic() {
|
2015-02-18 06:32:27 +00:00
|
|
|
cd "$5/$2"
|
2015-02-06 12:00:22 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE -f \"$3\" platform=\"$4\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE -f "$3" platform="$4" CC="$CC" CXX="$CXX" "-j$JOBS" clean || die "Failed to clean $1"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE -f \"$3\" platform=\"$4\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE -f "$3" platform="$4" CC="$CC" CXX="$CXX" "-j$JOBS" || die "Failed to build $1"
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
2015-02-18 17:57:48 +00:00
|
|
|
# build_libretro_generic_makefile
|
|
|
|
#
|
2015-02-19 06:31:02 +00:00
|
|
|
# $1 Name of the core
|
2015-02-18 17:57:48 +00:00
|
|
|
# $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() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-$1"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
if build_should_skip $1 "$build_dir"; then
|
|
|
|
echo "Core $1 is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "=== Building $1 ==="
|
|
|
|
build_libretro_generic $1 "$2" "$3" $4 "$build_dir"
|
2015-02-18 17:57:48 +00:00
|
|
|
if [ -z "$5" ]; then
|
|
|
|
copy_core_to_dist $1
|
2015-02-19 06:31:02 +00:00
|
|
|
build_save_revision $? $1
|
2015-02-18 17:57:48 +00:00
|
|
|
fi
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$1 not fetched, skipping ..."
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-13 03:13:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_retroarch_generic_makefile() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/$1"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
if build_should_skip $1 "$build_dir"; then
|
|
|
|
echo "Core $1 is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-17 03:19:30 +00:00
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "=== Building $2 ==="
|
|
|
|
build_libretro_generic $1 "$2" "$3" $4 "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
copy_core_to_dist $5
|
2015-02-19 06:31:02 +00:00
|
|
|
build_save_revision $? $1
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$1 not fetched, skipping ..."
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-13 03:13:25 +00:00
|
|
|
}
|
|
|
|
|
2015-02-06 12:00:22 +00:00
|
|
|
build_libretro_stonesoup() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "stonesoup" "crawl-ref" "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_hatari() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "hatari" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_prosystem() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "prosystem" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_4do() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "4do" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_o2em() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "o2em" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_virtualjaguar() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "virtualjaguar" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_tgbdual() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "tgbdual" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_nx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "nxengine" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_catsfc() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "catsfc" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_emux() {
|
2015-02-19 06:31:02 +00:00
|
|
|
if build_should_skip emux "$WORKDIR/libretro-emux"; then
|
|
|
|
echo "Cores for emux are already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "emux" "libretro" "Makefile" $FORMAT_COMPILER_TARGET 1
|
2015-02-19 06:31:02 +00:00
|
|
|
|
2015-02-17 03:19:30 +00:00
|
|
|
copy_core_to_dist "emux_chip8"
|
|
|
|
copy_core_to_dist "emux_gb"
|
|
|
|
copy_core_to_dist "emux_nes"
|
|
|
|
copy_core_to_dist "emux_sms"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
# TODO: Check for more than emux_sms here...
|
|
|
|
build_save_revision $? "emux"
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
2015-02-13 03:13:25 +00:00
|
|
|
build_libretro_test() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_retroarch_generic_makefile "retroarch" "libretro-test" "Makefile" $FORMAT_COMPILER_TARGET "test"
|
2015-02-13 03:13:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_testgl() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_retroarch_generic_makefile "retroarch" "libretro-test-gl" "Makefile" $FORMAT_COMPILER_TARGET "testgl"
|
2015-02-13 03:13:25 +00:00
|
|
|
}
|
|
|
|
|
2015-02-06 12:00:22 +00:00
|
|
|
build_libretro_picodrive() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "picodrive" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_tyrquake() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "tyrquake" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_2048() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "2048" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_vecx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "vecx" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2015-02-06 12:00:22 +00:00
|
|
|
}
|
2014-08-22 10:05:35 +00:00
|
|
|
|
2014-08-22 10:21:57 +00:00
|
|
|
build_libretro_stella() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "stella" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:05:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_bluemsx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "bluemsx" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:05:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_handy() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "handy" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:05:35 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 10:21:57 +00:00
|
|
|
build_libretro_fmsx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "fmsx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:05:35 +00:00
|
|
|
}
|
|
|
|
|
2014-12-10 18:29:58 +00:00
|
|
|
build_libretro_gpsp() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "gpsp" "." "Makefile" $FORMAT_COMPILER_TARGET_ALT
|
2014-12-10 18:29:58 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 06:03:18 +00:00
|
|
|
build_libretro_fuse() {
|
|
|
|
build_libretro_generic_makefile "fuse" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET_ALT
|
|
|
|
}
|
|
|
|
|
2014-08-22 10:05:35 +00:00
|
|
|
build_libretro_vba_next() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "vba_next" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_vbam() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "vbam" "src/libretro" "Makefile" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 10:21:57 +00:00
|
|
|
}
|
2014-08-22 10:05:35 +00:00
|
|
|
|
2014-08-22 10:21:57 +00:00
|
|
|
build_libretro_snes9x_next() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "snes9x_next" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 10:05:35 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 10:24:08 +00:00
|
|
|
build_libretro_dinothawr() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "dinothawr" "." "Makefile" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 10:24:08 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 10:28:27 +00:00
|
|
|
build_libretro_genesis_plus_gx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "genesis_plus_gx" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2013-04-30 02:45:55 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
build_libretro_mame078() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mame078" "." "makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:33:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_prboom() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "prboom" "." "Makefile" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 10:33:53 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_pcsx_rearmed() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "pcsx_rearmed" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2013-05-18 17:04:19 +00:00
|
|
|
}
|
2013-04-30 02:45:55 +00:00
|
|
|
|
2014-08-22 10:38:24 +00:00
|
|
|
build_libretro_fceumm() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "fceumm" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:38:24 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 10:46:41 +00:00
|
|
|
build_libretro_beetle_snes() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_snes" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_lynx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_lynx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_wswan() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_wswan" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_gba() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_gba" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_ngp() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_ngp" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_pce_fast() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_pce_fast" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_vb() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_vb" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_pcfx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_pcfx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_psx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "beetle_psx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-12-03 10:40:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_mednafen_psx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_psx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 10:46:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_beetle_supergrafx() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "mednafen_supergrafx" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_meteor() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "meteor" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_nestopia() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "nestopia" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_gambatte() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "gambatte" "libgambatte" "Makefile.libretro" $FORMAT_COMPILER_TARGET_ALT
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_yabause() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "yabause" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_desmume() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "desmume" "desmume" "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_snes9x() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "snes9x" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_quicknes() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "quicknes" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_dosbox() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "dosbox" "." "Makefile.libretro" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 13:39:20 +00:00
|
|
|
build_libretro_fb_alpha() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "fb_alpha" "svn-current/trunk" "makefile.libretro" $FORMAT_COMPILER_TARGET
|
2014-08-22 13:39:20 +00:00
|
|
|
}
|
|
|
|
|
2014-08-22 11:28:33 +00:00
|
|
|
build_libretro_ffmpeg() {
|
2015-02-17 03:19:30 +00:00
|
|
|
check_opengl
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "ffmpeg" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-17 03:19:30 +00:00
|
|
|
reset_compiler_targets
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_3dengine() {
|
2015-02-17 03:19:30 +00:00
|
|
|
check_opengl
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "3dengine" "." "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-17 03:19:30 +00:00
|
|
|
reset_compiler_targets
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_scummvm() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "scummvm" "backends/platform/libretro/build" "Makefile" $FORMAT_COMPILER_TARGET
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
build_libretro_ppsspp() {
|
2015-02-17 03:19:30 +00:00
|
|
|
check_opengl
|
2015-02-18 06:32:27 +00:00
|
|
|
build_libretro_generic_makefile "ppsspp" "libretro" "Makefile" $FORMAT_COMPILER_TARGET
|
2015-02-17 03:19:30 +00:00
|
|
|
reset_compiler_targets
|
2014-08-22 11:28:33 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
build_libretro_mame_modern() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-mame"
|
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
echo ''
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "=== Building $1 ==="
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cd \"$build_dir\""
|
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
|
|
|
if [ "$IOS" ]; then
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "=== Building $1 (iOS) ==="
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE -f Makefile.libretro \"TARGET=$2\" \"PARTIAL=$3\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE -f Makefile.libretro "TARGET=$2" "PARTIAL=$3" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" clean || die 'Failed to clean MAME'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"NATIVE=1\" buildtools \"-j$JOBS\""
|
|
|
|
$MAKE -f Makefile.libretro "TARGET=$2" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "NATIVE=1" buildtools "-j$JOBS" || die 'Failed to build MAME buildtools'
|
|
|
|
echo "$MAKE -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" emulator \"-j$JOBS\""
|
|
|
|
$MAKE -f Makefile.libretro "TARGET=$2" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" emulator "-j$JOBS" || die 'Failed to build MAME (iOS)'
|
2015-02-17 03:19:30 +00:00
|
|
|
elif [ "$X86_64" = "true" ]; then
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "=== Building ${1}64 ==="
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE PTR64=1 -f Makefile.libretro \"TARGET=$2\" \"PARTIAL=$3\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE PTR64=1 -f Makefile.libretro "TARGET=$2" "PARTIAL=$3" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" clean || die 'Failed to clean MAME'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE PTR64=1 -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE PTR64=1 -f Makefile.libretro "TARGET=$2" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build MAME'
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "=== Building ${1}32 ==="
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE -f Makefile.libretro \"TARGET=$2\" \"PARTIAL=$3\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE -f Makefile.libretro "TARGET=$2" "PARTIAL=$3" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" clean || die 'Failed to clean MAME'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-19 22:04:00 +00:00
|
|
|
echo "$MAKE -f Makefile.libretro \"TARGET=$2\" platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE -f Makefile.libretro "TARGET=$2" platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build MAME'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-19 22:04:00 +00:00
|
|
|
|
|
|
|
echo "cp \"${2}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\""
|
|
|
|
cp "${2}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR"
|
2015-02-19 06:31:02 +00:00
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret "mame"
|
2015-02-19 22:04:00 +00:00
|
|
|
return $ret
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo 'MAME not fetched, skipping ...'
|
|
|
|
fi
|
2013-09-23 02:03:55 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
|
|
|
|
build_libretro_mame() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-mame"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
if build_should_skip mame "$build_dir"; then
|
|
|
|
echo "Core mame is already built, skipping..."
|
|
|
|
return
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2014-03-17 04:17:04 +00:00
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
build_libretro_mame_modern "MAME" "mame" ""
|
|
|
|
build_libretro_mame_modern "MESS" "mess" "1"
|
|
|
|
build_libretro_mame_modern "UME" "ume" "1"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
# TODO: Like others, this saves the revision if ume builds...
|
|
|
|
build_save_revision $? mame
|
2014-03-17 04:40:30 +00:00
|
|
|
}
|
|
|
|
|
2015-02-19 22:04:00 +00:00
|
|
|
# radius uses these, let's not pull them out from under him just yet
|
|
|
|
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" ""
|
2014-03-21 22:44:24 +00:00
|
|
|
}
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2014-08-22 14:47:03 +00:00
|
|
|
# $1 is corename
|
|
|
|
# $2 is profile shortname.
|
|
|
|
# $3 is profile name
|
2014-08-22 14:48:52 +00:00
|
|
|
build_libretro_bsnes_modern() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-$1"
|
|
|
|
if [ -d "$build_dir" ]; then
|
|
|
|
echo "=== Building $1 $3 ==="
|
|
|
|
echo "cd \"$build_dir\""
|
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
rm -f obj/*.{o,"$FORMAT_EXT"}
|
|
|
|
rm -f out/*.{o,"$FORMAT_EXT"}
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE -f Makefile platform=\"$FORMAT_COMPILER_TARGET\" compiler=\"$CXX11\" ui='target-libretro' profile=\"${3}\" \"-j$JOBS\""
|
|
|
|
$MAKE -f Makefile platform="$FORMAT_COMPILER_TARGET" compiler="$CXX11" ui='target-libretro' profile="${3}" "-j$JOBS" || die "Failed to build $1 $3 core"
|
|
|
|
echo "cp -f \"out/${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/${1}_${3}_libretro${FORMAT}.$FORMAT_EXT\""
|
|
|
|
cp -f "out/${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/${1}_${3}_libretro${FORMAT}.$FORMAT_EXT"
|
2015-02-19 06:31:02 +00:00
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret "${1}_$3"
|
|
|
|
|
|
|
|
return $ret
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$1 $3 not fetched, skipping ..."
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2014-07-30 15:22:18 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
build_libretro_bsnes() {
|
2015-02-19 06:31:02 +00:00
|
|
|
if build_should_skip bsnes "$WORKDIR/libretro-bsnes"; then
|
|
|
|
echo "Core bsnes is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-17 03:19:30 +00:00
|
|
|
build_libretro_bsnes_modern "bsnes" "perf" "performance"
|
|
|
|
build_libretro_bsnes_modern "bsnes" "balanced" "balanced"
|
|
|
|
build_libretro_bsnes_modern "bsnes" "." "accuracy"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
# TODO: Make this not depend on accuracy
|
|
|
|
build_save_revision $? bsnes
|
2014-08-22 14:47:03 +00:00
|
|
|
}
|
2013-05-18 17:04:19 +00:00
|
|
|
|
2014-08-22 14:47:03 +00:00
|
|
|
build_libretro_bsnes_mercury() {
|
2015-02-19 06:31:02 +00:00
|
|
|
if build_should_skip bsnes_mercury "$WORKDIR/libretro-bsnes"; then
|
|
|
|
echo "Core bsnes_mercury is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
set +x
|
2015-02-17 03:19:30 +00:00
|
|
|
build_libretro_bsnes_modern "bsnes_mercury" "perf" "performance"
|
|
|
|
build_libretro_bsnes_modern "bsnes_mercury" "balanced" "balanced"
|
|
|
|
build_libretro_bsnes_modern "bsnes_mercury" "." "accuracy"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
# TODO: Make this not depend on accuracy
|
|
|
|
build_save_revision $? bsnes_mercury
|
2014-08-22 14:47:03 +00:00
|
|
|
}
|
2013-05-18 17:04:19 +00:00
|
|
|
|
2014-08-22 14:47:03 +00:00
|
|
|
build_libretro_bsnes_cplusplus98() {
|
2015-02-17 03:19:30 +00:00
|
|
|
CORENAME="bsnes_cplusplus98"
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-$CORENAME"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
if build_should_skip $CORENAME "$build_dir"; then
|
|
|
|
echo "Core $CORENAME is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -d "$build_dir" ]; then
|
|
|
|
echo "=== Building $CORENAME ==="
|
|
|
|
echo "cd \"$build_dir\""
|
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE clean"
|
|
|
|
$MAKE clean || die "Failed to clean $CORENAME"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE platform=\"$FORMAT_COMPILER_TARGET\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE platform="$FORMAT_COMPILER_TARGET" CC="$CC" CXX="$CXX" "-j$JOBS"
|
|
|
|
echo "cp \"out/libretro.$FORMAT_EXT\" \"$RARCH_DIST_DIR/$CORENAME_libretro${FORMAT}.$FORMAT_EXT\""
|
|
|
|
cp "out/libretro.$FORMAT_EXT" "$RARCH_DIST_DIR/$CORENAME_libretro${FORMAT}.$FORMAT_EXT"
|
2015-02-19 06:31:02 +00:00
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret $CORENAME
|
|
|
|
build_save_revision $ret $CORENAME
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$CORENAME not fetched, skipping ..."
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2013-05-18 17:04:19 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
build_libretro_bnes() {
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-bnes"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
if build_should_skip bnes "$build_dir"; then
|
|
|
|
echo "Core bnes is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
echo '=== Building bNES ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cd \"$build_dir\""
|
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
|
|
|
mkdir -p obj
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE -f Makefile \"-j$JOBS\" clean"
|
|
|
|
$MAKE -f Makefile "-j$JOBS" clean || die 'Failed to clean bNES'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE -f Makefile CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" compiler=\"${CXX11}\""
|
|
|
|
$MAKE -f Makefile CC="$CC" CXX="$CXX" "-j$JOBS" compiler="${CXX11}" || die 'Failed to build bNES'
|
|
|
|
echo "cp \"libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/bnes_libretro${FORMAT}.$FORMAT_EXT\""
|
|
|
|
cp "libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/bnes_libretro${FORMAT}.$FORMAT_EXT"
|
2015-02-19 06:31:02 +00:00
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret "bnes"
|
|
|
|
build_save_revision $ret "bnes"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo 'bNES not fetched, skipping ...'
|
|
|
|
fi
|
2013-05-18 17:04:19 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
build_libretro_mupen64() {
|
2015-02-17 03:19:30 +00:00
|
|
|
check_opengl
|
2015-02-18 06:32:27 +00:00
|
|
|
build_dir="$WORKDIR/libretro-mupen64plus"
|
2015-02-19 06:31:02 +00:00
|
|
|
|
|
|
|
if build_should_skip mupen64plus "$build_dir"; then
|
|
|
|
echo "Core mupen64plus is already built, skipping..."
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -d "$build_dir" ]; then
|
2015-02-19 06:31:02 +00:00
|
|
|
echo "cd \"$build_dir\""
|
2015-02-18 06:32:27 +00:00
|
|
|
cd "$build_dir"
|
2015-02-17 03:19:30 +00:00
|
|
|
|
|
|
|
mkdir -p obj
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ "$X86" ] && [ "$X86_64" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
echo '=== Building Mupen 64 Plus (x86_64 dynarec) ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE WITH_DYNAREC='x86_64' platform=\"$FORMAT_COMPILER_TARGET_ALT\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE WITH_DYNAREC='x86_64' platform="$FORMAT_COMPILER_TARGET_ALT" "-j$JOBS" clean || die 'Failed to clean Mupen 64 (x86_64 dynarec)'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE WITH_DYNAREC='x86_64' platform=\"$FORMAT_COMPILER_TARGET_ALT\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\" || die 'Failed to build Mupen 64 (x86_64 dynarec)'"
|
|
|
|
$MAKE WITH_DYNAREC='x86_64' platform="$FORMAT_COMPILER_TARGET_ALT" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build Mupen 64 (x86_64 dynarec)'
|
|
|
|
elif [ "$X86" ]; then
|
2015-02-17 03:19:30 +00:00
|
|
|
echo '=== Building Mupen 64 Plus (x86 32bit dynarec) ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE WITH_DYNAREC='x86' platform=\"$FORMAT_COMPILER_TARGET_ALT\" \"-j$JOBS\" clean"
|
|
|
|
$MAKE WITH_DYNAREC='x86' platform="$FORMAT_COMPILER_TARGET_ALT" "-j$JOBS" clean || die 'Failed to clean Mupen 64 (x86 dynarec)'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE WITH_DYNAREC='x86' platform=\"$FORMAT_COMPILER_TARGET_ALT\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE WITH_DYNAREC='x86' platform="$FORMAT_COMPILER_TARGET_ALT" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build Mupen 64 (x86 dynarec)'
|
2015-02-17 03:19:30 +00:00
|
|
|
elif [ "${CORTEX_A8}" ] || [ "${CORTEX_A9}" ] || [ "${IOS}" ]; then
|
|
|
|
echo '=== Building Mupen 64 Plus (ARM dynarec) ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE WITH_DYNAREC='arm' platform=\"$FORMAT_COMPILER_TARGET_ALT\" \"-j$JOBS\""
|
|
|
|
$MAKE WITH_DYNAREC='arm' platform="$FORMAT_COMPILER_TARGET_ALT" "-j$JOBS" clean || die 'Failed to clean Mupen 64 (ARM dynarec)'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE WITH_DYNAREC='arm' platform=\"$FORMAT_COMPILER_TARGET_ALT\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE WITH_DYNAREC='arm' platform="$FORMAT_COMPILER_TARGET_ALT" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build Mupen 64 (ARM dynarec)'
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo '=== Building Mupen 64 Plus ==='
|
2015-02-18 06:32:27 +00:00
|
|
|
if [ -z "$NOCLEAN" ]; then
|
|
|
|
echo "$MAKE \"-j$JOBS\" clean"
|
|
|
|
$MAKE "-j$JOBS" clean || die 'Failed to clean Mupen 64'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "$MAKE platform=\"$FORMAT_COMPILER_TARGET_ALT\" CC=\"$CC\" CXX=\"$CXX\" \"-j$JOBS\""
|
|
|
|
$MAKE platform="$FORMAT_COMPILER_TARGET_ALT" CC="$CC" CXX="$CXX" "-j$JOBS" || die 'Failed to build Mupen 64'
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-18 06:32:27 +00:00
|
|
|
echo "cp \"mupen64plus_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\""
|
|
|
|
cp "mupen64plus_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR"
|
2015-02-19 06:31:02 +00:00
|
|
|
ret=$?
|
|
|
|
build_summary_log $ret "mupen64plus"
|
|
|
|
build_save_revision $ret "mupen64plus"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
|
|
|
echo 'Mupen64 Plus not fetched, skipping ...'
|
|
|
|
fi
|
|
|
|
reset_compiler_targets
|
2013-06-30 15:33:15 +00:00
|
|
|
}
|
|
|
|
|
2015-01-31 03:01:14 +00:00
|
|
|
build_summary() {
|
2015-02-17 20:03:38 +00:00
|
|
|
if [ -z "$NOBUILD_SUMMARY" ]; then
|
|
|
|
printf -v summary "=== Core Build Summary ===\n\n"
|
|
|
|
if [ -n "$build_success" ]; then
|
|
|
|
printf -v summary "%s%s\n" "$summary" "$(echo $build_success | wc -w) core(s) successfully built:"
|
|
|
|
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_success)"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 17:57:48 +00:00
|
|
|
printf -v summary "%s%s\n\n" "$summary" " 0 cores successfully built."
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-17 20:03:38 +00:00
|
|
|
if [ -n "$build_fail" ]; then
|
|
|
|
printf -v summary "%s%s\n" "$summary" "$(echo $build_fail | wc -w) core(s) failed to build:"
|
|
|
|
printf -v summary "%s%s\n\n" "$summary" "$(echo $build_fail)"
|
2015-02-17 03:19:30 +00:00
|
|
|
else
|
2015-02-18 17:57:48 +00:00
|
|
|
printf -v summary "%s%s\n\n" "$summary" " 0 cores failed to build!"
|
2015-02-17 20:03:38 +00:00
|
|
|
fi
|
|
|
|
if [ -n "$BUILD_SUMMARY" ]; then
|
|
|
|
echo "$summary" > "$BUILD_SUMMARY"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-02-17 20:03:38 +00:00
|
|
|
echo "$summary"
|
2015-02-17 03:19:30 +00:00
|
|
|
fi
|
2015-01-31 03:01:14 +00:00
|
|
|
}
|
|
|
|
|
2013-10-09 00:52:48 +00:00
|
|
|
create_dist_dir() {
|
2015-02-18 06:32:27 +00:00
|
|
|
mkdir -p "$RARCH_DIST_DIR"
|
2013-04-30 02:45:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
create_dist_dir
|