allwinner_a64/lichee/buildroot/build.sh
2018-08-08 14:16:19 +08:00

48 lines
750 B
Bash
Executable file

#!/bin/bash
set -e
PLATFORM=""
MODULE=""
show_help()
{
printf "\nbuild.sh - Top level build scritps\n"
echo "Valid Options:"
echo " -h Show help message"
echo " -p <platform> platform:sun6i sun6i_fiber sun6i_fiber_a31s or sun6i_dragonboard"
printf " -m <module> module\n\n"
}
while getopts hp:m: OPTION
do
case $OPTION in
h) show_help
;;
p) PLATFORM=$OPTARG
;;
m) MODULE=$OPTARG
;;
*) show_help
;;
esac
done
if [ -z "$PLATFORM" ]; then
show_help
exit 1
fi
if [ -z "$MODULE" ]; then
MODULE="all"
fi
if [ -x ./scripts/build_${PLATFORM}.sh ]; then
./scripts/build_${PLATFORM}.sh $MODULE
else
printf "\nERROR: Invalid Platform\nonly sun6i sun6i_fiber sun6i_fiber_a31s or sun6i_dragonboard support\n"
show_help
exit 1
fi