You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.sh 2.3KB

3 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #!/bin/bash
  2. BuildType=Release
  3. BuildOption=--release
  4. base_dir=$(dirname "$(readlink -f "$0")")
  5. work_dir=`pwd`
  6. build_dir_base="${work_dir}/build"
  7. install_dir_base="${work_dir}/dist"
  8. dependencies_dir="${work_dir}/dependencies"
  9. user_data_subdir="openvibe-3.1.0"
  10. while [[ $# -gt 0 ]]; do
  11. key="$1"
  12. case $key in
  13. -h | --help)
  14. echo "-d | --debug : build as debug"
  15. echo "-r | --release : build as release"
  16. echo "--build-dir <dirname> : directory for build files"
  17. echo "--install-dir <dirname> : binaries deployment directory"
  18. exit
  19. ;;
  20. -d | --debug)
  21. BuildType=Debug
  22. BuildOption=--debug
  23. ;;
  24. -r | --release)
  25. BuildType=Release
  26. BuildOption=--release
  27. ;;
  28. --build-dir)
  29. build_dir_base="$2"
  30. shift
  31. ;;
  32. --install-dir)
  33. install_dir_base="$2"
  34. shift
  35. ;;
  36. --userdata-subdir)
  37. user_data_subdir="$2"
  38. shift
  39. ;;
  40. --dependencies-dir)
  41. dependencies_dir="$2"
  42. shift
  43. ;;
  44. *)
  45. echo "ERROR: Unknown parameter $i"
  46. exit 1
  47. ;;
  48. esac
  49. shift
  50. done
  51. if [[ ! -z ${dependencies_dir} ]]
  52. then
  53. source ${base_dir}/sdk/scripts/unix-init-env.sh --dependencies-dir ${dependencies_dir}
  54. else
  55. echo "dependencies_dir not set: not initialisaing environment"
  56. fi
  57. echo Building sdk
  58. cd ${base_dir}/sdk/scripts
  59. ./unix-build --build-type ${BuildType} --build-dir ${build_dir_base}/sdk-${BuildType} --install-dir ${install_dir_base}/sdk-${BuildType} --dependencies-dir ${dependencies_dir} --userdata-subdir ${user_data_subdir} --build-unit --build-validation --test-data-dir ${dependencies_dir}/test-input
  60. if [[ ! $? -eq 0 ]]; then
  61. echo "Error while building sdk"
  62. exit 1
  63. fi
  64. echo Building designer
  65. cd ${base_dir}/designer/scripts
  66. ./unix-build --build-type=${BuildType} --build-dir=${build_dir_base}/designer-${BuildType} --install-dir=${install_dir_base}/designer-${BuildType} --sdk=${install_dir_base}/sdk-${BuildType} --userdata-subdir=${user_data_subdir}
  67. if [[ ! $? -eq 0 ]]; then
  68. echo "Error while building designer"
  69. exit 1
  70. fi
  71. echo Building extras
  72. cd ${base_dir}/extras/scripts
  73. ./linux-build ${BuildOption} --build-dir ${build_dir_base}/extras-${BuildType} --install-dir ${install_dir_base}/extras-${BuildType} --sdk ${install_dir_base}/sdk-${BuildType} --designer ${install_dir_base}/designer-${BuildType} --dependencies-dir ${dependencies_dir} --userdata-subdir ${user_data_subdir}
  74. if [[ ! $? -eq 0 ]]; then
  75. echo "Error while building extras"
  76. exit 1
  77. fi