2012-08-02 13:02:59 +08:00
|
|
|
#!/bin/bash
|
2013-03-09 00:01:03 +08:00
|
|
|
# This script will perform a clean linux build of all targets in both
|
|
|
|
# debug and release configurations. It will also ensure that all the required
|
|
|
|
# packages are installed. For day-to-day work on the linux port it is
|
|
|
|
# faster/better to simply use 'make' either at the top level or in the subpject
|
|
|
|
# you are working on.
|
2012-08-02 13:02:59 +08:00
|
|
|
|
2013-03-03 10:30:39 +08:00
|
|
|
# Exit of first error.
|
|
|
|
set -e
|
|
|
|
|
2013-01-22 17:23:05 +08:00
|
|
|
DEPENDS='libx11-dev'
|
|
|
|
DEPENDS+=' libxmu-dev'
|
|
|
|
DEPENDS+=' libglu1-mesa-dev'
|
|
|
|
DEPENDS+=' libgl2ps-dev'
|
|
|
|
DEPENDS+=' libxi-dev'
|
|
|
|
DEPENDS+=' libglfw-dev'
|
|
|
|
DEPENDS+=' g++'
|
|
|
|
DEPENDS+=' libzip-dev'
|
|
|
|
DEPENDS+=' libcurl4-gnutls-dev'
|
|
|
|
DEPENDS+=' libfontconfig1-dev'
|
|
|
|
DEPENDS+=' libsqlite3-dev'
|
2013-03-03 10:30:39 +08:00
|
|
|
DEPENDS+=' libglew*-dev'
|
2013-01-22 17:23:05 +08:00
|
|
|
|
2013-03-09 00:01:03 +08:00
|
|
|
MISSING=
|
|
|
|
echo "Checking for missing packages ..."
|
2013-01-22 17:23:05 +08:00
|
|
|
for i in $DEPENDS; do
|
2013-03-09 00:01:03 +08:00
|
|
|
if ! dpkg-query -W --showformat='${Status}\n' $i | grep "install ok installed" > /dev/null; then
|
|
|
|
MISSING+=$i
|
2013-03-03 10:30:39 +08:00
|
|
|
fi
|
2013-01-22 17:23:05 +08:00
|
|
|
done
|
2012-08-02 13:02:59 +08:00
|
|
|
|
2013-03-09 00:01:03 +08:00
|
|
|
if [ -n "$MISSING" ]; then
|
|
|
|
TXTCOLOR_DEFAULT="\033[0;m"
|
|
|
|
TXTCOLOR_GREEN="\033[0;32m"
|
|
|
|
echo -e $TXTCOLOR_GREEN"Missing packages: $MISSING.\nYou may be asked for your password for package installation."$TXTCOLOR_DEFAULT
|
|
|
|
sudo apt-get --force-yes --yes install $MISSING
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Change directory to the location of this script
|
|
|
|
cd $(dirname ${BASH_SOURCE[0]})
|
2012-09-26 20:51:41 +08:00
|
|
|
|
2013-03-03 10:30:39 +08:00
|
|
|
export MAKEFLAGS=-j10
|
2012-09-26 20:51:41 +08:00
|
|
|
|
2013-03-03 10:30:39 +08:00
|
|
|
make PROJECT=linux DEBUG=1 clean
|
|
|
|
make PROJECT=linux DEBUG=0 clean
|
2012-09-26 20:51:41 +08:00
|
|
|
|
2013-03-03 10:30:39 +08:00
|
|
|
make PROJECT=linux DEBUG=1 all
|
|
|
|
make PROJECT=linux DEBUG=0 all
|