From 0cbd8d5295b862f60a12e888a0218ae2329f6adb Mon Sep 17 00:00:00 2001 From: guowenxue <guowenxue@gmail.com> Date: Wed, 22 May 2024 17:44:49 +0800 Subject: [PATCH] Add top build shell script --- build.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..f6dc1c9 --- /dev/null +++ b/build.sh @@ -0,0 +1,38 @@ +#!/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 + -- Gitblit v1.9.1