Turn NUM_JOBS into an overridable flag for distcc builds.

BUG=n/a
TEST=n/a

Review URL: http://codereview.chromium.org/425012


git-svn-id: svn://chrome-svn/chromeos/trunk@308 06c00378-0e64-4dae-be16-12b19f9950a1
This commit is contained in:
scherkus@google.com 2009-11-23 22:06:28 +00:00
parent 5fc3fcf15e
commit 588da2dc8b

View File

@ -18,11 +18,17 @@ assert_outside_chroot
# setting CHROMEOS_CHROME_DIR (for example, in ./.chromeos_dev)
DEFAULT_CHROME_DIR="${CHROMEOS_CHROME_DIR:-/home/$USER/chrome}"
# The number of jobs to pass to tools that can run in parallel (such as make
# and dpkg-buildpackage
NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'`
# Flags
DEFINE_string chrome_dir "$DEFAULT_CHROME_DIR" \
"Directory to Chrome source"
DEFINE_string mode "Release" \
"The mode to build Chrome in (Debug or Release)"
DEFINE_string num_jobs "$NUM_JOBS" \
"The number of jobs to run in parallel"
# Parse command line
FLAGS "$@" || exit 1
@ -37,15 +43,12 @@ FLAGS_chrome_dir=`eval readlink -f $FLAGS_chrome_dir`
# Build Chrome
echo Building Chrome in mode $FLAGS_mode
# The number of jobs to pass to tools that can run in parallel (such as make
# and dpkg-buildpackage
NUM_JOBS=`cat /proc/cpuinfo | grep processor | awk '{a++} END {print a}'`
export GYP_GENERATORS="make"
export GYP_DEFINES="chromeos=1 target_arch=ia32"
CHROME_DIR=$FLAGS_chrome_dir
cd "$CHROME_DIR/src"
gclient runhooks --force
make BUILDTYPE=$FLAGS_mode -j$NUM_JOBS -r chrome
make BUILDTYPE=$FLAGS_mode -j$FLAGS_num_jobs -r chrome
# Zip into chrome-chromeos.zip and put in local_assets
BUILD_DIR="$CHROME_DIR/src/out"