core_launch.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. # Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. # All rights reserved.
  3. #
  4. # This software is supplied "AS IS" without any warranties.
  5. # RDA assumes no responsibility or liability for the use of the software,
  6. # conveys no license or title under any patent, copyright, or mask work
  7. # right to the product. RDA reserves the right to make changes in the
  8. # software without notification. RDA also make no representation or
  9. # warranty that such application will be suitable for the specified use
  10. # without further testing or modification.
  11. export PROJECT_ROOT=$PWD
  12. export BUILD_TARGET=appimage
  13. export BUILD_RELEASE_TYPE=debug
  14. export PROJECT_OUT=$PROJECT_ROOT/out/${BUILD_TARGET}_${BUILD_RELEASE_TYPE}
  15. function remove_from_var
  16. {
  17. local VAR=$1
  18. local VAL="$2"
  19. if test -n "$VAL"; then
  20. export $VAR="$(echo "${!VAR}" | tr ':' '\n' | grep -v "$VAL" | paste -d: -s)"
  21. fi
  22. }
  23. function prepend_var
  24. {
  25. local VAR=$1
  26. local VAL="$2"
  27. if test -n "$VAL"; then
  28. remove_from_var $VAR "$VAL"
  29. if test -n "${!VAR}"; then
  30. export $VAR="$VAL:${!VAR}"
  31. else
  32. export $VAR="$VAL"
  33. fi
  34. fi
  35. }
  36. case `uname` in
  37. Linux)
  38. prepend_var PATH $PROJECT_ROOT/prebuilts/linux/bin
  39. prepend_var PATH $PROJECT_ROOT/prebuilts/linux/cmake/bin
  40. prepend_var PATH $PROJECT_ROOT/prebuilts/linux/gcc-arm-none-eabi/bin
  41. prepend_var PATH $PROJECT_ROOT/tools
  42. prepend_var PATH $PROJECT_ROOT/tools/linux
  43. ;;
  44. *_NT*)
  45. prepend_var PATH $PROJECT_ROOT/prebuilts/win32/bin
  46. prepend_var PATH $PROJECT_ROOT/prebuilts/win32/cmake/bin
  47. prepend_var PATH $PROJECT_ROOT/prebuilts/win32/python3
  48. prepend_var PATH $PROJECT_ROOT/prebuilts/win32/gcc-arm-none-eabi/bin
  49. prepend_var PATH $PROJECT_ROOT/tools
  50. prepend_var PATH $PROJECT_ROOT/tools/win32
  51. ;;
  52. esac
  53. cout() {
  54. mkdir -p $PROJECT_OUT && cd $PROJECT_OUT
  55. }
  56. croot() {
  57. cd $PROJECT_ROOT
  58. }