kbuild: enable 'make CFLAGS=...' to add additional options to CC
The variable CFLAGS is a wellknown variable and the usage by
kbuild may result in unexpected behaviour.
On top of that several people over time has asked for a way to
pass in additional flags to gcc.
This patch replace use of CFLAGS with KBUILD_CFLAGS all over the
tree and enabling one to use:
make CFLAGS=...
to specify additional gcc commandline options.
One usecase is when trying to find gcc bugs but other
use cases has been requested too.
Patch was tested on following architectures:
alpha, arm, i386, x86_64, mips, sparc, sparc64, ia64, m68k
Test was simple to do a defconfig build, apply the patch and check
that nothing got rebuild.
Signed-off-by:
Sam Ravnborg <sam@ravnborg.org>
Showing
- Documentation/kbuild/makefiles.txt 9 additions, 6 deletionsDocumentation/kbuild/makefiles.txt
- Makefile 10 additions, 10 deletionsMakefile
- arch/alpha/Makefile 1 addition, 1 deletionarch/alpha/Makefile
- arch/alpha/kernel/Makefile 1 addition, 1 deletionarch/alpha/kernel/Makefile
- arch/alpha/lib/Makefile 1 addition, 1 deletionarch/alpha/lib/Makefile
- arch/arm/Makefile 4 additions, 4 deletionsarch/arm/Makefile
- arch/arm/boot/compressed/Makefile 1 addition, 1 deletionarch/arm/boot/compressed/Makefile
- arch/avr32/Makefile 2 additions, 2 deletionsarch/avr32/Makefile
- arch/blackfin/Makefile 1 addition, 1 deletionarch/blackfin/Makefile
- arch/cris/Makefile 4 additions, 4 deletionsarch/cris/Makefile
- arch/frv/Makefile 11 additions, 11 deletionsarch/frv/Makefile
- arch/h8300/Makefile 6 additions, 6 deletionsarch/h8300/Makefile
- arch/i386/Makefile 5 additions, 5 deletionsarch/i386/Makefile
- arch/ia64/Makefile 1 addition, 1 deletionarch/ia64/Makefile
- arch/m32r/Makefile 3 additions, 3 deletionsarch/m32r/Makefile
- arch/m68k/Makefile 4 additions, 4 deletionsarch/m68k/Makefile
- arch/m68knommu/Makefile 3 additions, 3 deletionsarch/m68knommu/Makefile
- arch/mips/Makefile 3 additions, 3 deletionsarch/mips/Makefile
- arch/mips/kernel/Makefile 1 addition, 1 deletionarch/mips/kernel/Makefile
- arch/parisc/Makefile 1 addition, 1 deletionarch/parisc/Makefile
Loading
Please register or sign in to comment