Download - All IT eBooks
Transcript
The Software Layer
ff
do_compile: This method compiles the source and runs the GNU make target
by default.
ff
do_install: This method copies the results of the build from the build directory
B to the destination directory D. It does nothing by default.
ff
do_package: This method splits the deliverables into several packages. It does
nothing by default.
Usually, only the configuration, compilation, and installation tasks are overridden, and this is
mostly done implicitly by inheriting a class like autotools.
For a custom recipe that does not use a build system, you need to provide the required
instructions for configuration (if any), compilation, and installation in their corresponding
do_configure, do_compile, and do_install overrides. As an example of this type of
recipe, meta-custom/recipes-example/helloworld/helloworld_1.0.bb, may be
seen here:
DESCRIPTION = "Simple helloworld application"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4
f302"
SRC_URI = "file://helloworld.c"
S = "${WORKDIR}"
do_compile() {
${CC} helloworld.c -o helloworld
}
do_install() {
install -d ${D}${bindir}
install -m 0755 helloworld ${D}${bindir}
}
With the meta-custom/recipes-example/helloworld/helloworld-1.0/
helloworld.c source file being the following:
#include <stdio.h>
int main(void)
{
return printf("Hello World");
}
We will see example recipes that use the most common build systems in the next chapter.
116