aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 16 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 188c3b6b3fa9..cb740d4d4e8c 100644
--- a/Makefile
+++ b/Makefile
@@ -528,9 +528,22 @@ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
528KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,) 528KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
529 529
530# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments 530# Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
531KBUILD_CPPFLAGS += $(CPPFLAGS) 531# But warn user when we do so
532KBUILD_AFLAGS += $(AFLAGS) 532warn-assign = \
533KBUILD_CFLAGS += $(CFLAGS) 533$(warning "WARNING: Appending $$K$(1) ($(K$(1))) from $(origin K$(1)) to kernel $$$(1)")
534
535ifneq ($(KCPPFLAGS),)
536 $(call warn-assign,CPPFLAGS)
537 KBUILD_CPPFLAGS += $(KCPPFLAGS)
538endif
539ifneq ($(KAFLAGS),)
540 $(call warn-assign,AFLAGS)
541 KBUILD_AFLAGS += $(KAFLAGS)
542endif
543ifneq ($(KCFLAGS),)
544 $(call warn-assign,CFLAGS)
545 KBUILD_CFLAGS += $(KCFLAGS)
546endif
534 547
535# Use --build-id when available. 548# Use --build-id when available.
536LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\ 549LDFLAGS_BUILD_ID = $(patsubst -Wl$(comma)%,%,\