diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /scripts/Makefile.build | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r-- | scripts/Makefile.build | 85 |
1 files changed, 78 insertions, 7 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index a1a5cf95a68d..a0fd5029cfe7 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -49,6 +49,56 @@ ifeq ($(KBUILD_NOPEDANTIC),) | |||
49 | $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS) | 49 | $(error CFLAGS was changed in "$(kbuild-file)". Fix it to use EXTRA_CFLAGS) |
50 | endif | 50 | endif |
51 | endif | 51 | endif |
52 | |||
53 | # | ||
54 | # make W=... settings | ||
55 | # | ||
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 | ||
61 | # are not supported by all versions of the compiler | ||
62 | ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS | ||
63 | warning- := $(empty) | ||
64 | |||
65 | warning-1 := -Wextra -Wunused -Wno-unused-parameter | ||
66 | warning-1 += -Wmissing-declarations | ||
67 | warning-1 += -Wmissing-format-attribute | ||
68 | warning-1 += -Wmissing-prototypes | ||
69 | warning-1 += -Wold-style-definition | ||
70 | warning-1 += $(call cc-option, -Wmissing-include-dirs) | ||
71 | warning-1 += $(call cc-option, -Wunused-but-set-variable) | ||
72 | |||
73 | warning-2 := -Waggregate-return | ||
74 | warning-2 += -Wcast-align | ||
75 | warning-2 += -Wdisabled-optimization | ||
76 | warning-2 += -Wnested-externs | ||
77 | warning-2 += -Wshadow | ||
78 | warning-2 += $(call cc-option, -Wlogical-op) | ||
79 | |||
80 | warning-3 := -Wbad-function-cast | ||
81 | warning-3 += -Wcast-qual | ||
82 | warning-3 += -Wconversion | ||
83 | warning-3 += -Wpacked | ||
84 | warning-3 += -Wpadded | ||
85 | warning-3 += -Wpointer-arith | ||
86 | warning-3 += -Wredundant-decls | ||
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) | ||
100 | endif | ||
101 | |||
52 | include scripts/Makefile.lib | 102 | include scripts/Makefile.lib |
53 | 103 | ||
54 | ifdef host-progs | 104 | ifdef host-progs |
@@ -209,11 +259,33 @@ cmd_modversions = \ | |||
209 | endif | 259 | endif |
210 | 260 | ||
211 | ifdef CONFIG_FTRACE_MCOUNT_RECORD | 261 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
212 | cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ | 262 | ifdef BUILD_C_RECORDMCOUNT |
263 | ifeq ("$(origin RECORDMCOUNT_WARN)", "command line") | ||
264 | RECORDMCOUNT_FLAGS = -w | ||
265 | endif | ||
266 | # Due to recursion, we must skip empty.o. | ||
267 | # The empty.o file is created in the make process in order to determine | ||
268 | # the target endianness and word size. It is made before all other C | ||
269 | # files, including recordmcount. | ||
270 | sub_cmd_record_mcount = \ | ||
271 | if [ $(@) != "scripts/mod/empty.o" ]; then \ | ||
272 | $(objtree)/scripts/recordmcount $(RECORDMCOUNT_FLAGS) "$(@)"; \ | ||
273 | fi; | ||
274 | recordmcount_source := $(srctree)/scripts/recordmcount.c \ | ||
275 | $(srctree)/scripts/recordmcount.h | ||
276 | else | ||
277 | sub_cmd_record_mcount = set -e ; perl $(srctree)/scripts/recordmcount.pl "$(ARCH)" \ | ||
213 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ | 278 | "$(if $(CONFIG_CPU_BIG_ENDIAN),big,little)" \ |
214 | "$(if $(CONFIG_64BIT),64,32)" \ | 279 | "$(if $(CONFIG_64BIT),64,32)" \ |
215 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ | 280 | "$(OBJDUMP)" "$(OBJCOPY)" "$(CC) $(KBUILD_CFLAGS)" \ |
281 | "$(LD)" "$(NM)" "$(RM)" "$(MV)" \ | ||
216 | "$(if $(part-of-module),1,0)" "$(@)"; | 282 | "$(if $(part-of-module),1,0)" "$(@)"; |
283 | recordmcount_source := $(srctree)/scripts/recordmcount.pl | ||
284 | endif | ||
285 | cmd_record_mcount = \ | ||
286 | if [ "$(findstring -pg,$(_c_flags))" = "-pg" ]; then \ | ||
287 | $(sub_cmd_record_mcount) \ | ||
288 | fi; | ||
217 | endif | 289 | endif |
218 | 290 | ||
219 | define rule_cc_o_c | 291 | define rule_cc_o_c |
@@ -229,13 +301,13 @@ define rule_cc_o_c | |||
229 | endef | 301 | endef |
230 | 302 | ||
231 | # Built-in and composite module parts | 303 | # Built-in and composite module parts |
232 | $(obj)/%.o: $(src)/%.c FORCE | 304 | $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE |
233 | $(call cmd,force_checksrc) | 305 | $(call cmd,force_checksrc) |
234 | $(call if_changed_rule,cc_o_c) | 306 | $(call if_changed_rule,cc_o_c) |
235 | 307 | ||
236 | # Single-part modules are special since we need to mark them in $(MODVERDIR) | 308 | # Single-part modules are special since we need to mark them in $(MODVERDIR) |
237 | 309 | ||
238 | $(single-used-m): $(obj)/%.o: $(src)/%.c FORCE | 310 | $(single-used-m): $(obj)/%.o: $(src)/%.c $(recordmcount_source) FORCE |
239 | $(call cmd,force_checksrc) | 311 | $(call cmd,force_checksrc) |
240 | $(call if_changed_rule,cc_o_c) | 312 | $(call if_changed_rule,cc_o_c) |
241 | @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) | 313 | @{ echo $(@:.o=.ko); echo $@; } > $(MODVERDIR)/$(@F:.o=.mod) |
@@ -295,7 +367,7 @@ quiet_cmd_link_o_target = LD $@ | |||
295 | cmd_link_o_target = $(if $(strip $(obj-y)),\ | 367 | cmd_link_o_target = $(if $(strip $(obj-y)),\ |
296 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ | 368 | $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \ |
297 | $(cmd_secanalysis),\ | 369 | $(cmd_secanalysis),\ |
298 | rm -f $@; $(AR) rcs $@) | 370 | rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@) |
299 | 371 | ||
300 | $(builtin-target): $(obj-y) FORCE | 372 | $(builtin-target): $(obj-y) FORCE |
301 | $(call if_changed,link_o_target) | 373 | $(call if_changed,link_o_target) |
@@ -321,7 +393,7 @@ $(modorder-target): $(subdir-ym) FORCE | |||
321 | # | 393 | # |
322 | ifdef lib-target | 394 | ifdef lib-target |
323 | quiet_cmd_link_l_target = AR $@ | 395 | quiet_cmd_link_l_target = AR $@ |
324 | cmd_link_l_target = rm -f $@; $(AR) rcs $@ $(lib-y) | 396 | cmd_link_l_target = rm -f $@; $(AR) rcs$(KBUILD_ARFLAGS) $@ $(lib-y) |
325 | 397 | ||
326 | $(lib-target): $(lib-y) FORCE | 398 | $(lib-target): $(lib-y) FORCE |
327 | $(call if_changed,link_l_target) | 399 | $(call if_changed,link_l_target) |
@@ -387,7 +459,6 @@ ifneq ($(cmd_files),) | |||
387 | include $(cmd_files) | 459 | include $(cmd_files) |
388 | endif | 460 | endif |
389 | 461 | ||
390 | |||
391 | # Declare the contents of the .PHONY variable as phony. We keep that | 462 | # Declare the contents of the .PHONY variable as phony. We keep that |
392 | # information in a variable se we can use it in if_changed and friends. | 463 | # information in a variable se we can use it in if_changed and friends. |
393 | 464 | ||