Revision c28a90e7

View differences:

tools/ide/QtCreator/QtCreatorSetup.sh
562 562
  local amiroosrootdir=$(realpath $(dirname ${BASH_SOURCE[0]})/../../..)
563 563
  local sourcefiles=()
564 564
  local sourcefile=""
565
  local capture_state="WAIT_FOR_INCLUDE_OR_COMPILING"
565
  local parse_state="WAIT_FOR_INCLUDE_OR_COMPILE"
566 566
  # capture all output from make and GCC and append the return value of make as last line
567 567
  printInfo "processing project (this may take a while)...\n"
568
  local rawout=$(make --directory ${amiroosrootdir}/modules/${module} --always-make USE_OPT="-v -E -H" OUTFILES="" 2>&1 && echo $?)
568
  local rawout=$(make --directory ${amiroosrootdir}/modules/${module} --always-make USE_OPT="-v -E -H" OUTFILES="" --jobs="$(nproc --all)" 2>&1 && echo $?)
569 569
  # check whether the make call was successfull
570 570
  if [[ $(echo "${rawout}" | tail -n 1) != "0" ]]; then
571 571
    printError "executing 'make' in module directory failed\n"
......
573 573
    return -3
574 574
  fi
575 575
  # extract file names from raw output
576
  while read line; do
577
    case $capture_state in
578
      WAIT_FOR_INCLUDE_OR_COMPILING)
576
  IFS=$'\n'; rawout=($rawout); unset IFS
577
  for line in "${rawout[@]}"; do
578
    case $parse_state in
579
      WAIT_FOR_INCLUDE_OR_COMPILE)
579 580
        # lines stating included files look like:
580 581
        # ... <../relative/path/to/file>
581 582
        if [[ "$line" =~ ^\.+[[:blank:]].+\..+$ ]]; then
......
601 602
          capture_state="WAIT_FOR_INCLUDE_OR_COMPILING"
602 603
        fi;;
603 604
    esac
604
  done <<< "${rawout}"
605
  done
605 606
  unset rawout
606 607
  printf "\n"
607 608
  # sort and remove duplicates

Also available in: Unified diff