2011-12-31 18:50:17 +00:00
|
|
|
#!/bin/sh
|
2011-12-24 11:15:42 +00:00
|
|
|
|
2012-04-18 14:09:18 +00:00
|
|
|
# PCSX2 - PS2 Emulator for PCs
|
|
|
|
# Copyright (C) 2002-2011 PCSX2 Dev Team
|
|
|
|
#
|
|
|
|
# PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
# of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
# ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
# PURPOSE. See the GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
# If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2011-12-24 11:15:42 +00:00
|
|
|
flags=""
|
|
|
|
clean_build=false
|
|
|
|
|
2012-01-07 22:20:50 +00:00
|
|
|
for f in $*
|
|
|
|
do
|
|
|
|
case $f in
|
|
|
|
--sdl13)
|
|
|
|
flags="$flags -DFORCE_INTERNAL_SDL=TRUE"
|
2012-06-01 14:26:37 +00:00
|
|
|
echo "Warning SDL is not supported anymore"
|
2012-01-07 22:20:50 +00:00
|
|
|
;;
|
2012-06-02 08:01:04 +00:00
|
|
|
--dev|--devel)
|
2012-01-07 22:20:50 +00:00
|
|
|
flags="$flags -DCMAKE_BUILD_TYPE=Devel"
|
|
|
|
;;
|
|
|
|
--debug)
|
|
|
|
flags="$flags -DCMAKE_BUILD_TYPE=Debug"
|
|
|
|
;;
|
|
|
|
--release)
|
|
|
|
flags="$flags -DCMAKE_BUILD_TYPE=Release"
|
|
|
|
;;
|
2012-06-01 14:26:37 +00:00
|
|
|
--glsl)
|
|
|
|
flags="$flags -DGLSL_API=TRUE"
|
2012-06-02 08:01:04 +00:00
|
|
|
;;
|
2012-01-07 22:20:50 +00:00
|
|
|
--clean)
|
|
|
|
clean_build=true
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# unknown option
|
|
|
|
echo "Valid options are:"
|
2012-06-02 08:01:04 +00:00
|
|
|
echo "--dev / --devel - Build PCSX2 as a Development build."
|
|
|
|
echo "--debug - Build PCSX2 as a Debug build."
|
|
|
|
echo "--release - Build PCSX2 as a Release build."
|
|
|
|
echo "--clean - Do a clean build."
|
|
|
|
echo "--glsl - Replace CG backend of ZZogl by GLSL"
|
|
|
|
echo "--sdl13 - Use the internal copy of SDL (add sdl backend to gsdx)."
|
2012-01-07 22:20:50 +00:00
|
|
|
exit 1;;
|
|
|
|
esac
|
|
|
|
done
|
2011-12-24 11:15:42 +00:00
|
|
|
|
|
|
|
rm install_log.txt
|
|
|
|
|
2012-06-02 08:01:04 +00:00
|
|
|
if [ "$flags" != "" ]; then
|
2011-12-24 11:15:42 +00:00
|
|
|
echo "Building pcsx2 with $flags"
|
|
|
|
echo "Building pcsx2 with $flags" > install_log.txt
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -d "build" ]; then
|
|
|
|
mkdir build
|
|
|
|
fi
|
|
|
|
cd build
|
|
|
|
|
|
|
|
cmake $flags .. 2>&1 | tee -a ../install_log.txt
|
2012-06-02 08:01:04 +00:00
|
|
|
if [ "$clean_build" = true ]; then
|
2011-12-24 11:25:44 +00:00
|
|
|
echo "Doing a clean build."
|
2011-12-24 11:15:42 +00:00
|
|
|
make clean 2>&1 | tee -a ../install_log.txt
|
|
|
|
fi
|
2012-04-23 18:58:03 +00:00
|
|
|
CORE=`grep -w -c processor /proc/cpuinfo`
|
|
|
|
make -j $CORE 2>&1 | tee -a ../install_log.txt
|
2011-12-24 11:15:42 +00:00
|
|
|
make install 2>&1 | tee -a ../install_log.txt
|
|
|
|
|
2012-04-18 14:09:18 +00:00
|
|
|
cd ..
|