5 Commits

Author SHA1 Message Date
Simon Glass
7811a8ae52 ulib: Add a boot example
Add an example of a program which boots an OS by calling into the U-Boot
library.

Series-to: concept
Co-developed-by: Claude <noreply@anthropic.com>
Co-developed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Series-links: 1:28
2025-09-10 03:37:08 -06:00
Simon Glass
4ba77a661f ulib: Refactor the Makefile to support multiple programs
The current Makefile for the ulib examples is not very easy to modify.

Split it into three parts:
- config.mk containing the variables used by the build tools
- a list of programs and the objects in each one
- rules.mk with some rules to make it all work

Use sys-objs to indicate objects which should be built with system
headers. Use U-Boot headers by default.

With this it is fairly simply to add a new program. Of course we could
make use of U-Boot's kbuild implementation to tidy this up, but the
purpose of the examples is to show how to do things outside the U-Boot
build system.

Co-developed-by: Claude <noreply@anthropic.com>
Co-developed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-10 03:35:59 -06:00
Simon Glass
4c32ae1087 ulib: Expand the ulib example to have two files
It is possible to have some files that build in the system environment
and some in the U-Boot environment. To build for the system, the system
headers must be used, or at least have priority. For a U-Boot file, its
headers must be used exclusively.

Expand the Makefile example to have two files, one of which is built
using U-Boot headers. This shows how a program can be built which
straddles both domains.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:10:53 -06:00
Simon Glass
a5fc8d6989 ulib: Use the correct copyright message
Canonical should be written with the 'Ltd.' suffix, so add this to a few
files that need it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-08 13:09:58 -06:00
Simon Glass
f2c378f0f9 ulib: Provide an example of how to build with ulib
Add an example Makefile which shows how to build against U-Boot from
outside the U-Boot source tree.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-09-05 15:47:39 -06:00