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

Last change on this file since 111 was 101, checked in by Sanahuja Guillaume, 3 years ago

typo

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