blob: 65a2329ba2448a33d70db633b5ea9d1d022105a9 [file] [log] [blame]
Dan Albert65780b22016-10-19 14:17:19 -07001#!/bin/bash -ex
2
3if [ -z "${OUT_DIR}" ]; then
4 echo Must set OUT_DIR
5 exit 1
6fi
7
8TOP=$(pwd)
9
Colin Cross9fe6ea82016-11-09 13:00:16 -080010source build/envsetup.sh
11PLATFORM_SDK_VERSION=$(get_build_var PLATFORM_SDK_VERSION)
12
Dan Albert65780b22016-10-19 14:17:19 -070013SOONG_OUT=${OUT_DIR}/soong
14SOONG_NDK_OUT=${OUT_DIR}/soong/ndk
15rm -rf ${SOONG_OUT}
16mkdir -p ${SOONG_OUT}
17cat > ${SOONG_OUT}/soong.config << EOF
18{
Colin Cross9fe6ea82016-11-09 13:00:16 -080019 "Ndk_abis": true,
20 "Platform_sdk_version": ${PLATFORM_SDK_VERSION}
Dan Albert65780b22016-10-19 14:17:19 -070021}
22EOF
23BUILDDIR=${SOONG_OUT} ./bootstrap.bash
24${SOONG_OUT}/soong ${SOONG_OUT}/ndk.timestamp
25
26if [ -n "${DIST_DIR}" ]; then
27 mkdir -p ${DIST_DIR} || true
28 tar cjf ${DIST_DIR}/ndk_platform.tar.bz2 -C ${SOONG_OUT} ndk
29fi