2015-02-02 17:57:07 +00:00
# vi: ts=3 sw=3 et ft=bash
2013-04-30 02:45:55 +00:00
2013-10-09 00:52:48 +00:00
die( ) {
2013-04-30 02:45:55 +00:00
echo $1
#exit 1
}
2013-10-09 00:52:48 +00:00
if [ " ${ CC } " ] && [ " ${ CXX } " ] ; then
2013-11-26 14:41:45 +00:00
COMPILER = " CC=\" ${ CC } \" CXX=\" ${ CXX } \" "
2013-05-19 10:03:25 +00:00
else
COMPILER = ""
fi
2013-10-09 00:52:48 +00:00
echo " Compiler: ${ COMPILER } "
2013-05-19 10:03:25 +00:00
2013-10-09 00:52:48 +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
2013-08-12 02:55:34 +00:00
echo " ${ FORMAT_COMPILER_TARGET } "
2013-11-08 06:39:55 +00:00
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( ) {
if [ -z " ${ NOBUILD_SUMMARY } " ] ; then
if [ " ${ 1 } " -eq "0" ] ; then
echo ${ 2 } >> ${ BUILD_SUCCESS }
else
echo ${ 2 } >> ${ BUILD_FAIL }
fi
fi
}
2014-10-05 10:28:08 +00:00
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 } "
2013-07-13 22:10:43 +00:00
else
2013-10-09 00:52:48 +00:00
echo '=== OpenGL enabled ==='
2014-10-05 10:28:08 +00:00
export FORMAT_COMPILER_TARGET = " ${ FORMAT_COMPILER_TARGET } -opengl "
export FORMAT_COMPILER_TARGET_ALT = " ${ FORMAT_COMPILER_TARGET } "
2013-07-13 22:10:43 +00:00
fi
2013-07-13 22:15:07 +00:00
else
2013-10-09 00:52:48 +00:00
echo '=== OpenGL disabled in build ==='
2014-10-05 10:28:08 +00:00
fi
}
2013-07-13 22:10:43 +00:00
2014-10-05 11:09:13 +00:00
reset_compiler_targets( ) {
export FORMAT_COMPILER_TARGET = $RESET_FORMAT_COMPILER_TARGET
export FORMAT_COMPILER_TARGET_ALT = $RESET_FORMAT_COMPILER_TARGET_ALT
}
2013-12-19 23:31:05 +00:00
build_libretro_pcsx_rearmed_interpreter( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-10-31 20:31:07 +00:00
if [ -d 'libretro-pcsx_rearmed' ] ; then
2013-12-19 23:31:05 +00:00
echo '=== Building PCSX ReARMed Interpreter ==='
2014-10-31 20:31:07 +00:00
cd libretro-pcsx_rearmed
2013-12-19 23:31:05 +00:00
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean PCSX ReARMed'
fi
2013-12-19 23:31:05 +00:00
" ${ MAKE } " -f Makefile.libretro USE_DYNAREC = 0 platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build PCSX ReARMed'
cp " pcsx_rearmed_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } /pcsx_rearmed_interpreter ${ FORMAT } . ${ FORMAT_EXT } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "pcsx_rearmed_interpreter"
2013-12-19 23:31:05 +00:00
else
echo 'PCSX ReARMed not fetched, skipping ...'
2013-04-30 04:45:49 +00:00
fi
}
2014-08-22 13:49:38 +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-02 17:57:07 +00:00
cd ${ WORKDIR }
2014-08-22 13:49:38 +00:00
if [ -d " libretro- ${ 1 } " ] ; then
echo " === Building ${ 2 } === "
cd libretro-${ 1 } /
cd ${ 3 }
2013-04-30 03:35:15 +00:00
2014-08-22 13:49:38 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
make -f ${ 4 } platform = ${ 5 } -j$JOBS clean || die " Failed to clean ${ 2 } "
fi
make -f ${ 4 } platform = ${ 5 } -j$JOBS || die " Failed to build ${ 2 } "
cp ${ 2 } _libretro$FORMAT .${ FORMAT_EXT } $RARCH_DIST_DIR /${ 2 } _libretro$FORMAT .${ FORMAT_EXT }
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } ${ 2 }
2014-08-22 13:49:38 +00:00
fi
}
build_libretro_fba_cps2( ) {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_cps2" "svn-current/trunk/fbacores/cps2" "makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_fba_neogeo( ) {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_neo" "svn-current/trunk/fbacores/neogeo" "makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_fba_cps1( ) {
build_libretro_generic_makefile_subcore "fb_alpha" "fba_cores_cps1" "svn-current/trunk/fbacores/cps1" "makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
2014-06-18 18:27:55 +00:00
2014-12-22 08:10:07 +00:00
copy_core_to_dist( ) {
2014-12-23 07:47:37 +00:00
if [ " $FORMAT_COMPILER_TARGET " = "theos_ios" ] ; then
cp " objs/obj/ ${ 1 } _libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } ${ 1 }
2014-12-23 07:47:37 +00:00
else
cp " ${ 1 } _libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } ${ 1 }
2014-12-23 07:47:37 +00:00
fi
2014-12-22 08:10:07 +00:00
}
2014-08-22 09:54:31 +00:00
# $1 is corename
2014-08-22 13:49:38 +00:00
# $2 is subdir. In case there is no subdir, enter "." here
# $3 is Makefile name
# $4 is preferred platform
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-08-22 09:54:31 +00:00
if [ -d " libretro- ${ 1 } " ] ; then
echo " === Building ${ 1 } === "
2014-08-22 11:28:33 +00:00
cd libretro-${ 1 }
cd ${ 2 }
2014-08-08 17:32:30 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
2014-11-21 03:56:27 +00:00
" ${ MAKE } " -f ${ 3 } platform = " ${ 4 } " ${ COMPILER } " -j ${ JOBS } " clean || die " Failed to build ${ 1 } "
2014-08-08 17:32:30 +00:00
fi
2014-12-07 17:42:11 +00:00
echo " ${ MAKE } " -f ${ 3 } platform = " ${ 4 } " ${ COMPILER } " -j ${ JOBS } "
2014-08-22 11:28:33 +00:00
" ${ MAKE } " -f ${ 3 } platform = " ${ 4 } " ${ COMPILER } " -j ${ JOBS } " || die " Failed to build ${ 1 } "
2014-12-22 08:10:07 +00:00
if [ -z " ${ 5 } " ] ; then
copy_core_to_dist $1
fi
2014-08-08 17:32:30 +00:00
else
2014-08-22 09:54:31 +00:00
echo " ${ 1 } not fetched, skipping ... "
2014-08-08 17:32:30 +00:00
fi
}
2014-11-21 03:46:52 +00:00
build_libretro_stonesoup( ) {
build_libretro_generic_makefile "stonesoup" "crawl-ref" "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
2014-11-27 22:27:00 +00:00
build_libretro_hatari( ) {
build_libretro_generic_makefile "hatari" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
2014-08-22 09:54:31 +00:00
build_libretro_prosystem( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "prosystem" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 09:54:31 +00:00
}
2014-08-14 19:50:16 +00:00
2014-08-23 10:50:22 +00:00
build_libretro_4do( ) {
build_libretro_generic_makefile "4do" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
}
2014-08-22 09:54:31 +00:00
build_libretro_o2em( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "o2em" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-14 19:50:16 +00:00
}
2014-08-09 20:28:37 +00:00
build_libretro_virtualjaguar( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "virtualjaguar" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-09 20:28:37 +00:00
}
2014-08-22 10:05:35 +00:00
build_libretro_tgbdual( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "tgbdual" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
build_libretro_nx( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "nxengine" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
2014-10-29 21:03:18 +00:00
build_libretro_catsfc( ) {
build_libretro_generic_makefile "catsfc" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
}
2014-12-22 08:10:07 +00:00
build_libretro_emux( ) {
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"
}
2014-08-22 10:05:35 +00:00
build_libretro_picodrive( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "picodrive" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
build_libretro_tyrquake( ) {
2014-08-24 16:26:41 +00:00
build_libretro_generic_makefile "tyrquake" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
build_libretro_2048( ) {
2014-08-22 12:12:51 +00:00
build_libretro_generic_makefile "2048" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
2014-08-22 10:21:57 +00:00
build_libretro_vecx( ) {
2014-08-23 14:13:53 +00:00
build_libretro_generic_makefile "vecx" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
2014-08-22 10:21:57 +00:00
build_libretro_stella( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "stella" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
build_libretro_bluemsx( ) {
2014-08-22 12:12:51 +00:00
build_libretro_generic_makefile "bluemsx" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:05:35 +00:00
}
build_libretro_handy( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-22 11:28:33 +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( ) {
build_libretro_generic_makefile "gpsp" "." "Makefile" ${ FORMAT_COMPILER_TARGET_ALT }
}
2014-08-22 10:05:35 +00:00
build_libretro_vba_next( ) {
2014-10-05 10:28:08 +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( ) {
2014-10-05 10:28:08 +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( ) {
2014-10-05 10:28:08 +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( ) {
2014-10-05 10:28:08 +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( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-23 14:13:53 +00:00
build_libretro_generic_makefile "mame078" "." "makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:33:53 +00:00
}
build_libretro_prboom( ) {
2014-10-05 10:28:08 +00:00
build_libretro_generic_makefile "prboom" "." "Makefile" ${ FORMAT_COMPILER_TARGET_ALT }
2014-08-22 10:33:53 +00:00
}
build_libretro_pcsx_rearmed( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_snes" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_lynx( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_lynx" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_wswan( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_wswan" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_gba( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_gba" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_ngp( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-22 11:28:33 +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( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_vb" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_pcfx( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_pcfx" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_psx( ) {
2014-12-03 10:40:11 +00:00
build_libretro_generic_makefile "beetle_psx" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_mednafen_psx( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_psx" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 10:46:41 +00:00
}
build_libretro_beetle_supergrafx( ) {
2014-08-22 11:28:33 +00:00
build_libretro_generic_makefile "mednafen_supergrafx" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_meteor( ) {
build_libretro_generic_makefile "meteor" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_nestopia( ) {
2014-12-07 17:42:11 +00:00
echo command build_libretro_generic_makefile "nestopia" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-23 14:13:53 +00:00
build_libretro_generic_makefile "nestopia" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-08-22 11:28:33 +00:00
}
build_libretro_gambatte( ) {
2014-10-05 10:28:08 +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( ) {
build_libretro_generic_makefile "yabause" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_desmume( ) {
build_libretro_generic_makefile "desmume" "desmume" "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_snes9x( ) {
build_libretro_generic_makefile "snes9x" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_quicknes( ) {
build_libretro_generic_makefile "quicknes" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_dosbox( ) {
build_libretro_generic_makefile "dosbox" "." "Makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
2014-08-22 13:39:20 +00:00
build_libretro_fb_alpha( ) {
build_libretro_generic_makefile "fb_alpha" "svn-current/trunk" "makefile.libretro" ${ FORMAT_COMPILER_TARGET }
}
2014-08-22 11:28:33 +00:00
build_libretro_ffmpeg( ) {
2014-10-05 10:28:08 +00:00
check_opengl
build_libretro_generic_makefile "ffmpeg" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-10-05 11:09:13 +00:00
reset_compiler_targets
2014-08-22 11:28:33 +00:00
}
build_libretro_3dengine( ) {
2014-10-05 10:28:08 +00:00
check_opengl
build_libretro_generic_makefile "3dengine" "." "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-10-05 11:09:13 +00:00
reset_compiler_targets
2014-08-22 11:28:33 +00:00
}
build_libretro_scummvm( ) {
build_libretro_generic_makefile "scummvm" "backends/platform/libretro/build" "Makefile" ${ FORMAT_COMPILER_TARGET }
}
build_libretro_ppsspp( ) {
2014-10-05 10:28:08 +00:00
check_opengl
build_libretro_generic_makefile "ppsspp" "libretro" "Makefile" ${ FORMAT_COMPILER_TARGET }
2014-10-05 11:09:13 +00:00
reset_compiler_targets
2014-08-22 11:28:33 +00:00
}
2014-08-22 10:46:41 +00:00
2013-10-09 00:52:48 +00:00
build_libretro_mame( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2013-10-09 00:52:48 +00:00
if [ -d 'libretro-mame' ] ; then
2014-03-21 22:44:24 +00:00
echo ''
2013-10-09 00:52:48 +00:00
echo '=== Building MAME ==='
2014-03-29 14:36:25 +00:00
cd libretro-mame
2013-09-23 02:03:55 +00:00
2014-07-13 23:54:37 +00:00
if [ " $IOS " ] ; then
echo '=== Building MAME (iOS) ==='
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
2014-09-14 05:50:18 +00:00
" ${ MAKE } " -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } "NATIVE=1" buildtools " -j ${ JOBS } " || die 'Failed to build MAME buildtools'
2014-07-13 23:54:37 +00:00
" ${ MAKE } " -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } emulator " -j ${ JOBS } " || die 'Failed to build MAME (iOS)'
elif [ " $X86_64 " = "true" ] ; then
2014-03-21 22:44:24 +00:00
echo '=== Building MAME64 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
2014-03-21 22:44:24 +00:00
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
else
echo '=== Building MAME32 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
2014-03-21 22:44:24 +00:00
" ${ MAKE } " -f Makefile.libretro "TARGET=mame" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
fi
2013-10-09 00:52:48 +00:00
cp " mame_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2013-09-23 02:03:55 +00:00
else
2013-10-09 00:52:48 +00:00
echo 'MAME not fetched, skipping ...'
2013-09-23 02:03:55 +00:00
fi
}
2014-03-17 04:17:04 +00:00
build_libretro_mess( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-03-17 04:17:04 +00:00
if [ -d 'libretro-mame' ] ; then
2014-03-21 22:44:24 +00:00
echo ''
2014-03-17 04:17:04 +00:00
echo '=== Building MESS ==='
2014-03-29 14:36:25 +00:00
cd libretro-mame
2014-03-17 04:17:04 +00:00
2014-06-18 09:45:41 +00:00
if [ " $X86_64 " = "true" ] ; then
2014-03-21 22:44:24 +00:00
echo '=== Building MESS64 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
else
echo '=== Building MESS32 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
fi
2014-03-17 04:17:04 +00:00
cp " mess_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "mess"
2014-03-17 04:17:04 +00:00
else
echo 'MAME not fetched, skipping ...'
fi
}
2014-03-18 20:07:30 +00:00
rebuild_libretro_mess( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-03-17 04:40:30 +00:00
if [ -d 'libretro-mame' ] ; then
2014-03-21 22:44:24 +00:00
echo ''
2014-03-18 20:07:30 +00:00
echo '=== Building MESS ==='
2014-03-29 14:36:25 +00:00
cd libretro-mame
2014-03-17 04:40:30 +00:00
2014-06-18 09:45:41 +00:00
if [ " $X86_64 " = "true" ] ; then
2014-03-21 22:44:24 +00:00
echo '=== Building MESS64 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mess" "PARTIAL=1" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
2014-03-21 22:44:24 +00:00
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
else
echo '=== Building MESS32 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=mess" "PARTIAL=1" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " -f Makefile.libretro "TARGET=mess" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
fi
2014-03-18 20:07:30 +00:00
cp " mess_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "mess"
2014-03-17 04:40:30 +00:00
else
echo 'MAME not fetched, skipping ...'
fi
}
2014-03-18 20:07:30 +00:00
build_libretro_ume( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-03-17 04:17:04 +00:00
if [ -d 'libretro-mame' ] ; then
2014-03-21 22:44:24 +00:00
echo ''
2014-03-18 20:07:30 +00:00
echo '=== Building UME ==='
2014-03-29 14:36:25 +00:00
cd libretro-mame
2014-03-17 04:17:04 +00:00
2014-06-18 09:45:41 +00:00
if [ " $X86_64 " = "true" ] ; then
2014-03-21 22:44:24 +00:00
echo '=== Building UME64 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
else
echo '=== Building UME32 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
2014-03-21 22:44:24 +00:00
" ${ MAKE } " -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
fi
cp " ume_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "ume"
2014-03-21 22:44:24 +00:00
else
echo 'MAME not fetched, skipping ...'
fi
}
rebuild_libretro_ume( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-03-21 22:44:24 +00:00
if [ -d 'libretro-mame' ] ; then
echo ''
echo '=== Building MESS ==='
2014-03-29 14:36:25 +00:00
cd libretro-mame
2014-03-21 22:44:24 +00:00
2014-06-18 09:45:41 +00:00
if [ " $X86_64 " = "true" ] ; then
2014-03-21 22:44:24 +00:00
echo '=== Building UME64 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=ume" "PARTIAL=1" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " PTR64 = 1 -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
else
echo '=== Building UME32 ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile.libretro "TARGET=ume" "PARTIAL=1" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " clean || die 'Failed to clean MAME'
fi
" ${ MAKE } " -f Makefile.libretro "TARGET=ume" platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build MAME'
2014-03-21 22:44:24 +00:00
fi
2014-03-18 20:07:30 +00:00
cp " ume_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "ume"
2014-03-17 04:17:04 +00:00
else
echo 'MAME not fetched, skipping ...'
fi
}
2014-08-22 14:47:03 +00:00
# $1 is corename
# $2 is profile shortname.
# $3 is profile name
2014-08-22 15:58:08 +00:00
# $4 is compiler
2014-08-22 14:48:52 +00:00
build_libretro_bsnes_modern( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-10-03 14:38:24 +00:00
if [ -d " libretro- ${ 1 } " ] ; then
2014-08-22 14:47:03 +00:00
echo " === Building ${ 1 } ${ 3 } === "
2014-10-03 14:38:24 +00:00
cd libretro-${ 1 }
2014-08-08 20:28:17 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
rm -f obj/*.{ o," ${ FORMAT_EXT } " }
2014-10-29 21:06:17 +00:00
rm -f out/*.{ o," ${ FORMAT_EXT } " }
2014-08-08 20:28:17 +00:00
fi
2014-08-22 15:58:08 +00:00
" ${ MAKE } " -f Makefile platform = " ${ FORMAT_COMPILER_TARGET } " compiler = " ${ 4 } " ui = 'target-libretro' profile = " ${ 3 } " " -j ${ JOBS } " || die " Failed to build ${ 1 } ${ 3 } core "
2014-08-22 14:47:03 +00:00
cp -f " out/ ${ 1 } _libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } / ${ 1 } _ ${ 3 } _libretro ${ FORMAT } . ${ FORMAT_EXT } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } " ${ 1 } _ ${ 3 } "
2014-07-30 15:22:18 +00:00
else
2014-08-22 14:47:03 +00:00
echo " ${ 1 } ${ 3 } not fetched, skipping ... "
2014-07-30 15:22:18 +00:00
fi
}
2013-10-09 00:52:48 +00:00
build_libretro_bsnes( ) {
2014-08-22 15:58:08 +00:00
build_libretro_bsnes_modern "bsnes" "perf" "performance" ${ CXX11 }
build_libretro_bsnes_modern "bsnes" "balanced" "balanced" ${ CXX11 }
build_libretro_bsnes_modern "bsnes" "." "accuracy" ${ CXX11 }
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( ) {
2014-08-22 15:58:08 +00:00
build_libretro_bsnes_modern "bsnes_mercury" "perf" "performance" ${ CXX11 }
build_libretro_bsnes_modern "bsnes_mercury" "balanced" "balanced" ${ CXX11 }
build_libretro_bsnes_modern "bsnes_mercury" "." "accuracy" ${ CXX11 }
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( ) {
CORENAME = "bsnes_cplusplus98"
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2014-08-22 14:47:03 +00:00
if [ -d " libretro- ${ CORENAME } " ] ; then
echo " === Building ${ CORENAME } === "
cd libretro-${ CORENAME }
2014-08-08 20:28:17 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
2014-08-22 14:47:03 +00:00
" ${ MAKE } " clean || die " Failed to clean ${ CORENAME } "
2014-08-08 20:28:17 +00:00
fi
2014-08-22 14:47:03 +00:00
" ${ MAKE } " platform = " ${ FORMAT_COMPILER_TARGET } " ${ COMPILER } " -j ${ JOBS } "
cp " out/libretro. ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } / ${ CORENAME } _libretro ${ FORMAT } . ${ FORMAT_EXT } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } ${ CORENAME }
2014-07-30 15:22:18 +00:00
else
2014-08-22 14:47:03 +00:00
echo " ${ CORENAME } not fetched, skipping ... "
2013-05-18 17:04:19 +00:00
fi
}
2013-10-09 00:52:48 +00:00
build_libretro_bnes( ) {
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2013-10-09 00:52:48 +00:00
if [ -d 'libretro-bnes' ] ; then
echo '=== Building bNES ==='
2013-05-18 17:04:19 +00:00
cd libretro-bnes
2013-10-09 00:52:48 +00:00
2013-05-18 17:04:19 +00:00
mkdir -p obj
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " -f Makefile " -j ${ JOBS } " clean || die 'Failed to clean bNES'
fi
2013-12-15 20:01:11 +00:00
" ${ MAKE } " -f Makefile ${ COMPILER } " -j ${ JOBS } " compiler = " ${ CXX11 } " || die 'Failed to build bNES'
2013-12-15 19:43:17 +00:00
cp " libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } /bnes_libretro ${ FORMAT } . ${ FORMAT_EXT } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "bnes"
2013-05-18 17:04:19 +00:00
else
2013-10-09 00:52:48 +00:00
echo 'bNES not fetched, skipping ...'
2013-05-18 17:04:19 +00:00
fi
}
2013-10-09 00:52:48 +00:00
build_libretro_mupen64( ) {
2014-10-05 10:28:08 +00:00
check_opengl
2015-02-02 17:57:07 +00:00
cd " ${ WORKDIR } "
2013-10-09 00:52:48 +00:00
if [ -d 'libretro-mupen64plus' ] ; then
2013-06-30 15:33:15 +00:00
cd libretro-mupen64plus
2013-10-09 00:52:48 +00:00
2013-06-30 15:33:15 +00:00
mkdir -p obj
2013-10-09 00:52:48 +00:00
if [ " ${ X86 } " ] && [ " ${ X86_64 } " ] ; then
echo '=== Building Mupen 64 Plus (x86_64 dynarec) ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " WITH_DYNAREC = 'x86_64' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " " -j ${ JOBS } " clean || die 'Failed to clean Mupen 64 (x86_64 dynarec)'
fi
2013-10-12 23:07:22 +00:00
" ${ MAKE } " WITH_DYNAREC = 'x86_64' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build Mupen 64 (x86_64 dynarec)'
2013-10-09 00:52:48 +00:00
elif [ " ${ X86 } " ] ; then
echo '=== Building Mupen 64 Plus (x86 32bit dynarec) ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " WITH_DYNAREC = 'x86' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " " -j ${ JOBS } " clean || die 'Failed to clean Mupen 64 (x86 dynarec)'
fi
2013-10-12 23:07:22 +00:00
" ${ MAKE } " WITH_DYNAREC = 'x86' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build Mupen 64 (x86 dynarec)'
2013-11-29 15:17:33 +00:00
elif [ " ${ CORTEX_A8 } " ] || [ " ${ CORTEX_A9 } " ] || [ " ${ IOS } " ] ; then
2013-10-09 00:52:48 +00:00
echo '=== Building Mupen 64 Plus (ARM dynarec) ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " WITH_DYNAREC = 'arm' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " " -j ${ JOBS } " clean || die 'Failed to clean Mupen 64 (ARM dynarec)'
fi
" ${ MAKE } " WITH_DYNAREC = 'arm' platform = " ${ FORMAT_COMPILER_TARGET_ALT } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build Mupen 64 (ARM dynarec)'
2013-08-26 22:39:57 +00:00
else
2013-10-09 00:52:48 +00:00
echo '=== Building Mupen 64 Plus ==='
2014-06-15 22:11:54 +00:00
if [ -z " ${ NOCLEAN } " ] ; then
" ${ MAKE } " " -j ${ JOBS } " clean || die 'Failed to clean Mupen 64'
fi
" ${ MAKE } " platform = " ${ FORMAT_COMPILER_TARGET_ALT } " ${ COMPILER } " -j ${ JOBS } " || die 'Failed to build Mupen 64'
2013-08-26 22:39:57 +00:00
fi
2013-10-09 00:52:48 +00:00
cp " mupen64plus_libretro ${ FORMAT } . ${ FORMAT_EXT } " " ${ RARCH_DIST_DIR } "
2015-01-31 03:01:14 +00:00
build_summary_log ${ ? } "mupen64plus"
2013-06-30 15:33:15 +00:00
else
2013-10-09 00:52:48 +00:00
echo 'Mupen64 Plus not fetched, skipping ...'
2013-06-30 15:33:15 +00:00
fi
2014-10-05 11:09:13 +00:00
reset_compiler_targets
2013-06-30 15:33:15 +00:00
}
2015-01-31 03:01:14 +00:00
build_summary( ) {
if [ -z " ${ NOBUILD_SUMMARY } " ] ; then
echo "=== Core Build Summary ===" > ${ BUILD_SUMMARY }
if [ -r " ${ BUILD_SUCCESS } " ] ; then
echo " $( wc -l < ${ BUILD_SUCCESS } ) core(s) successfully built: " >> ${ BUILD_SUMMARY }
${ BUILD_SUMMARY_FMT } ${ BUILD_SUCCESS } >> ${ BUILD_SUMMARY }
else
echo " 0 cores successfully built. :(" >> ${ BUILD_SUMMARY }
echo " $( wc -l < ${ BUILD_FAIL } ) core(s) failed to build: "
fi
if [ -r " ${ BUILD_FAIL } " ] ; then
echo " $( wc -l < ${ BUILD_FAIL } ) core(s) failed to build: " >> ${ BUILD_SUMMARY }
${ BUILD_SUMMARY_FMT } ${ BUILD_FAIL } >> ${ BUILD_SUMMARY }
else
echo " 0 cores failed to build! :D" >> ${ BUILD_SUMMARY }
fi
rm -f $BUILD_SUCCESS $BUILD_FAIL
cat ${ BUILD_SUMMARY }
fi
}
2013-10-09 00:52:48 +00:00
create_dist_dir( ) {
if [ -d " ${ RARCH_DIST_DIR } " ] ; then
echo " Directory ${ RARCH_DIST_DIR } already exists, skipping creation... "
2013-04-30 02:45:55 +00:00
else
2013-10-09 00:52:48 +00:00
mkdir -p " ${ RARCH_DIST_DIR } "
2013-04-30 02:45:55 +00:00
fi
}
create_dist_dir
2015-01-31 03:01:14 +00:00