2013-03-02 01:09:58 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# Build script to build all components for Native Client.
|
|
|
|
#
|
2013-05-07 04:27:13 +08:00
|
|
|
# By default this script will build the 'all' target in
|
|
|
|
# both debug and release configurations. Pass "clean" to
|
|
|
|
# clean all configuration.
|
2013-03-02 01:09:58 +08:00
|
|
|
#
|
|
|
|
# Before running this script you need to set NACL_SDK_ROOT
|
|
|
|
# and add the NaCl compiler bin folder to your path.
|
|
|
|
#
|
|
|
|
# There are several libraries from naclports that are
|
2013-03-06 07:50:51 +08:00
|
|
|
# prerequisite for building cocos2dx on NaCl. These ship
|
|
|
|
# with recent versions of the NaCl SDK or you can build
|
|
|
|
# them yourself by checking out naclports and running:
|
2013-03-02 01:09:58 +08:00
|
|
|
# $ make png tiff freetype xml2 freealut jpeg vorbis ogg
|
|
|
|
|
|
|
|
if [ -z "$NACL_SDK_ROOT" ]; then
|
|
|
|
echo "Please set \$NACL_SDK_ROOT"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
SCRIPT_DIR=$(dirname ${BASH_SOURCE})
|
|
|
|
OUTPUT_DEBUG=lib/nacl/Debug/
|
|
|
|
OUTPUT_RELEASE=lib/nacl/Release/
|
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
cd $SCRIPT_DIR
|
|
|
|
|
|
|
|
mkdir -p $OUTPUT_DEBUG
|
|
|
|
mkdir -p $OUTPUT_RELEASE
|
|
|
|
|
2013-03-05 02:19:50 +08:00
|
|
|
export MAKEFLAGS="-j10 PLATFORM=nacl"
|
2013-03-02 01:09:58 +08:00
|
|
|
|
2013-05-03 03:59:16 +08:00
|
|
|
make NACL_ARCH=x86_64 DEBUG=1 $*
|
|
|
|
make NACL_ARCH=x86_64 DEBUG=0 $*
|
2013-04-27 02:25:02 +08:00
|
|
|
|
2013-05-03 03:59:16 +08:00
|
|
|
make NACL_ARCH=i686 DEBUG=1 $*
|
|
|
|
make NACL_ARCH=i686 DEBUG=0 $*
|
2013-04-27 02:25:02 +08:00
|
|
|
|
2013-05-03 03:59:16 +08:00
|
|
|
if [ "${NACL_GLIBC:-}" != "1" ]; then
|
|
|
|
make NACL_ARCH=arm DEBUG=1 $*
|
|
|
|
make NACL_ARCH=arm DEBUG=0 $*
|
|
|
|
fi
|