bbdev.sh 992 B

12345678910111213141516171819202122232425262728293031
  1. # This is a shell function to be sourced into your shell or placed in your .profile,
  2. # which makes setting things up for BitBake a bit easier.
  3. #
  4. # The author disclaims copyright to the contents of this file and places it in the
  5. # public domain.
  6. bbdev () {
  7. local BBDIR PKGDIR BUILDDIR
  8. if test x"$1" = "x--help"; then echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"; return 1; fi
  9. if test x"$1" = x; then BBDIR=`pwd`; else BBDIR=$1; fi
  10. if test x"$2" = x; then PKGDIR=`pwd`; else PKGDIR=$2; fi
  11. if test x"$3" = x; then BUILDDIR=`pwd`; else BUILDDIR=$3; fi
  12. BBDIR=`readlink -f $BBDIR`
  13. PKGDIR=`readlink -f $PKGDIR`
  14. BUILDDIR=`readlink -f $BUILDDIR`
  15. if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then
  16. echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"
  17. return 1
  18. fi
  19. PATH=$BBDIR/bin:$PATH
  20. BBPATH=$BBDIR
  21. if test x"$BBDIR" != x"$PKGDIR"; then
  22. BBPATH=$PKGDIR:$BBPATH
  23. fi
  24. if test x"$PKGDIR" != x"$BUILDDIR"; then
  25. BBPATH=$BUILDDIR:$BBPATH
  26. fi
  27. export BBPATH
  28. }