yocto-public/1-concepts/recipes.md

50 lines
1.0 KiB
Markdown
Raw Permalink Normal View History

2015-07-21 12:22:25 +00:00
# Recipes
A recipe describes how to build, package and install one software.
It defines a list of variables like the software name, license checksum, etc...
It can also define/override tasks like `do_compile` or `do_install`
<info data-markdown>
Many recipes are found in each layer at `$POKY/meta*` in the `recipe-*` folders.
</info>
## Recipes list
To list all available recipes across every available layer:
```sh
bitbake-layers show-recipes
```
## Example
```sh
SUMMARY = "My lovely software"
# Name
PN = "lovely-software"
PV = "1"
PR = "r0"
# License info
LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=2f24da3987abb0e21842f5b694ec2133"
# This program depends on libcurl
DEPENDS = "curl"
RDEPENDS_${PN} = "curl"
# Task to build the software
do_compile(){
oe_runmake \
INCFLAGS="${BUILDSDK_CFLAGS} -DNDEBUG" \
LDFLAGS="${BUILDSDK_LDFLAGS} -lpthread" \
all
}
# Task to install it on the target system
do_install(){
install -d ${D}${bindir}
install -m 0755 ${B}/binary ${D}${bindir}
}
```