Minimal bare-metal C project for PowerPC e200 / NXP MPC57xx targets.
Required:
- Meson (project requires Meson >= 1.1)
- Ninja
- A PowerPC cross toolchain available at
/opt/powerpc-unknown-eabi(expected target prefix:powerpc-unknown-eabi-*) - A host C toolchain for native helper/test binaries (
cc,gcc-ar,ld, etc.)
Optional:
- Doxygen (only required when
with_doc=true)
This project uses both a native file and a cross file when configuring the build:
-
support/meson/native-linux.iniconfigures tools for the host machine (Linux x86_64). Meson uses this for native targets such as unit tests built withnative: true. -
support/meson/powerpc-unknown-eabi.iniconfigures the embedded target toolchain and target machine properties (bare-metal PPC, big-endian,e500mc).
Typical usage:
meson setup builddir \
--native-file support/meson/native-linux.ini \
--cross-file support/meson/powerpc-unknown-eabi.iniIf your toolchain is not in /opt/powerpc-unknown-eabi, create your own cross file
from support/meson/powerpc-unknown-eabi.ini and update toolchain_root.
The project defines two boolean options:
-
with_test(default:false) enables unit tests (currently zlib module tests). -
with_doc(default:false) enables Doxygen documentation generation.
Examples:
# Enable tests
meson setup builddir \
--native-file support/meson/native-linux.ini \
--cross-file support/meson/powerpc-unknown-eabi.ini \
-Dwith_test=true
# Enable docs
meson setup builddir \
--native-file support/meson/native-linux.ini \
--cross-file support/meson/powerpc-unknown-eabi.ini \
-Dwith_doc=trueTo inspect configured values:
meson configure builddir- Configure
meson setup builddir \
--native-file support/meson/native-linux.ini \
--cross-file support/meson/powerpc-unknown-eabi.iniFor an existing build directory, reconfigure with:
meson setup builddir --reconfigure- Build
meson compile -C builddirMain artifacts include the firmware executable (oll) and map file (oll.map) in the build directory.
- Run tests (when
with_test=true)
meson test -C builddir --print-errorlogs- Build documentation (when
with_doc=true)
Documentation is built as part of the default build. You can also invoke:
meson compile -C builddir doc