Top 20 BitBake Variables

Recipe identity

  1. PN – Package name (usually recipe filename without version).
  2. PV – Package version.
  3. PR – Recipe revision (default r0).
  4. P – Combination of PN and PV (e.g., foo-1.2).

Source and build dirs

  1. SRC_URI – Where to fetch source (git, tarball, patches).
  2. S – Source directory inside ${WORKDIR}.
  3. WORKDIR – Work directory for this recipe.
  4. B – Build directory (default = ${S}, but sometimes separate).
  5. D – Destination dir for do_install (staging before packaging).

Build control

  1. DEPENDS – Build-time dependencies (other recipes).
  2. RDEPENDS – Runtime dependencies.
  3. EXTRA_OECONF – Extra flags passed to ./configure.
  4. EXTRA_OEMAKE – Extra flags passed to make.
  5. FILES – Files included in binary packages.
  6. PACKAGES – List of output packages generated from recipe.

Compiler & environment

  1. CFLAGS – C compiler flags.
  2. LDFLAGS – Linker flags.
  3. CPPFLAGS – Preprocessor flags.

Staging & install

  1. bindir, sbindir, libdir, includedir – Standard install dirs.
  2. prefix, exec_prefix – Prefix for installation paths (default /usr).

Why these matter

  • PN, PV, PR define what you’re building.
  • SRC_URI, S, WORKDIR, B, D define where it builds.
  • DEPENDS, RDEPENDS define dependencies.
  • EXTRA_OECONF, EXTRA_OEMAKE, CFLAGS, LDFLAGS control how it builds.
  • FILES, PACKAGES, bindir define what gets packaged and where it lands.