#!/bin/bash 
 | 
  
 | 
# this project absolute path 
 | 
PRJ_PATH=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd) 
 | 
  
 | 
SRC="bootloader kernel images" 
 | 
  
 | 
#+-------------------------+ 
 | 
#| Shell script functions  | 
 | 
#+-------------------------+ 
 | 
  
 | 
function pr_error() { 
 | 
    echo -e "\033[40;31m $1 \033[0m" 
 | 
} 
 | 
  
 | 
function pr_warn() { 
 | 
    echo -e "\033[40;33m $1 \033[0m" 
 | 
} 
 | 
  
 | 
function pr_info() { 
 | 
    echo -e "\033[40;32m $1 \033[0m" 
 | 
} 
 | 
  
 | 
if [[ $# == 1 && $1 == -c ]] ;then 
 | 
    pr_warn "start clean BSP project" 
 | 
    task=-c 
 | 
fi 
 | 
  
 | 
for dir in $SRC ; do 
 | 
    if [ ! -x build.sh ] ; then 
 | 
        continue 
 | 
    fi 
 | 
  
 | 
    cd $dir 
 | 
    ./build.sh $task 
 | 
    cd $PRJ_PATH 
 | 
done 
 |