Changeset 99 in flair-dev for trunk/scripts/flair_compile_all.sh


Ignore:
Timestamp:
01/31/19 11:06:22 (5 years ago)
Author:
Sanahuja Guillaume
Message:

maj scripts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/scripts/flair_compile_all.sh

    r96 r99  
    22NB_THREADS=$(nproc)
    33from_scratch=no
    4 IDE_SCRIPT=cmake_codelite.sh
     4IDE_SCRIPT=cmake_codelite_outofsource.sh
    55toolchains=($OECORE_CMAKE_TOOLCHAINS)
    66
     
    2525                exit 1
    2626        fi
    27 }
    2827
    29 function configure () {
    30         if [ "$from_scratch" = "yes" ]; then
    31                 green_echo "Configuring $1/$2"
    32                 cd $1/$2
    33 
    34                 $FLAIR_ROOT/flair-dev/scripts/$IDE_SCRIPT > /dev/null
    35        
    36                 check_error
    37         else
    38                 green_echo "Not configuring $1/$2"
     28    if ! [ -d $FLAIR_ROOT/flair-buil ]; then
     29                green_echo "Creating $FLAIR_ROOT/flair-build directory"
     30        mkdir -p $FLAIR_ROOT/flair-buil
    3931        fi
    4032}
    4133
    42 function compile () {
    43     #iterate over available toolchains
    44     for arch in ${toolchains[@]}; do
    45         green_echo "Compiling and installing $2 for $arch"
    46         cd $1/$2/build_$arch
    47             if [ "$from_scratch" = "yes" ]; then make clean > /dev/null; fi
    48             make -j$NB_THREADS > /dev/null
    49             check_error
    50             make install
    51     done
    52 }
    53 
    54 function compile_libs() {
    55         for projects in FlairCore FlairSensorActuator FlairFilter FlairVisionFilter FlairMeta FlairSimulator ; do
    56                 configure $FLAIR_ROOT/flair-src/lib $projects
    57                 compile $FLAIR_ROOT/flair-src/lib $projects
    58         done
    59 
    60         if [ -d $FLAIR_ROOT/flair-hds ]; then
    61                 for projects in FlairBebop FlairArdrone2 FlairMinidrones FlairMamboEdu VisionFilter; do
    62                         configure $FLAIR_ROOT/flair-hds/src/lib $projects
    63                         compile $FLAIR_ROOT/flair-hds/src/lib $projects
    64                 done
    65         fi
    66 }
    67 
    68 function compile_tools() {
    69         for projects in FlairGCS Controller/DualShock3 Controller/Mavlink Dbt2csv VrpnBridge; do
    70                 configure $FLAIR_ROOT/flair-src/tools $projects
    71                 compile $FLAIR_ROOT/flair-src/tools $projects
    72         done
    73 }
    74 
    75 function compile_uav_and_simulator_demo() {
    76         for projects in simulator uav; do
    77                 configure $1/$2 $projects
    78                 compile $1/$2 $projects
    79         done
    80 }
    81 
    82 function compile_demos() {
    83         for projects in Sinus; do
    84                 configure $FLAIR_ROOT/flair-src/demos $projects
    85                 compile $FLAIR_ROOT/flair-src/demos $projects
    86         done
    87 
    88         for projects in OpticalFlow CircleFollower SimpleFleet Gps PidStandalone MixedReality/real MixedReality/virtual; do
    89                 compile_uav_and_simulator_demo $FLAIR_ROOT/flair-src/demos $projects
    90         done
    91 
    92         for projects in CustomReferenceAngles CustomTorques; do
    93                 configure $FLAIR_ROOT/flair-src/demos/Skeletons $projects
    94                 compile $FLAIR_ROOT/flair-src/demos/Skeletons $projects
    95         done
    96 
    97         if [ -d $FLAIR_ROOT/flair-hds ]; then
    98                 for projects in ApriltagFollower LineFollower; do
    99                         compile_uav_and_simulator_demo $FLAIR_ROOT/flair-hds/src/demos $projects
    100                 done
    101         fi
    102        
    103 }
    10434
    10535sanity_check
    10636
    107 if [ -d $FLAIR_ROOT/flair-hds ]; then
    108         printf "Found flair-hds repository\n"
    109 fi
    110 
    111 printf "Compile all from scratch [Y/n]?"
     37printf "Compile all from scratch (flair-build directory will be erased) [Y/n]?"
    11238read answer
    11339
    11440if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
    115         from_scratch=yes
     41        rm -rf $FLAIR_ROOT/flair-build/*
     42    cd $FLAIR_ROOT/flair-build
     43    $FLAIR_ROOT/flair-dev/scripts/$IDE_SCRIPT $FLAIR_ROOT/flair-src/
    11644fi
    11745
    118 printf "Compile Flair libs [Y/n]?"
    119 read answer
     46#iterate over available toolchains
     47for arch in ${toolchains[@]}; do
     48    green_echo "Compiling and installing for $arch"
     49    cd $FLAIR_ROOT/flair-build/build_$arch
     50    make -j$NB_THREADS
     51    check_error
     52    make install
     53done
    12054
    121 if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
    122         compile_libs
    123 fi
    12455
    12556printf "Compile Flair libs documentation [Y/n]?"
     
    13061fi
    13162
    132 printf "Compile Flair tools [Y/n]?"
    133 read answer
    134 
    135 if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
    136         compile_tools
    137 fi
    138 
    139 printf "Compile demos [Y/n]?"
    140 read answer
    141 
    142 if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
    143         compile_demos
    144 fi
    14563
    14664exit 0
    147 
    148 
    149 
    150 exit 0
Note: See TracChangeset for help on using the changeset viewer.