mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-04 20:26:13 +02:00
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. Signed-off-by: Simon Glass <sjg@chromium.org>
14 lines
428 B
Makefile
14 lines
428 B
Makefile
# SPDX-License-Identifier: GPL-2.0+
|
|
|
|
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/
|
|
|
|
# sdl.c fails to compile with -fshort-wchar using musl.
|
|
cmd_cc_sdl.o = $(CC) $(filter-out -nostdinc -fshort-wchar, \
|
|
$(patsubst -I%,-idirafter%,$(c_flags))) -fno-lto -c -o $@ $<
|
|
|
|
$(obj)/sdl.o: $(src)/sdl.c FORCE
|
|
$(call if_changed_dep,cc_sdl.o)
|