[yocto] Compiling a simple command

Paul D. DeRocco pderocco at ix.netcom.com
Thu Jun 20 15:08:57 PDT 2013


I've tried to add a single small executable to my image, based on what it
says in 5.3.1. of the Project Development Manual, and while the image gets
built with no error messages, it never compiles my executable. I'm not doing
_exactly_ what it says, so I assume some difference is accounting for this
failure. What I'm doing different:

1) Since I'm only adding one tiny little program to an otherwise default
image, I'm not creating a separate .bb file for it, but placing it in the
top-level .bb file that I invoke with the bitbake command.

2) Since I only have one .bb file, I'm sticking it in the layer directory,
not two levels down, and adding ${LAYERDIR}/*.bb to BBFILES.

It's finding the recipe okay, because the image is being built, but it's
never executing do_compile or do_install. The recipe looks like this:

-- 
require recipes-core/images/core-image-base.bb

DESCRIPTION = "A basic image with a realtime kernel."
DEPENDS = "linux-yocto-rt"
LICENSE = "MIT"
PR = "r0"

SRC_URI = "file://fastuart.cpp"

S = "${WORKDIR}"

do_compile() {
    ${CC} fastuart.cpp -o fastuart
}

do_install() {
    install -d ${D}${bindir}
    install -m 0755 fastuart ${D}${bindir}
}
-- 

The source is one level down from the recipe file, in files/fastuart.cpp. Is
there some reason that one can't do a compilation from a top-level recipe
that makes an image? Or is it because of the location of the .bb file in the
tree? Or am I doing something else wrong?

-- 

Ciao,               Paul D. DeRocco
Paul                mailto:pderocco at ix.netcom.com 
 




More information about the yocto mailing list