[oe] Getting Started -Makefile

Cliff Brake cliff.brake at gmail.com
Tue Nov 20 20:00:26 UTC 2007


On Nov 20, 2007 12:57 PM, Tim Bird <tim.bird at am.sony.com> wrote:
> pHilipp Zabel wrote:
> > $ cat ~/bin/bitbake
> > #!/bin/sh
> > export OEDIR=${OEDIR:-$PWD}
> > export BBPATH=${BBPATH:-$OEDIR/build:$OEDIR/openembedded}
> > /usr/local/bin/bitbake $*
>
> This is nice.  Can someone tell me why this isn't
> the default behavior of bitbake now?  (I'm honestly
> not trolling :-)   There must be some good reason
> to allow bitbake to be used outside of a build
> directory.  Make (which bitbake resembles
> in some aspects), is sensitive to it's starting
> directory.  Why not bitbake?

One problem is bitbake is typically run from a svn co directory, so
you need to modify the path anyway.  Once you are stuck with
source'ing a script, it is not a lot more work to add BBPATH.

It might be a good idea to have defaults.  I'm sure with a few lines
of Python, the above script could be implemented directly in bitbake,
so why not -- if the variables are not defined, then use the defaults.
 But often something a little different is required.

For, example, most of my builds use the following setup:

export OEDIR="/build/svs_oe_update/oe2"
export TOPDIR="${OEDIR}/build/angstrom-2007.1"
export BBPATH="${OEDIR}/oe/custom:${TOPDIR}:${OEDIR}/oe/org.openembedded.dev"
export PATH="${OEDIR}/bitbake/bin:${PATH}"

The defaults might be useful for many people, but people who really
use OE often need something a little different.  My setup allows for
OE overlays, target multiple distributions (2007.1, or 2008.1, etc).
Also, defaults might get in the way of people who forget to source
their setup-env script and lead to confusing error messages, etc.  Too
much magic can be confusing too ...

I mostly use OE to help customers build vertical embedded systems.  I
use Makefiles, but as mentioned by others, it is mainly just for setup
so that I can quickly switch machines, changes distributions, glibc vs
uclibc, etc.  After that, I run bitbake.  I think of a Makefile as
documentation so when I come back to a project in 1 year, I don't have
to remember how to set up a build and what targets need to be built.
My customers seem to like a Makefile.  They rarely get into the doing
OE development, but being able to run a complete build gives them some
level of comfort if I would get hit by a truck, they would at least
have the build system and could pick up where I left off.  So for my
usage, Makefiles (or shell scripts, or whatever you want to use) are
project specific, and typically need customized for what you are
doing.  As an example, as much as I like Rod's Makefile wizardry, I
prefer to do a few things differently and ending up writing my own
version.  So there is probably no one Makefile or setup script or way
of doing things that is going to work for most people -- which is fine
IMO.

Cliff

-- 
=======================
Cliff Brake
http://bec-systems.com




More information about the Openembedded-devel mailing list