fbt 870 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. # shellcheck disable=SC2086 source=/dev/null
  3. # unofficial strict mode
  4. set -eu;
  5. # private variables
  6. SCRIPT_PATH="$(cd "$(dirname "$0")" && pwd -P)";
  7. SCONS_DEFAULT_FLAGS="--warn=target-not-built";
  8. SCONS_EP="python3 -m SCons";
  9. # public variables
  10. FBT_NOENV="${FBT_NOENV:-""}";
  11. FBT_NO_SYNC="${FBT_NO_SYNC:-""}";
  12. FBT_TOOLCHAIN_PATH="${FBT_TOOLCHAIN_PATH:-$SCRIPT_PATH}";
  13. FBT_VERBOSE="${FBT_VERBOSE:-""}";
  14. if [ -z "$FBT_NOENV" ]; then
  15. FBT_VERBOSE="$FBT_VERBOSE" . "$SCRIPT_PATH/scripts/toolchain/fbtenv.sh";
  16. fi
  17. if [ -z "$FBT_VERBOSE" ]; then
  18. SCONS_DEFAULT_FLAGS="$SCONS_DEFAULT_FLAGS -Q";
  19. fi
  20. if [ -z "$FBT_NO_SYNC" ]; then
  21. if [ ! -d "$SCRIPT_PATH/.git" ]; then
  22. echo "\".git\" directory not found, please clone repo via \"git clone\"";
  23. exit 1;
  24. fi
  25. git submodule update --init --depth 1;
  26. fi
  27. $SCONS_EP $SCONS_DEFAULT_FLAGS "$@"