How to pass compiler options during Linux kernel compilation?
From Linux kernel's makefile:
# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
# last assignments
KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
KBUILD_AFLAGS += $(ARCH_AFLAGS) $(KAFLAGS)
KBUILD_CFLAGS += $(ARCH_CFLAGS) $(KCFLAGS)
So, passing additional options for Kbuild uses usual environment/makefile variables but with K
prefix:
make "KCFLAGS=-pipe -Wsomething"