Merge pull request #201 from iKarith/master

New bsnes_modern build rule that builds all three profiles at once
This commit is contained in:
Twinaphex 2015-02-23 04:41:05 +11:00
commit be5aa231f3

View File

@ -1,12 +1,18 @@
# vim: set ts=3 sw=3 noet ft=sh : bash # vim: set ts=3 sw=3 noet ft=sh : bash
. ${BASE_DIR}/script-modules/fetch-rules.sh . "${BASE_DIR}/script-modules/fetch-rules.sh"
die() { die() {
echo $1 echo $1
#exit 1 #exit 1
} }
echo_cmd() {
eval 'echo "$@"'
eval "$@"
}
# #
# FIXME: Okay regarding COMPILER... It's no longer used to build any targets # 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 # in this file because it doesn't let you specify arguments to the compiler
@ -38,6 +44,9 @@ echo "$FORMAT_COMPILER_TARGET_ALT"
RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET RESET_FORMAT_COMPILER_TARGET=$FORMAT_COMPILER_TARGET
RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT RESET_FORMAT_COMPILER_TARGET_ALT=$FORMAT_COMPILER_TARGET_ALT
CORE_SUFFIX="_libretro${FORMAT}.$FORMAT_EXT"
build_summary_log() { build_summary_log() {
if [ "$1" -eq "0" ]; then if [ "$1" -eq "0" ]; then
build_success="$build_success$2 " build_success="$build_success$2 "
@ -113,8 +122,8 @@ build_libretro_pcsx_rearmed_interpreter() {
echo "$MAKE -f Makefile.libretro USE_DYNAREC=0 platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\"" echo "$MAKE -f Makefile.libretro USE_DYNAREC=0 platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\""
$MAKE -f Makefile.libretro USE_DYNAREC=0 platform="$FORMAT_COMPILER_TARGET" "-j$JOBS" || die 'Failed to build PCSX ReARMed' $MAKE -f Makefile.libretro USE_DYNAREC=0 platform="$FORMAT_COMPILER_TARGET" "-j$JOBS" || die 'Failed to build PCSX ReARMed'
fi fi
echo "cp \"pcsx_rearmed_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/pcsx_rearmed_interpreter${FORMAT}.$FORMAT_EXT\"" echo "cp \"pcsx_rearmed$CORE_SUFFIX\" \"$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" cp "pcsx_rearmed$CORE_SUFFIX" "$RARCH_DIST_DIR/pcsx_rearmed_interpreter${FORMAT}.$FORMAT_EXT"
build_summary_log $? "pcsx_rearmed_interpreter" build_summary_log $? "pcsx_rearmed_interpreter"
else else
echo 'PCSX ReARMed not fetched, skipping ...' echo 'PCSX ReARMed not fetched, skipping ...'
@ -139,8 +148,8 @@ build_libretro_generic_makefile_subcore() {
fi fi
echo "$MAKE -f $4 platform=$5 -j$JOBS" echo "$MAKE -f $4 platform=$5 -j$JOBS"
$MAKE -f $4 platform=$5 -j$JOBS || die "Failed to build $2" $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" echo "cp $2$CORE_SUFFIX $RARCH_DIST_DIR/$2$CORE_SUFFIX"
cp ${2}_libretro${FORMAT}.$FORMAT_EXT $RARCH_DIST_DIR/${2}_libretro${FORMAT}.$FORMAT_EXT cp $2$CORE_SUFFIX $RARCH_DIST_DIR/$2$CORE_SUFFIX
build_summary_log $? "$2" build_summary_log $? "$2"
fi fi
} }
@ -160,11 +169,11 @@ build_libretro_fba_cps1() {
copy_core_to_dist() { copy_core_to_dist() {
if [ "$FORMAT_COMPILER_TARGET" = "theos_ios" ]; then if [ "$FORMAT_COMPILER_TARGET" = "theos_ios" ]; then
echo "cp \"objs/obj/${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\"" echo "cp \"objs/obj/$1$CORE_SUFFIX\" \"$RARCH_DIST_DIR\""
cp "objs/obj/${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR" cp "objs/obj/$1$CORE_SUFFIX" "$RARCH_DIST_DIR"
else else
echo "cp \"${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\"" echo "cp \"$1$CORE_SUFFIX\" \"$RARCH_DIST_DIR\""
cp "${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR" cp "$1$CORE_SUFFIX" "$RARCH_DIST_DIR"
fi fi
ret=$? ret=$?
@ -519,8 +528,8 @@ build_libretro_mame_modern() {
fi fi
fi fi
echo "cp \"${2}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\"" echo "cp \"$2$CORE_SUFFIX\" \"$RARCH_DIST_DIR\""
cp "${2}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR" cp "$2$CORE_SUFFIX" "$RARCH_DIST_DIR"
ret=$? ret=$?
build_summary_log $ret "$2" build_summary_log $ret "$2"
return $ret return $ret
@ -567,23 +576,28 @@ build_libretro_bsnes_modern() {
build_dir="$WORKDIR/libretro-$1" build_dir="$WORKDIR/libretro-$1"
if [ -d "$build_dir" ]; then if [ -d "$build_dir" ]; then
echo "=== Building $1 $3 ===" echo "=== Building $1 $3 ==="
echo "cd \"$build_dir\"" echo_cmd "cd \"$build_dir\""
cd "$build_dir"
if [ -z "$NOCLEAN" ]; then if [ -z "$NOCLEAN" ]; then
rm -f obj/*.{o,"$FORMAT_EXT"} echo_cmd "rm -f obj/*.{o,\"$FORMAT_EXT\"}"
rm -f out/*.{o,"$FORMAT_EXT"} echo_cmd "rm -f out/*.{o,\"$FORMAT_EXT\"}"
fi fi
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" cmdline="$MAKE target=libretro -j$JOBS"
echo "cp -f \"out/${1}_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/${1}_${3}_libretro${FORMAT}.$FORMAT_EXT\"" cmdline="$cmdline platform=\"$FORMAT_COMPILER_TARGET\""
cp -f "out/${1}_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/${1}_${3}_libretro${FORMAT}.$FORMAT_EXT" cmdline="$cmdline compiler=\"$CXX11\""
ret=0
for a in accuracy balanced performance; do
echo_cmd "$cmdline profile=$a"
echo_cmd "cp -f \"out/${1}_$a$CORE_SUFFIX\" \"$RARCH_DIST_DIR/${1}_$a$CORE_SUFFIX\""
ret=$? ret=$?
build_summary_log $ret "${1}_$3" build_summary_log $ret "${1}_$a"
[ $ret -eq 0 ] || break
done
return $ret return $ret
else else
echo "$1 $3 not fetched, skipping ..." echo "$1 not fetched, skipping ..."
fi fi
} }
@ -593,12 +607,7 @@ build_libretro_bsnes() {
return return
fi fi
# FIXME: Do this once build_libretro_bsnes_modern "bsnes"
build_libretro_bsnes_modern "bsnes" "." "performance"
build_libretro_bsnes_modern "bsnes" "." "balanced"
build_libretro_bsnes_modern "bsnes" "." "accuracy"
# TODO: Make this not depend on accuracy
build_save_revision $? bsnes build_save_revision $? bsnes
} }
@ -608,12 +617,7 @@ build_libretro_bsnes_mercury() {
return return
fi fi
set +x build_libretro_bsnes_modern "bsnes_mercury"
build_libretro_bsnes_modern "bsnes_mercury" "perf" "performance"
build_libretro_bsnes_modern "bsnes_mercury" "balanced" "balanced"
build_libretro_bsnes_modern "bsnes_mercury" "." "accuracy"
# TODO: Make this not depend on accuracy
build_save_revision $? bsnes_mercury build_save_revision $? bsnes_mercury
} }
@ -643,8 +647,8 @@ build_libretro_bsnes_cplusplus98() {
echo "$MAKE platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\"" echo "$MAKE platform=\"$FORMAT_COMPILER_TARGET\" \"-j$JOBS\""
$MAKE platform="$FORMAT_COMPILER_TARGET" "-j$JOBS" $MAKE platform="$FORMAT_COMPILER_TARGET" "-j$JOBS"
fi fi
echo "cp \"out/libretro.$FORMAT_EXT\" \"$RARCH_DIST_DIR/$CORENAME_libretro${FORMAT}.$FORMAT_EXT\"" echo "cp \"out/libretro.$FORMAT_EXT\" \"$RARCH_DIST_DIR/$CORENAME$CORE_SUFFIX\""
cp "out/libretro.$FORMAT_EXT" "$RARCH_DIST_DIR/$CORENAME_libretro${FORMAT}.$FORMAT_EXT" cp "out/libretro.$FORMAT_EXT" "$RARCH_DIST_DIR/$CORENAME$CORE_SUFFIX"
ret=$? ret=$?
build_summary_log $ret $CORENAME build_summary_log $ret $CORENAME
build_save_revision $ret $CORENAME build_save_revision $ret $CORENAME
@ -679,8 +683,8 @@ build_libretro_bnes() {
echo "$MAKE -f Makefile \"-j$JOBS\" compiler=\"${CXX11}\"" echo "$MAKE -f Makefile \"-j$JOBS\" compiler=\"${CXX11}\""
$MAKE -f Makefile "-j$JOBS" compiler="${CXX11}" || die 'Failed to build bNES' $MAKE -f Makefile "-j$JOBS" compiler="${CXX11}" || die 'Failed to build bNES'
fi fi
echo "cp \"libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/bnes_libretro${FORMAT}.$FORMAT_EXT\"" echo "cp \"libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR/bnes$CORE_SUFFIX\""
cp "libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/bnes_libretro${FORMAT}.$FORMAT_EXT" cp "libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR/bnes$CORE_SUFFIX"
ret=$? ret=$?
build_summary_log $ret "bnes" build_summary_log $ret "bnes"
build_save_revision $ret "bnes" build_save_revision $ret "bnes"
@ -760,8 +764,8 @@ build_libretro_mupen64() {
$MAKE platform="$FORMAT_COMPILER_TARGET_ALT" "-j$JOBS" || die 'Failed to build Mupen 64' $MAKE platform="$FORMAT_COMPILER_TARGET_ALT" "-j$JOBS" || die 'Failed to build Mupen 64'
fi fi
fi fi
echo "cp \"mupen64plus_libretro${FORMAT}.$FORMAT_EXT\" \"$RARCH_DIST_DIR\"" echo "cp \"mupen64plus$CORE_SUFFIX\" \"$RARCH_DIST_DIR\""
cp "mupen64plus_libretro${FORMAT}.$FORMAT_EXT" "$RARCH_DIST_DIR" cp "mupen64plus$CORE_SUFFIX" "$RARCH_DIST_DIR"
ret=$? ret=$?
build_summary_log $ret "mupen64plus" build_summary_log $ret "mupen64plus"
build_save_revision $ret "mupen64plus" build_save_revision $ret "mupen64plus"