Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 1 | #!/bin/bash |
Vitaly Buka | 4615e0d | 2015-10-14 15:35:12 -0700 | [diff] [blame] | 2 | # Copyright 2015 The Weave Authors. All rights reserved. |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
| 6 | DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P) |
Johan Euphrosine | 3523fdd | 2015-10-14 20:46:05 -0700 | [diff] [blame] | 7 | ROOT_DIR=$(cd -P -- "$(dirname -- "$0")/.." && pwd -P) |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 8 | |
| 9 | cd $ROOT_DIR |
| 10 | |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 11 | gyp -Ilibweave_common.gypi --toplevel-dir=. --depth=. -f make $DIR/daemon/examples.gyp |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 12 | |
| 13 | if [ -z "$BUILD_CONFIG" ]; then |
| 14 | export BUILD_CONFIG=Debug |
| 15 | fi |
| 16 | |
| 17 | export BUILD_TARGET=$* |
| 18 | if [ -z "$BUILD_TARGET" ]; then |
Johan Euphrosine | 3fb474e | 2015-10-29 15:23:53 -0700 | [diff] [blame] | 19 | export BUILD_TARGET="weave_daemon_examples libweave_testrunner libweave_exports_testrunner" |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 20 | fi |
| 21 | |
| 22 | export CORES=`cat /proc/cpuinfo | grep processor | wc -l` |
Vitaly Buka | 9e9aca9 | 2015-11-23 23:20:12 -0800 | [diff] [blame] | 23 | BUILDTYPE=$BUILD_CONFIG make -j $CORES $BUILD_TARGET || exit 1 |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 24 | |
| 25 | if [[ $BUILD_TARGET == *"libweave_testrunner"* ]]; then |
Vitaly Buka | 3110deb | 2015-10-06 19:54:09 -0700 | [diff] [blame] | 26 | out/${BUILD_CONFIG}/libweave_testrunner --gtest_break_on_failure || exit 1 |
| 27 | out/${BUILD_CONFIG}/libweave_exports_testrunner --gtest_break_on_failure || exit 1 |
Vitaly Buka | dd3b58a | 2015-09-02 13:29:58 -0700 | [diff] [blame] | 28 | fi |