osquery-1/tools/build.sh

38 lines
704 B
Bash
Raw Normal View History

2014-09-25 08:45:13 +00:00
#!/usr/bin/env bash
# Copyright (c) 2014, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
2014-09-25 08:45:13 +00:00
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
2014-10-03 17:23:17 +00:00
source $SCRIPT_DIR/lib.sh
2014-09-25 08:45:13 +00:00
threads THREADS
cd $SCRIPT_DIR/../
2014-11-20 00:23:25 +00:00
# Builds dependencies
2014-09-25 08:45:13 +00:00
make deps
2014-12-08 22:19:34 +00:00
make clean
2014-11-20 00:23:25 +00:00
2014-11-20 00:33:33 +00:00
# Build osquery
2014-09-25 08:45:13 +00:00
make -j$THREADS
2014-11-20 00:33:33 +00:00
# Build osquery kernel
make kernel-build
make kernel-load
# Run code unit and integration tests
2014-09-25 08:45:13 +00:00
make test
make kernel-test
# Cleanup kernel
make kernel-unload || sudo reboot