diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-05-24 16:31:37 -0400 |
commit | 2bb732cdb48d271ff7a910260ffb851fb4bc8a28 (patch) | |
tree | 580bf68eb1e52b4e6915588d61423347ae09c318 /scripts/Makefile.build | |
parent | f50d1d9e8d964fdd3b4cedfbca8843d1bc5916c1 (diff) | |
parent | c4d5ee13984f57b2f881635c49045151679f5e8a (diff) |
Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
kbuild: make KBUILD_NOCMDDEP=1 handle empty built-in.o
scripts/kallsyms.c: fix potential segfault
scripts/gen_initramfs_list.sh: Convert to a /bin/sh script
kbuild: Fix GNU make v3.80 compatibility
kbuild: Fix passing -Wno-* options to gcc 4.4+
kbuild: move scripts/basic/docproc.c to scripts/docproc.c
kbuild: Fix Makefile.asm-generic for um
kbuild: Allow to combine multiple W= levels
kbuild: Disable -Wunused-but-set-variable for gcc 4.6.0
Fix handling of backlash character in LINUX_COMPILE_BY name
kbuild: asm-generic support
kbuild: implement several W= levels
kbuild: Fix build with binutils <= 2.19
initramfs: Use KBUILD_BUILD_TIMESTAMP for generated entries
kbuild: Allow to override LINUX_COMPILE_BY and LINUX_COMPILE_HOST macros
kbuild: Drop unused LINUX_COMPILE_TIME and LINUX_COMPILE_DOMAIN macros
kbuild: Use the deterministic mode of ar
kbuild: Call gzip with -n
kbuild: move KALLSYMS_EXTRA_PASS from Kconfig to Makefile
Kconfig: improve KALLSYMS_ALL documentation
Fix up trivial conflict in Makefile
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 74 |
1 files changed, 45 insertions, 29 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 6165622c3e29..a0fd5029cfe7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -51,36 +51,52 @@ ifeq ($(KBUILD_NOPEDANTIC),) | |||
51 | endif | 51 | endif |
52 | 52 | ||
53 | # | 53 | # |
54 | # make W=1 settings | 54 | # make W=... settings |
55 | # | 55 | # |
56 | # $(call cc-option... ) handles gcc -W.. options which | 56 | # W=1 - warnings that may be relevant and does not occur too often |
57 | # W=2 - warnings that occur quite often but may still be relevant | ||
58 | # W=3 - the more obscure warnings, can most likely be ignored | ||
59 | # | ||
60 | # $(call cc-option, -W...) handles gcc -W.. options which | ||
57 | # are not supported by all versions of the compiler | 61 | # are not supported by all versions of the compiler |
58 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS | 62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS |
59 | KBUILD_EXTRA_WARNINGS := -Wextra | 63 | warning- := $(empty) |
60 | KBUILD_EXTRA_WARNINGS += -Wunused -Wno-unused-parameter | 64 | |
61 | KBUILD_EXTRA_WARNINGS += -Waggregate-return | 65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter |
62 | KBUILD_EXTRA_WARNINGS += -Wbad-function-cast | 66 | warning-1 += -Wmissing-declarations |
63 | KBUILD_EXTRA_WARNINGS += -Wcast-qual | 67 | warning-1 += -Wmissing-format-attribute |
64 | KBUILD_EXTRA_WARNINGS += -Wcast-align | 68 | warning-1 += -Wmissing-prototypes |
65 | KBUILD_EXTRA_WARNINGS += -Wconversion | 69 | warning-1 += -Wold-style-definition |
66 | KBUILD_EXTRA_WARNINGS += -Wdisabled-optimization | 70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) |
67 | KBUILD_EXTRA_WARNINGS += -Wlogical-op | 71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) |
68 | KBUILD_EXTRA_WARNINGS += -Wmissing-declarations | 72 | |
69 | KBUILD_EXTRA_WARNINGS += -Wmissing-format-attribute | 73 | warning-2 := -Waggregate-return |
70 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wmissing-include-dirs,) | 74 | warning-2 += -Wcast-align |
71 | KBUILD_EXTRA_WARNINGS += -Wmissing-prototypes | 75 | warning-2 += -Wdisabled-optimization |
72 | KBUILD_EXTRA_WARNINGS += -Wnested-externs | 76 | warning-2 += -Wnested-externs |
73 | KBUILD_EXTRA_WARNINGS += -Wold-style-definition | 77 | warning-2 += -Wshadow |
74 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Woverlength-strings,) | 78 | warning-2 += $(call cc-option, -Wlogical-op) |
75 | KBUILD_EXTRA_WARNINGS += -Wpacked | 79 | |
76 | KBUILD_EXTRA_WARNINGS += -Wpacked-bitfield-compat | 80 | warning-3 := -Wbad-function-cast |
77 | KBUILD_EXTRA_WARNINGS += -Wpadded | 81 | warning-3 += -Wcast-qual |
78 | KBUILD_EXTRA_WARNINGS += -Wpointer-arith | 82 | warning-3 += -Wconversion |
79 | KBUILD_EXTRA_WARNINGS += -Wredundant-decls | 83 | warning-3 += -Wpacked |
80 | KBUILD_EXTRA_WARNINGS += -Wshadow | 84 | warning-3 += -Wpadded |
81 | KBUILD_EXTRA_WARNINGS += -Wswitch-default | 85 | warning-3 += -Wpointer-arith |
82 | KBUILD_EXTRA_WARNINGS += $(call cc-option, -Wvla,) | 86 | warning-3 += -Wredundant-decls |
83 | KBUILD_CFLAGS += $(KBUILD_EXTRA_WARNINGS) | 87 | warning-3 += -Wswitch-default |
88 | warning-3 += $(call cc-option, -Wpacked-bitfield-compat) | ||
89 | warning-3 += $(call cc-option, -Wvla) | ||
90 | |||
91 | warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
92 | warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
93 | warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) | ||
94 | |||
95 | ifeq ("$(strip $(warning))","") | ||
96 | $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) | ||
97 | endif | ||
98 | |||
99 | KBUILD_CFLAGS += $(warning) | ||
84 | endif | 100 | endif |
85 | 101 | ||
86 | include scripts/Makefile.lib | 102 | include scripts/Makefile.lib |
@@ -351,7 +367,7 @@ quiet_cmd_link_o_target = LD $@ | |||
351 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | 367 | cmd_link_o_target = $(if $(strip $(obj-y)),\ |
352 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ | 368 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ |
353 | $(cmd_secanalysis),\ | 369 | $(cmd_secanalysis),\ |
354 | rm -f $@; $(AR) rcs $@) | 370 | rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) |
355 | 371 | ||
356 | $(builtin-target): $(obj-y) FORCE | 372 | $(builtin-target): $(obj-y) FORCE |
357 | $(call if_changed,link_o_target) | 373 | $(call if_changed,link_o_target) |
@@ -377,7 +393,7 @@ $(modorder-target): $(subdir-ym) FORCE | |||
377 | # | 393 | # |
378 | ifdef lib-target | 394 | ifdef lib-target |
379 | quiet_cmd_link_l_target = AR $@ | 395 | quiet_cmd_link_l_target = AR $@ |
380 | cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y) | 396 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) |
381 | 397 | ||
382 | $(lib-target): $(lib-y) FORCE | 398 | $(lib-target): $(lib-y) FORCE |
383 | $(call if_changed,link_l_target) | 399 | $(call if_changed,link_l_target) |