about summary refs log tree commit diff
path: root/Makeconfig
diff options
context:
space:
mode:
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig6
1 files changed, 4 insertions, 2 deletions
diff --git a/Makeconfig b/Makeconfig
index dd03ae803e..b6a1b4aeb1 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -632,8 +632,10 @@ libio-include = -I$(..)libio
 # it causes cpp to stop predefining __ASSEMBLER__.
 CPPFLAGS = $($(subdir)-CPPFLAGS) $(+includes) $(defines) \
 	   -include $(..)include/libc-symbols.h $(sysdep-CPPFLAGS) \
-	   $(CPPFLAGS-$(suffix $@)) $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) \
-	   $(CPPFLAGS-$(patsubst %$(suffix $@),%,$(@F)))
+	   $(CPPFLAGS-$(suffix $@)) \
+	   $(foreach L,$(libof-$(basename $(@F))) $(libof-$<) $(libof-$(@F)),\
+		     $(CPPFLAGS-$L)) \
+	   $(CPPFLAGS-$(<F)) $(CPPFLAGS-$(@F)) $(CPPFLAGS-$(basename $(@F)))
 override CFLAGS	= -std=gnu99 \
 		  $(filter-out %frame-pointer,$(+cflags)) $(sysdep-CFLAGS) \
 		  $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) $(CFLAGS-$(@F))