blob: fc330d0b167858664b83f2d4a8893b013c620e98 [file] [log] [blame]
Colin Crosse441b9d2015-01-26 16:30:13 -08001#!/bin/bash
2
3# Determine the build directory location based on the location of this script.
4BPBUILD="${BASH_SOURCE[0]}"
5BUILDDIR=`dirname "${BASH_SOURCE[0]}"`
Colin Crossf7531f12015-03-25 14:09:02 -07006BOOTSTRAP=${BUILDDIR}/.soong.bootstrap
Colin Crosse441b9d2015-01-26 16:30:13 -08007
Colin Crossf7531f12015-03-25 14:09:02 -07008# The source directory path and operating system will get written to
9# .soong.bootstrap by the bootstrap script.
10
11if [ ! -f ${BUILDDIR}/${BOOTSTRAP} ]; then
12 echo "Error: soong script must be located in a directory created by bootstrap.bash"
13 exit 1
14fi
15
16source ${BUILDDIR}/.soong.bootstrap
17
Colin Crosse441b9d2015-01-26 16:30:13 -080018if [[ ${SRCDIR_IN:0:1} == '/' ]]; then
19 # SRCDIR_IN is an absolute path
20 SRCDIR=${SRCDIR_IN}
21else
22 # SRCDIR_IN is a relative path
23 SRCDIR=${BUILDDIR}/${SRCDIR_IN}
24fi
25
Colin Crosse441b9d2015-01-26 16:30:13 -080026# Let Blueprint know that the Ninja we're using performs multiple passes that
27# can regenerate the build manifest.
28export BLUEPRINT_NINJA_HAS_MULTIPASS=1
29
30${SRCDIR}/prebuilts/ninja/${PREBUILTOS}/ninja -C ${BUILDDIR} "$@"