diff options
author | Mike Frysinger <vapier@gentoo.org> | 2023-12-27 10:42:30 +0300 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2024-01-20 06:23:47 +0300 |
commit | bf37122a728d7ac78b06cc078816be062cdc7ad4 (patch) | |
tree | 9115e0327f3a0d027913fe1783908b68ae52b2a1 /libgloss/xtensa | |
parent | 770dd85aaf0aa2b986a1fe827abfb3e48f2d4a1b (diff) |
libgloss: xtensa: fix CPPFLAGS clobbering
No sub-Makefile.inc file should ever set CPPFLAGS directly. That is
a global/common variable. Instead, ports should set the per-target
CPPFLAGS to include what they need.
Further, per-target CPPFLAGS should respect $(AM_CPPFLAGS).
Diffstat (limited to 'libgloss/xtensa')
-rw-r--r-- | libgloss/xtensa/Makefile.inc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/libgloss/xtensa/Makefile.inc b/libgloss/xtensa/Makefile.inc index 3ce02c190..b4c818732 100644 --- a/libgloss/xtensa/Makefile.inc +++ b/libgloss/xtensa/Makefile.inc @@ -1,4 +1,4 @@ -CPPFLAGS += -D_LIBGLOSS -I$(srcdir)/%D%/include +AM_CPPFLAGS_%C% = -D_LIBGLOSS -I$(srcdir)/%D%/include multilibtool_DATA += \ %D%/default.specs \ @@ -25,23 +25,28 @@ multilibtool_DATA += \ %D%/sleep.S \ %D%/syscalls.c \ %D%/window-vectors.S +%C%_libgloss_a_CPPFLAGS = $(AM_CPPFLAGS) multilibtool_LIBRARIES += %D%/libsys_qemu.a -%C%_libsys_qemu_a_CPPFLAGS = -DQEMU_SEMIHOSTING +%C%_libsys_qemu_a_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + -DQEMU_SEMIHOSTING %C%_libsys_qemu_a_SOURCES = \ %D%/sim-vectors.S \ %D%/sim-call.S \ %D%/syscalls.c multilibtool_LIBRARIES += %D%/libsys_openocd.a -%C%_libsys_openocd_a_CPPFLAGS = -DOPENOCD_SEMIHOSTING +%C%_libsys_openocd_a_CPPFLAGS = \ + $(AM_CPPFLAGS) \ + -DOPENOCD_SEMIHOSTING %C%_libsys_openocd_a_SOURCES = \ %D%/syscalls.c if HAVE_XTENSA_BOARD_ESP32 multilibtool_DATA += %D%/boards/esp32/memory.elf.ld %C%_libgloss_a_SOURCES += %D%/boards/esp32/board.c -%C%_libgloss_a_CPPFLAGS = -I$(srcdir)/%D%/boards/esp32/include +%C%_libgloss_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32/include %C%_libsys_qemu_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32/include %C%_libsys_openocd_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32/include endif @@ -49,7 +54,7 @@ endif if HAVE_XTENSA_BOARD_ESP32S3 multilibtool_DATA += %D%/boards/esp32s3/memory.elf.ld %C%_libgloss_a_SOURCES += %D%/boards/esp32s3/board.c -%C%_libgloss_a_CPPFLAGS = -I$(srcdir)/%D%/boards/esp32s3/include +%C%_libgloss_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32s3/include %C%_libsys_qemu_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32s3/include %C%_libsys_openocd_a_CPPFLAGS += -I$(srcdir)/%D%/boards/esp32s3/include endif |