Skip to content

Commit

Permalink
revise build.sh with updated help message
Browse files Browse the repository at this point in the history
This patch revises build.sh using only one target argument.
It also synchronizes help message with code.
  • Loading branch information
yf13 committed Mar 1, 2024
1 parent e579d9f commit ae07e67
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ function cleanup_build() {
}

function usage() {
echo "Usage: $0 build/clean"
echo "Usage: $0 <target>\n"
echo "Here <target> can be: linux, opensbi, uboot, rootfs, img, linux_opensbi_uboot, all or clean."
}

function fault() {
Expand All @@ -141,34 +142,31 @@ function fault() {
}

function main() {
echo $#
if [[ $# < 1 ]]; then
fault
fi

if [ "$1" = "build" ]; then
if [ "$2" = "linux" ]; then
build_linux
elif [ "$2" = "opensbi" ]; then
build_opensbi
elif [ "$2" = "uboot" ]; then
build_uboot
elif [ "$2" = "rootfs" ]; then
build_rootfs
elif [ "$2" = "img" ]; then
build_img
elif [ "$2" = "linux_opensbi_uboot" ]; then
build_linux
build_opensbi
build_uboot
elif [ "$2" = "all" ]; then
build_linux
build_opensbi
build_uboot
build_rootfs
build_img
else
fault
fi
if [ "$1" = "linux" ]; then
build_linux
elif [ "$1" = "opensbi" ]; then
build_opensbi
elif [ "$1" = "uboot" ]; then
build_uboot
elif [ "$1" = "rootfs" ]; then
build_rootfs
elif [ "$1" = "img" ]; then
build_img
elif [ "$1" = "linux_opensbi_uboot" ]; then
build_linux
build_opensbi
build_uboot
elif [ "$1" = "all" ]; then
build_linux
build_opensbi
build_uboot
build_rootfs
build_img
elif [ "$1" = "clean" ]; then
cleanup_build
else
Expand Down

0 comments on commit ae07e67

Please sign in to comment.