make.sh 1.73 KB
#!/bin/sh

UBOOT_SRC_DIR=bootloader/u-boot-2015.04
UBOOT_OUT_DIR=bootloader/output-u-boot-2015.04

KERNEL_SRC_DIR=kernel/linux-rt-4.4.41/
KERNEL_OUT_DIR=kernel/output-linux-rt-4.4.41/

BUILDROOT_SRC_DIR=buildroot/buildroot-2018.02.9
BUILDROOT_OUT_DIR=buildroot/output-buildroot-2018.02.9

APP_SRC_DIR=app

make_uboot() {
  cd ${UBOOT_SRC_DIR}
  echo "=============================================="
  echo " Build u-boot [ $(pwd) ]"
  echo "=============================================="

  ./make.sh
  cd -
}

make_kernel() {
  cd ${KERNEL_SRC_DIR}
  echo "=============================================="
  echo " Build kernel [ $(pwd) ]"
  echo "=============================================="

  ./make.sh
  cd -
}

make_buildroot() {
  cd buildroot/${FA_PRODUCT}
  echo "=============================================="
  echo " Build buildroot [ $(pwd) ]"
  echo "=============================================="

  ./make.sh
  cd -
}

make_app() {
  if [ -d ${APP_SRC_DIR} ]
  then
    cd ${APP_SRC_DIR}
    echo "=============================================="
    echo " Build applications [ $(pwd) ]"
    echo "=============================================="

    ./make.sh
    cd -
  fi
}

while [ $# -ne 0 ]
do
case $1 in
  uboot)
    make_uboot
    DO_SOMETHING=1
    ;;
  kernel)
    make_kernel
    DO_SOMETHING=1
    ;;
  buildroot)
    make_buildroot
    DO_SOMETHING=1
    ;;
  app)
    make_app
    DO_SOMETHING=1
    ;;
  all)
    make_uboot
    make_kernel
    make_buildroot
    make_app
    DO_SOMETHING=1
    ;;
  esac
  shift
done

if [ -z "${DO_SOMETHING}" ]
then
  echo " [all      ] Build all"
  echo " [uboot    ] Build uboot"
  echo " [kernel   ] Build kernel"
  echo " [buildroot] Build buildroot"
  echo " [app      ] Build applications"
fi