| .. | .. |
|---|
| 6 | 6 | # Author: Shuah Khan <shuahkh@osg.samsung.com> |
|---|
| 7 | 7 | # Copyright (C) 2015 Samsung Electronics Co., Ltd. |
|---|
| 8 | 8 | |
|---|
| 9 | | -install_loc=`pwd` |
|---|
| 10 | | - |
|---|
| 11 | 9 | main() |
|---|
| 12 | 10 | { |
|---|
| 13 | | - if [ $(basename $install_loc) != "selftests" ]; then |
|---|
| 11 | + base_dir=`pwd` |
|---|
| 12 | + install_dir="$base_dir"/kselftest_install |
|---|
| 13 | + |
|---|
| 14 | + # Make sure we're in the selftests top-level directory. |
|---|
| 15 | + if [ $(basename "$base_dir") != "selftests" ]; then |
|---|
| 14 | 16 | echo "$0: Please run it in selftests directory ..." |
|---|
| 15 | 17 | exit 1; |
|---|
| 16 | 18 | fi |
|---|
| 19 | + |
|---|
| 20 | + # Only allow installation into an existing location. |
|---|
| 17 | 21 | if [ "$#" -eq 0 ]; then |
|---|
| 18 | | - echo "$0: Installing in default location - $install_loc ..." |
|---|
| 22 | + echo "$0: Installing in default location - $install_dir ..." |
|---|
| 19 | 23 | elif [ ! -d "$1" ]; then |
|---|
| 20 | 24 | echo "$0: $1 doesn't exist!!" |
|---|
| 21 | 25 | exit 1; |
|---|
| 22 | 26 | else |
|---|
| 23 | | - install_loc=$1 |
|---|
| 24 | | - echo "$0: Installing in specified location - $install_loc ..." |
|---|
| 27 | + install_dir="$1" |
|---|
| 28 | + echo "$0: Installing in specified location - $install_dir ..." |
|---|
| 25 | 29 | fi |
|---|
| 26 | 30 | |
|---|
| 27 | | - install_dir=$install_loc/kselftest |
|---|
| 28 | | - |
|---|
| 29 | | -# Create install directory |
|---|
| 30 | | - mkdir -p $install_dir |
|---|
| 31 | | -# Build tests |
|---|
| 32 | | - INSTALL_PATH=$install_dir make install |
|---|
| 31 | + # Build tests |
|---|
| 32 | + KSFT_INSTALL_PATH="$install_dir" make install |
|---|
| 33 | 33 | } |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | main "$@" |
|---|