diff options
| author | Simon Glass <[email protected]> | 2026-04-13 07:15:38 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-04-21 15:56:54 -0600 |
| commit | 09297182ad79a4ea30fd6aa74d33646efc4eb12f (patch) | |
| tree | c5c020d0ddc989eead3827fbc057b79f687ea3f6 /scripts | |
| parent | 24b99d293344d92d902cbc184e8d9665e6a437b2 (diff) | |
kbuild: Use if_changed for font and splash .incbin rules
The generated .S files for fonts and splash screens use .incbin with the
full prerequisite path. When building with O= this bakes an absolute
path into the .S file. If the build directory is later used on a
different machine (e.g. in a container), the assembler cannot find the
source file.
Follow the existing DTB convention: rename the object targets to use
compound suffixes (.ttf.o, .bmp.o), switch the pattern rules from
direct $(call cmd,...) to FORCE + $(call if_changed,...), and register
the new suffixes with intermediate_targets so that kbuild loads their
.cmd files. This lets if_changed detect when the recorded command
(including source paths) has changed and regenerate the .S file
automatically.
The EFI rule is left unchanged since its prerequisite is a generated
file in the build directory, like the DTB and DTBO rules.
The intermediate_targets entries stay in scripts/Makefile.build rather
than moving to scripts/Makefile.lib-u-boot, because that file is
included before intermediate_targets is defined and 'targets' is ':=',
so a '$(call intermediate_targets, ...)' inside it would expand to
empty and silently drop the entries. To keep the upstream block
untouched, the U-Boot additions go in a separate 'targets +=' block
immediately below.
Suggested-by: Rasmus Villemoes <[email protected]>
Signed-off-by: Simon Glass <[email protected]>
Reviewed-by: Rasmus Villemoes <[email protected]>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/Makefile.build | 4 | ||||
| -rw-r--r-- | scripts/Makefile.lib-u-boot | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index e625f99986e..73b6769ab90 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -440,6 +440,10 @@ targets += $(call intermediate_targets, .asn1.o, .asn1.c .asn1.h) \ $(call intermediate_targets, .lex.o, .lex.c) \ $(call intermediate_targets, .tab.o, .tab.c .tab.h) +# Added for U-Boot +targets += $(call intermediate_targets, .ttf.o, .ttf.S) \ + $(call intermediate_targets, .bmp.o, .bmp.S) + # Build # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib-u-boot b/scripts/Makefile.lib-u-boot index c55f8d8e0c3..4d60a8eee49 100644 --- a/scripts/Makefile.lib-u-boot +++ b/scripts/Makefile.lib-u-boot @@ -20,8 +20,8 @@ cmd_S_ttf= \ echo '.balign 16'; \ ) > $@ -$(obj)/%.S: $(src)/%.ttf - $(call cmd,S_ttf) +$(obj)/%.ttf.S: $(src)/%.ttf FORCE + $(call if_changed,S_ttf) # Splash logos # --------------------------------------------------------------------------- @@ -40,8 +40,8 @@ cmd_S_splash= \ echo '.balign 16'; \ ) > $@ -$(obj)/%.S: $(src)/%.bmp - $(call cmd,S_splash) +$(obj)/%.bmp.S: $(src)/%.bmp FORCE + $(call if_changed,S_splash) # EFI applications # A Makefile target *.efi is built as EFI application. |
