fbt 940 B

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