aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-19 13:54:06 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-19 13:54:06 -0400
commit091ccb006fcf5c4aa1283901ca6e62ff85b3a569 (patch)
tree23b205eabf61ae2d3ed63694dab6297fa7dd0945
parentc0b7988200a82290287c6f4cd49585007f73175a (diff)
parent720097d895956c0bf15b8440f7845159a04b74da (diff)
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
-rw-r--r--.gitignore1
-rw-r--r--Documentation/kbuild/makefiles.txt10
-rw-r--r--Makefile2
-rw-r--r--scripts/Makefile.build3
-rw-r--r--scripts/Makefile.lib9
5 files changed, 22 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 869e1a3b64b6..51bd99d6a260 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,6 +49,7 @@ include/linux/compile.h
49include/linux/version.h 49include/linux/version.h
50include/linux/utsrelease.h 50include/linux/utsrelease.h
51include/linux/bounds.h 51include/linux/bounds.h
52include/generated
52 53
53# stgit generated dirs 54# stgit generated dirs
54patches-* 55patches-*
diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt
index d4b05672f9f7..d76cfd8712e1 100644
--- a/Documentation/kbuild/makefiles.txt
+++ b/Documentation/kbuild/makefiles.txt
@@ -316,6 +316,16 @@ more details, with real examples.
316 #arch/m68k/fpsp040/Makefile 316 #arch/m68k/fpsp040/Makefile
317 ldflags-y := -x 317 ldflags-y := -x
318 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
319 CFLAGS_$@, AFLAGS_$@ 329 CFLAGS_$@, AFLAGS_$@
320 330
321 CFLAGS_$@ and AFLAGS_$@ only apply to commands in current 331 CFLAGS_$@ and AFLAGS_$@ only apply to commands in current
diff --git a/Makefile b/Makefile
index bfdef56add34..6f4208ff2d10 100644
--- a/Makefile
+++ b/Makefile
@@ -1200,7 +1200,7 @@ CLEAN_FILES += vmlinux System.map \
1200 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map 1200 .tmp_kallsyms* .tmp_version .tmp_vmlinux* .tmp_System.map
1201 1201
1202# Directories & files removed with 'make mrproper' 1202# Directories & files removed with 'make mrproper'
1203MRPROPER_DIRS += include/config include2 usr/include 1203MRPROPER_DIRS += include/config include2 usr/include include/generated
1204MRPROPER_FILES += .config .config.old include/asm .version .old_version \ 1204MRPROPER_FILES += .config .config.old include/asm .version .old_version \
1205 include/linux/autoconf.h include/linux/version.h \ 1205 include/linux/autoconf.h include/linux/version.h \
1206 include/linux/utsrelease.h \ 1206 include/linux/utsrelease.h \
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 39a9642927d3..5c4b7a400c18 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -27,6 +27,9 @@ ccflags-y :=
27cppflags-y := 27cppflags-y :=
28ldflags-y := 28ldflags-y :=
29 29
30subdir-asflags-y :=
31subdir-ccflags-y :=
32
30# Read auto.conf if it exists, otherwise ignore 33# Read auto.conf if it exists, otherwise ignore
31-include include/config/auto.conf 34-include include/config/auto.conf
32 35
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 979619574f70..cba61ca403ca 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -4,6 +4,11 @@ ccflags-y += $(EXTRA_CFLAGS)
4cppflags-y += $(EXTRA_CPPFLAGS) 4cppflags-y += $(EXTRA_CPPFLAGS)
5ldflags-y += $(EXTRA_LDFLAGS) 5ldflags-y += $(EXTRA_LDFLAGS)
6 6
7#
8# flags that take effect in sub directories
9export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y)
10export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
11
7# Figure out what we need to build from the various variables 12# Figure out what we need to build from the various variables
8# =========================================================================== 13# ===========================================================================
9 14
@@ -104,10 +109,10 @@ else
104debug_flags = 109debug_flags =
105endif 110endif
106 111
107orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ 112orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \
108 $(ccflags-y) $(CFLAGS_$(basetarget).o) 113 $(ccflags-y) $(CFLAGS_$(basetarget).o)
109_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) 114_c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags))
110_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \ 115_a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \
111 $(asflags-y) $(AFLAGS_$(basetarget).o) 116 $(asflags-y) $(AFLAGS_$(basetarget).o)
112_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) 117_cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F))
113 118