2013-03-21 15:49:47 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2013-07-18 05:11:10 +00:00
|
|
|
UNAME=`uname`
|
2013-03-21 15:49:47 +00:00
|
|
|
MASTER_DIR=`dirname $0`
|
2013-07-18 05:11:10 +00:00
|
|
|
BUILD_DEFAULT="release"
|
|
|
|
|
2013-03-21 15:49:47 +00:00
|
|
|
cd ${MASTER_DIR}
|
|
|
|
|
2014-08-28 08:13:38 +00:00
|
|
|
if [ "${OPTIONS}" == "all_options" ];
|
2013-03-21 15:49:47 +00:00
|
|
|
then
|
2014-08-27 15:48:55 +00:00
|
|
|
export USE_CODEC_VORBIS=1
|
|
|
|
export USE_FREETYPE=1
|
2013-03-21 15:49:47 +00:00
|
|
|
fi
|
|
|
|
|
2013-07-18 05:11:10 +00:00
|
|
|
if [ "$UNAME" == "Darwin" ]; then
|
|
|
|
CORES=`sysctl -n hw.ncpu`
|
|
|
|
elif [ "$UNAME" == "Linux" ]; then
|
|
|
|
CORES=`awk '/^processor/ { N++} END { print N }' /proc/cpuinfo`
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "platform : ${UNAME}"
|
|
|
|
echo "cores : ${CORES}"
|
|
|
|
if [ "${BUILD_TYPE}" == "" ]; then
|
|
|
|
BUILD_TYPE="${BUILD_DEFAULT}"
|
|
|
|
echo "build type : defaulting to ${BUILD_TYPE}"
|
|
|
|
else
|
|
|
|
echo "build type : ${BUILD_TYPE}"
|
|
|
|
fi
|
2013-03-21 15:49:47 +00:00
|
|
|
|
2014-08-27 16:28:32 +00:00
|
|
|
echo "environment :"
|
|
|
|
export
|
|
|
|
|
2014-08-27 15:48:55 +00:00
|
|
|
if [ -n "${CPPCHECK}" ]; then
|
2014-08-27 16:13:27 +00:00
|
|
|
if [ ! -f "${CPPCHECK}" ]; then
|
|
|
|
command -v cppcheck >/dev/null
|
2014-08-27 15:48:55 +00:00
|
|
|
if [ "$?" != "0" ]; then
|
|
|
|
echo "cppcheck not installed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2014-08-27 16:13:27 +00:00
|
|
|
cppcheck --enable=all --max-configs=1 --xml --xml-version=2 code 2> ${CPPCHECK}
|
2014-08-27 15:48:55 +00:00
|
|
|
fi
|
2014-08-27 16:13:27 +00:00
|
|
|
|
2014-08-27 21:55:16 +00:00
|
|
|
ln -sf ${CPPCHECK} cppcheck.xml
|
2014-08-27 15:48:55 +00:00
|
|
|
fi
|
|
|
|
|
2014-08-28 08:13:38 +00:00
|
|
|
# Bit of a hack; only run scan-build with clang and all options enabled
|
|
|
|
if [ "${CC}" == "clang" ] && [ "${OPTIONS}" == "all_options" ]; then
|
2014-08-27 21:55:16 +00:00
|
|
|
MAKE_PREFIX="scan-build"
|
|
|
|
fi
|
|
|
|
|
|
|
|
${MAKE_PREFIX} make -j${CORES} distclean ${BUILD_TYPE}
|
2013-03-21 15:49:47 +00:00
|
|
|
|
2013-03-22 13:49:50 +00:00
|
|
|
exit $?
|