diff options
Diffstat (limited to 'bitbake/contrib/bbdev.sh')
-rw-r--r-- | bitbake/contrib/bbdev.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/bitbake/contrib/bbdev.sh b/bitbake/contrib/bbdev.sh new file mode 100644 index 0000000000..33a78531e1 --- /dev/null +++ b/bitbake/contrib/bbdev.sh | |||
@@ -0,0 +1,31 @@ | |||
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 | |||
7 | bbdev () { | ||
8 | local BBDIR PKGDIR BUILDDIR | ||
9 | if test x"$1" = "x--help"; then echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]"; return 1; fi | ||
10 | if test x"$1" = x; then BBDIR=`pwd`; else BBDIR=$1; fi | ||
11 | if test x"$2" = x; then PKGDIR=`pwd`; else PKGDIR=$2; fi | ||
12 | if test x"$3" = x; then BUILDDIR=`pwd`; else BUILDDIR=$3; fi | ||
13 | |||
14 | BBDIR=`readlink -f $BBDIR` | ||
15 | PKGDIR=`readlink -f $PKGDIR` | ||
16 | BUILDDIR=`readlink -f $BUILDDIR` | ||
17 | if ! (test -d $BBDIR && test -d $PKGDIR && test -d $BUILDDIR); then | ||
18 | echo >&2 "syntax: bbdev [bbdir [pkgdir [builddir]]]" | ||
19 | return 1 | ||
20 | fi | ||
21 | |||
22 | PATH=$BBDIR/bin:$PATH | ||
23 | BBPATH=$BBDIR | ||
24 | if test x"$BBDIR" != x"$PKGDIR"; then | ||
25 | BBPATH=$PKGDIR:$BBPATH | ||
26 | fi | ||
27 | if test x"$PKGDIR" != x"$BUILDDIR"; then | ||
28 | BBPATH=$BUILDDIR:$BBPATH | ||
29 | fi | ||
30 | export BBPATH | ||
31 | } | ||