sandbox: Adjust how OS-interface files are built
PATCH 1/1 sandbox: Adjust how OS-interface files are built
The current mechanism uses a completely separate build rule for each file which must be built with system headers. This is tricky to maintain.
Add a foreach template in the sandbox cpu Makefile which generates the custom compile rules from a CFLAGS_USE_SYSHDRS list. This keeps the rules data-driven without needing changes to the common scripts/Makefile.lib, which could affect other architectures.
Move initjmp.o into the template since it uses the same pattern. Add sdl.o to the list too, with an override for its command since it also needs -fshort-wchar removed and -fno-lto added.
---
arch/sandbox/Makefile | 2 +- arch/sandbox/cpu/Makefile | 45 ++++++++++++++------------------------- 2 files changed, 17 insertions(+), 30 deletions(-)
arch/sandbox/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0+ -head-y := arch/sandbox/cpu/start.o arch/sandbox/cpu/os.o +head-y := arch/sandbox/cpu/start.o head-$(CONFIG_SANDBOX_SDL) += arch/sandbox/cpu/sdl.o libs-y += arch/sandbox/cpu/ libs-y += arch/sandbox/lib/
arch/sandbox/cpu/Makefile +16 -29
58 lines not on this page · raw message
Signature · 4 lines
2.43.0 base-commit: 1ffc541eafc96d5eebcf837ab892dccec3b93568 branch: sb-os-us
Quoted 10 lines · Simon Glass
The current mechanism uses a completely separate build rule for each file which must be built with system headers. This is tricky to maintain.
Add a foreach template in the sandbox cpu
Makefilewhich generates the custom compile rules from aCFLAGS_USE_SYSHDRSlist. This keeps the rules data-driven without needing changes to the commonscripts/Makefile.lib, which could affect other architectures.[...]
Applied to u-boot/master, thanks!
[1/1] sandbox: Adjust how OS-interface files are built
commit: 738428dc0e761617c5196a5210774ac7347e6bb7
Signature · 1 line
Tom