Revision d5a2a7ce

View differences:

tools/ide/QtCreator/QtCreatorSetup.sh
62 62
#
63 63
function printHelp {
64 64
  printInfo "printing help text\n"
65
  printf "usage:    $(basename ${BASH_SOURCE[0]}) [-h|--help] [--module=<module>] [-a|--all] [-c|--clean] [-w|--wipe] [-q|--quit] [--log=<file>]\n"
65
  printf "usage:    $(basename ${BASH_SOURCE[0]}) [-h|--help] [-m|--module=<module>] [-a|--all] [-c|--clean] [-w|--wipe] [-q|--quit] [--log=<file>]\n"
66 66
  printf "\n"
67 67
  printf "options:  -h, --help\n"
68 68
  printf "              Print this help text.\n"
69
  printf "          --module=<module>\n"
69
  printf "          -m, --module <module>\n"
70 70
  printf "              Create project for a single module.\n"
71 71
  printf "          -a, --all\n"
72 72
  printf "              Create projects for all modules.\n"
......
108 108
#            -1
109 109
#                 Error: Command 'arm-none-eabi-gcc' not found.
110 110
#            -2
111
#                 Error: include directory could not be resolved
111
#                 Error: include directory could not be resolved.
112 112
#
113 113
function retrieveGccIncludeDir {
114 114
  # retrieve binary path or link
......
355 355
          fi
356 356
          sourcefiles[${#sourcefiles[@]}]="$sourcefile"
357 357
        # whenever the next source file is processed, a message appears like:
358
        # Compining <filnemame>
358
        # Compiling <filename>
359 359
        elif [[ "$line" =~ ^\+\+\+[[:blank:]]Compiling[[:blank:]]\[(.+\.c)\]$ ]]; then
360 360
          printf "."
361 361
          sourcefile=${BASH_REMATCH[1]}
......
384 384
  # sort and remove duplicates
385 385
  IFS=$'\n'; includes=($(sort --unique <<< "${includes[*]}")); unset IFS
386 386

  
387
  # generate the .files file, containing all source files
387
  # generate the .incldues file, containing all include paths
388 388
  echo "" > ${projectdir}/${module}.includes
389 389
  for inc in ${includes[*]}; do
390 390
    echo "$inc" >> ${projectdir}/${module}.includes
391 391
  done
392
  # generate the .incldues file, containing all include paths
392
  # generate the .files file, containing all source files
393 393
  echo "" > ${projectdir}/${module}.files
394 394
  for source in ${sourcefiles[*]}; do
395 395
    # skip GCC files
......
445 445
#
446 446
function createAllProjects {
447 447
  local modules=("${!1}")
448
  local projectdir=""
448
  local projectsdir=""
449 449
  local gccincludedir=""
450 450
  local outvar=""
451 451
  local gccoutvar=""
......
456 456
    if ( parseIsOption $1 ); then
457 457
      case "$1" in
458 458
        -p=*|--path=*)
459
          projectdir=$(realpath "${1#*=}"); shift 1;;
459
          projectsdir=$(realpath "${1#*=}"); shift 1;;
460 460
        -p|--path)
461
          projectdir=$(realpath "$2"); shift 2;;
461
          projectsdir=$(realpath "$2"); shift 2;;
462 462
        --gcc=*)
463 463
          gccincludedir=$(realpath "${1#*=}"); shift 1;;
464 464
        --gcc)
......
487 487
  fi
488 488

  
489 489
  # read absolute project directory if required
490
  if [ -z "$projectdir" ]; then
491
    getProjectDir projectdir
490
  if [ -z "$projectsdir" ]; then
491
    getProjectDir projectsdir
492 492
  fi
493 493

  
494 494
  # check for existing project files
495
  local projectfiles=()
495
  local projectfiles=""
496 496
  for module in ${modules[@]}; do
497
    local pfiles="$(find ${projectdir} -maxdepth 1 -type f | grep -E "${module}\.(includes|files|config|creator)$")"
498
    IFS=$'\n'; pfiles=($pfiles); unset IFS
499
    projectfiles=( ${projectfiles[*]} ${pfiles[*]} )
497
    projectfiles+="$(find ${projectsdir} -maxdepth 1 -type f | grep -E "${module}\.(includes|files|config|creator)$")"
500 498
  done
499
  IFS=$'\n'; projectfiles=($projectfiles); unset IFS
501 500
  if [ ! -z "${projectfiles[*]}" ]; then
502 501
    printWarning "The following files will be removed:\n"
503 502
    for pfile in ${projectfiles[@]}; do
......
538 537
    if [ $retval != 0 ]; then
539 538
      printf "\n"
540 539
    fi
541
    createModuleProject modules[@] --module="$module" --path="$projectdir" --gcc="$gccincludedir"
540
    createModuleProject modules[@] --module="$module" --path="$projectsdir" --gcc="$gccincludedir"
542 541
    retval=$?
543 542
  done
544 543

  
......
633 632
}
634 633

  
635 634
### main function of this script ###############################################
636
# Creates, deletes and wipes QtCreator project files for the three AMiRo base modules.
635
# Creates, deletes and wipes QtCreator project files for any module supported by AMiRo-OS.
637 636
#
638 637
# usage:      see function printHelp
639 638
# arguments:  see function printHelp

Also available in: Unified diff