blob: 262c56befa08b33e3d756659b71d61299aa3e722 [file] [log] [blame]
Vitaly Bukadd3b58a2015-09-02 13:29:58 -07001#!/bin/bash
Vitaly Buka4615e0d2015-10-14 15:35:12 -07002# Copyright 2015 The Weave Authors. All rights reserved.
Vitaly Bukadd3b58a2015-09-02 13:29:58 -07003# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6DIR=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
Johan Euphrosine3523fdd2015-10-14 20:46:05 -07007ROOT_DIR=$(cd -P -- "$(dirname -- "$0")/.." && pwd -P)
Vitaly Bukadd3b58a2015-09-02 13:29:58 -07008
9cd $ROOT_DIR
10
Vitaly Buka9e9aca92015-11-23 23:20:12 -080011gyp -Ilibweave_common.gypi --toplevel-dir=. --depth=. -f make $DIR/daemon/examples.gyp
Vitaly Bukadd3b58a2015-09-02 13:29:58 -070012
13if [ -z "$BUILD_CONFIG" ]; then
14 export BUILD_CONFIG=Debug
15fi
16
17export BUILD_TARGET=$*
18if [ -z "$BUILD_TARGET" ]; then
Johan Euphrosine3fb474e2015-10-29 15:23:53 -070019 export BUILD_TARGET="weave_daemon_examples libweave_testrunner libweave_exports_testrunner"
Vitaly Bukadd3b58a2015-09-02 13:29:58 -070020fi
21
22export CORES=`cat /proc/cpuinfo | grep processor | wc -l`
Vitaly Buka9e9aca92015-11-23 23:20:12 -080023BUILDTYPE=$BUILD_CONFIG make -j $CORES $BUILD_TARGET || exit 1
Vitaly Bukadd3b58a2015-09-02 13:29:58 -070024
25if [[ $BUILD_TARGET == *"libweave_testrunner"* ]]; then
Vitaly Buka3110deb2015-10-06 19:54:09 -070026 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 Bukadd3b58a2015-09-02 13:29:58 -070028fi