Back to home page

OSCL-LXR

 
 

    


0001 #!/bin/bash
0002 # SPDX-License-Identifier: GPL-2.0
0003 #
0004 # Kselftest Install
0005 # Install kselftest tests
0006 # Author: Shuah Khan <shuahkh@osg.samsung.com>
0007 # Copyright (C) 2015 Samsung Electronics Co., Ltd.
0008 
0009 main()
0010 {
0011         base_dir=`pwd`
0012         install_dir="$base_dir"/kselftest_install
0013 
0014         # Make sure we're in the selftests top-level directory.
0015         if [ $(basename "$base_dir") !=  "selftests" ]; then
0016                 echo "$0: Please run it in selftests directory ..."
0017                 exit 1;
0018         fi
0019 
0020         # Only allow installation into an existing location.
0021         if [ "$#" -eq 0 ]; then
0022                 echo "$0: Installing in default location - $install_dir ..."
0023         elif [ ! -d "$1" ]; then
0024                 echo "$0: $1 doesn't exist!!"
0025                 exit 1;
0026         else
0027                 install_dir="$1"
0028                 echo "$0: Installing in specified location - $install_dir ..."
0029         fi
0030 
0031         # Build tests
0032         KSFT_INSTALL_PATH="$install_dir" make install
0033 }
0034 
0035 main "$@"