| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 | #!/bin/bashset -eo pipefailSUCCESS_TXT="${GREEN}[SUCCESS]${NC}"src_file=$1exe_file=$(basename "${src_file%.*}")if [[ -z "$MACHINE" ]]; then  echo "Must provide MACHINE for compile"  exit 1fiif [[ "$MACHINE" == "Windows" ]]; then  exe_file=$(basename "${src_file%.*}".exe)fiif [[ -z "$src_file" ]]; then  echo "Must provide \$1 for compile"  exit 1fiif [[ -z "$CPP_INCLUDE_DIR" ]]; then  echo "Must provide CPP_INCLUDE_DIR in environment"  exit 1fiif [[ -z "$CPP" ]]; then  echo "Must provide CPP in environment"  exit 1firm -f "$exe_file"EXTRA_ARGS=""if [[ "$CPP" == "cl.exe" ]]; then  echo "Compiling $src_file, running:" "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O2" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"  "$CPP" "$CPP_STANDARD" "-F268435456" "-EHsc" "-O2" -I"${CPP_INCLUDE_DIR}" -Fe"$exe_file" "$src_file"else  "$CPP" --version  dir=$(dirname "$CPP")  if [[ "$dir" == *"/bin" ]] || [[ "$MACHINE" == "Windows" ]]; then    EXTRA_ARGS="${EXTRA_ARGS} -static"  fi  echo "Compiling $src_file, running:" "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" -O2 "$src_file"  eval "$CPP" "$CPP_OPTS" "$CPP_STANDARD" -Wpedantic -Werror -I"${CPP_INCLUDE_DIR}""$EXTRA_ARGS" -o"$exe_file" -O2 "$src_file"firm -f ./*.o ./*.objif [ ! -f "$exe_file" ]; then  echo "Compilation failed: file $exe_file not found"  exit 1fiecho -e "${SUCCESS_TXT} $src_file compiled\n"if [[ "$2" == "--check-only" ]]; then  rm -rf "$exe_file"fi
 |