Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes

* git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
kbuild: introduce subdir-ccflags-y
kbuild: support include/generated

+22 -3
+1
.gitignore
··· 49 include/linux/version.h 50 include/linux/utsrelease.h 51 include/linux/bounds.h 52 53 # stgit generated dirs 54 patches-*
··· 49 include/linux/version.h 50 include/linux/utsrelease.h 51 include/linux/bounds.h 52 + include/generated 53 54 # stgit generated dirs 55 patches-*
+10
Documentation/kbuild/makefiles.txt
··· 316 #arch/m68k/fpsp040/Makefile 317 ldflags-y := -x 318 319 CFLAGS_$@, AFLAGS_$@ 320 321 CFLAGS_$@ and AFLAGS_$@ only apply to commands in current
··· 316 #arch/m68k/fpsp040/Makefile 317 ldflags-y := -x 318 319 + subdir-ccflags-y, subdir-asflags-y 320 + The two flags listed above are similar to ccflags-y and as-falgs-y. 321 + The difference is that the subdir- variants has effect for the kbuild 322 + file where tey are present and all subdirectories. 323 + Options specified using subdir-* are added to the commandline before 324 + the options specified using the non-subdir variants. 325 + 326 + Example: 327 + subdir-ccflags-y := -Werror 328 + 329 CFLAGS_$@, AFLAGS_$@ 330 331 CFLAGS_$@ and AFLAGS_$@ only apply to commands in current
+1 -1
Makefile
··· 1200 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1201 1202 # Directories & files removed with 'make mrproper' 1203 - MRPROPER_DIRS += include/config include2 usr/include 1204 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1205 include/linux/autoconf.h include/linux/version.h \ 1206 include/linux/utsrelease.h \
··· 1200 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1201 1202 # Directories & files removed with 'make mrproper' 1203 + MRPROPER_DIRS += include/config include2 usr/include include/generated 1204 MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1205 include/linux/autoconf.h include/linux/version.h \ 1206 include/linux/utsrelease.h \
+3
scripts/Makefile.build
··· 27 cppflags-y := 28 ldflags-y := 29 30 # Read auto.conf if it exists, otherwise ignore 31 -include include/config/auto.conf 32
··· 27 cppflags-y := 28 ldflags-y := 29 30 + subdir-asflags-y := 31 + subdir-ccflags-y := 32 + 33 # Read auto.conf if it exists, otherwise ignore 34 -include include/config/auto.conf 35
+7 -2
scripts/Makefile.lib
··· 4 cppflags-y += $(EXTRA_CPPFLAGS) 5 ldflags-y += $(EXTRA_LDFLAGS) 6 7 # Figure out what we need to build from the various variables 8 # =========================================================================== 9 ··· 109 debug_flags = 110 endif 111 112 - orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ 113 $(ccflags-y) $(CFLAGS_$(basetarget).o) 114 _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) 115 - _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \ 116 $(asflags-y) $(AFLAGS_$(basetarget).o) 117 _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 118
··· 4 cppflags-y += $(EXTRA_CPPFLAGS) 5 ldflags-y += $(EXTRA_LDFLAGS) 6 7 + # 8 + # flags that take effect in sub directories 9 + export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y) 10 + export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y) 11 + 12 # Figure out what we need to build from the various variables 13 # =========================================================================== 14 ··· 104 debug_flags = 105 endif 106 107 + orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \ 108 $(ccflags-y) $(CFLAGS_$(basetarget).o) 109 _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) 110 + _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \ 111 $(asflags-y) $(AFLAGS_$(basetarget).o) 112 _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 113