source: flair-src/branches/sanscv/scripts/flair_compile_all.sh@ 467

Last change on this file since 467 was 324, checked in by Sanahuja Guillaume, 5 years ago

removing opencv dependency

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2NB_THREADS=$(nproc)
3from_scratch=no
4IDE_SCRIPT=cmake_codelite_outofsource.sh
5toolchains=($OECORE_CMAKE_TOOLCHAINS)
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 if ! [ -d $FLAIR_ROOT/flair-build ]; then
29 green_echo "Creating $FLAIR_ROOT/flair-build directory"
30 mkdir -p $FLAIR_ROOT/flair-build
31 fi
32}
33
34
35sanity_check
36
37printf "Compile all from scratch (flair-build directory will be erased) [Y/n]?"
38read answer
39
40if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
41 rm -rf $FLAIR_ROOT/flair-build/*
42 cd $FLAIR_ROOT/flair-build
43 $FLAIR_ROOT/flair-src/scripts/$IDE_SCRIPT $FLAIR_ROOT/flair-src/
44fi
45
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
54
55
56printf "Compile Flair libs documentation [Y/n]?"
57read answer
58
59if [ "$answer" = "" ] || [ "$answer" = "y" ] || [ "$answer" = "Y" ]; then
60 $OECORE_HOST_NATIVE_SYSROOT/usr/bin/doxygen $FLAIR_ROOT/flair-src/lib/Doxyfile.in
61fi
62
63
64exit 0
Note: See TracBrowser for help on using the repository browser.