source: flair-dev/trunk/scripts/flair_compile_all.sh@ 95

Last change on this file since 95 was 95, checked in by Sanahuja Guillaume, 4 years ago

add mixed reality demo

  • Property svn:executable set to *
File size: 3.4 KB
RevLine 
[2]1#!/bin/bash
2NB_THREADS=$(nproc)
3from_scratch=no
[43]4IDE_SCRIPT=cmake_codelite.sh
[68]5toolchains=($OECORE_CMAKE_TOOLCHAINS)
[2]6
7function green_echo () {
8 echo -e "\033[32m$1\033[0m"
9}
10
11function red_echo () {
12 echo -e "\033[31m$1\033[0m"
13}
14
15function check_error () {
16 if [ "$?" != "0" ]; then
17 red_echo "Error, exiting"
18 exit 1
19 fi
20}
21
22function sanity_check () {
23 if [ -z $FLAIR_ROOT ]; then
24 red_echo "You must set the FLAIR_ROOT environement variable"
25 exit 1
26 fi
27}
28
29function configure () {
30 if [ "$from_scratch" = "yes" ]; then
31 green_echo "Configuring $1/$2"
32 cd $1/$2
33
[43]34 $FLAIR_ROOT/flair-dev/scripts/$IDE_SCRIPT > /dev/null
[2]35
36 check_error
37 else
38 green_echo "Not configuring $1/$2"
39 fi
40}
41
42function compile () {
[68]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
[2]52}
53
[26]54function compile_libs() {
[44]55 for projects in FlairCore FlairSensorActuator FlairFilter FlairVisionFilter FlairMeta FlairSimulator ; do
[2]56 configure $FLAIR_ROOT/flair-src/lib $projects
[3]57 compile $FLAIR_ROOT/flair-src/lib $projects
[2]58 done
[26]59
60 if [ -d $FLAIR_ROOT/flair-hds ]; then
[71]61 for projects in FlairBebop FlairArdrone2 FlairMinidrones FlairMamboEdu VisionFilter; do
[26]62 configure $FLAIR_ROOT/flair-hds/src/lib $projects
63 compile $FLAIR_ROOT/flair-hds/src/lib $projects
64 done
65 fi
[2]66}
67
[9]68function compile_tools() {
[72]69 for projects in FlairGCS Controller/DualShock3 Controller/Mavlink Dbt2csv VrpnBridge; do
[9]70 configure $FLAIR_ROOT/flair-src/tools $projects
71 compile $FLAIR_ROOT/flair-src/tools $projects
72 done
73}
74
[23]75function compile_uav_and_simulator_demo() {
76 for projects in simulator uav; do
[26]77 configure $1/$2 $projects
78 compile $1/$2 $projects
[23]79 done
80}
81
[9]82function compile_demos() {
[12]83 for projects in Sinus; do
84 configure $FLAIR_ROOT/flair-src/demos $projects
85 compile $FLAIR_ROOT/flair-src/demos $projects
[2]86 done
[14]87
[95]88 for projects in OpticalFlow CircleFollower SimpleFleet Gps PidStandalone MixedReality; do
[26]89 compile_uav_and_simulator_demo $FLAIR_ROOT/flair-src/demos $projects
[14]90 done
91
[27]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
[46]97 if [ -d $FLAIR_ROOT/flair-hds ]; then
[48]98 for projects in ApriltagFollower LineFollower; do
[46]99 compile_uav_and_simulator_demo $FLAIR_ROOT/flair-hds/src/demos $projects
100 done
101 fi
[26]102
[2]103}
104
105sanity_check
106
[46]107if [ -d $FLAIR_ROOT/flair-hds ]; then
108 printf "Found flair-hds repository\n"
109fi
110
[2]111printf "Compile all from scratch [Y/n]?"
112read answer
113
114if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
115 from_scratch=yes
116fi
117
118printf "Compile Flair libs [Y/n]?"
119read answer
120
121if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
[26]122 compile_libs
[2]123fi
[9]124
[14]125printf "Compile Flair libs documentation [Y/n]?"
126read answer
127
128if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
[23]129 $OECORE_HOST_NATIVE_SYSROOT/usr/bin/doxygen $FLAIR_ROOT/flair-src/lib/Doxyfile.in
[14]130fi
131
[2]132printf "Compile Flair tools [Y/n]?"
133read answer
134
135if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
136 compile_tools
137fi
[12]138
139printf "Compile demos [Y/n]?"
140read answer
141
142if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
143 compile_demos
144fi
145
[9]146exit 0
[2]147
148
149
150exit 0
Note: See TracBrowser for help on using the repository browser.