3 [[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return
5 CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6 ROOT_PATH="$CURRENT_PATH/../../"
9 if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then
10 echo "It will use default rootfs path"
12 DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs"
13 DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs"
16 # mount volume (or directory) for externals
17 if [ -n "$EXTERNAL_VOLUME" ]; then
18 DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals"
19 DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals"
21 echo "It will use default external path"
25 if [[ -z $DOCKER_IMAGE_NAME ]]; then
26 echo "It will use default docker image name"
29 # Mirror server setting
30 if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then
31 echo "It will not use mirror server"
34 NNAS_WORKSPACE=${NNAS_WORKSPACE:-build}
35 if [[ -z "${ARCHIVE_PATH}" ]]; then
36 ARCHIVE_PATH=${NNAS_WORKSPACE}/archive
39 DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l"
40 DOCKER_ENV_VARS+=" -e CROSS_BUILD=1"
41 DOCKER_ENV_VARS+=" -e COVERAGE_BUILD=1"
45 pushd $ROOT_PATH > /dev/null
47 # TODO use command instead of makefile
48 export DOCKER_ENV_VARS
50 CMD="cp -nv Makefile.template Makefile && \
51 make all install build_coverage_suite"
52 ./nnfw docker-run bash -c "$CMD"
54 mkdir -p ${ARCHIVE_PATH}
55 # TODO change workspace usage in makefile
56 mv Product/out/coverage-suite.tar.gz ${ARCHIVE_PATH}/