Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild

Pull kbuild updates from Michal Marek:
"Kbuild changes for v3.16-rc1:

- cross-compilation fix so that cc-option is testing the right
compiler
- Fix for make defconfig all
- Using relative paths to the object and source directory where
possible, plus fixes for the fallout of the change
- several cleanups in the Makefiles and scripts

The powerpc fix is from today, because it was only discovered
recently. The rest has been in linux-next for some time"

* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
powerpc: Avoid circular dependency with zImage.%
kbuild: create include/config directory in scripts/kconfig/Makefile
kbuild: do not create include/linux directory
Makefile: Fix unrecognized cross-compiler command line options
kbuild: do not add "selinux" to subdir- twice
um: Fix for relative objtree when generating x86 headers
kbuild: Use relative path when building in a subdir of the source tree
kbuild: Use relative path when building in the source tree
kbuild: Use relative path for $(objtree)
firmware: Use $(quote) in the Makefile
firmware: Simplify directory creation
kbuild: trivial - fix comment block indent
kbuild: trivial - remove trailing spaces
kbuild: support simultaneous "make %config" and "make all"
kbuild: move extra gcc checks to scripts/Makefile.extrawarn

+168 -177
+52 -37
Makefile
··· 105 105 KBUILD_OUTPUT := $(O) 106 106 endif 107 107 108 - ifeq ("$(origin W)", "command line") 109 - export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) 110 - endif 111 - 112 108 # That's our default target when none is given on the command line 113 109 PHONY := _all 114 110 _all: ··· 149 153 _all: modules 150 154 endif 151 155 152 - srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) 153 - objtree := $(CURDIR) 156 + ifeq ($(KBUILD_SRC),) 157 + # building in the source tree 158 + srctree := . 159 + else 160 + ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR))) 161 + # building in a subdirectory of the source tree 162 + srctree := .. 163 + else 164 + srctree := $(KBUILD_SRC) 165 + endif 166 + endif 167 + objtree := . 154 168 src := $(srctree) 155 169 obj := $(objtree) 156 170 ··· 172 166 # SUBARCH tells the usermode build what the underlying arch is. That is set 173 167 # first, and if a usermode build is happening, the "ARCH=um" on the command 174 168 # line overrides the setting of ARCH below. If a native build is happening, 175 - # then ARCH is assigned, getting whatever value it gets normally, and 169 + # then ARCH is assigned, getting whatever value it gets normally, and 176 170 # SUBARCH is subsequently ignored. 177 171 178 172 SUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \ ··· 265 259 KBUILD_MODULES := 266 260 KBUILD_BUILTIN := 1 267 261 268 - # If we have only "make modules", don't compile built-in objects. 269 - # When we're building modules with modversions, we need to consider 270 - # the built-in objects during the descend as well, in order to 271 - # make sure the checksums are up to date before we record them. 262 + # If we have only "make modules", don't compile built-in objects. 263 + # When we're building modules with modversions, we need to consider 264 + # the built-in objects during the descend as well, in order to 265 + # make sure the checksums are up to date before we record them. 272 266 273 267 ifeq ($(MAKECMDGOALS),modules) 274 268 KBUILD_BUILTIN := $(if $(CONFIG_MODVERSIONS),1) 275 269 endif 276 270 277 - # If we have "make <whatever> modules", compile modules 278 - # in addition to whatever we do anyway. 279 - # Just "make" or "make all" shall build modules as well 271 + # If we have "make <whatever> modules", compile modules 272 + # in addition to whatever we do anyway. 273 + # Just "make" or "make all" shall build modules as well 280 274 281 275 ifneq ($(filter all _all modules,$(MAKECMDGOALS)),) 282 276 KBUILD_MODULES := 1 ··· 300 294 # cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< 301 295 # 302 296 # If $(quiet) is empty, the whole command will be printed. 303 - # If it is set to "quiet_", only the short version will be printed. 297 + # If it is set to "quiet_", only the short version will be printed. 304 298 # If it is set to "silent_", nothing will be printed at all, since 305 299 # the variable $(silent_cmd_cc_o_c) doesn't exist. 306 300 # ··· 352 346 include $(srctree)/scripts/Kbuild.include 353 347 354 348 # Make variables (CC, etc...) 355 - 356 349 AS = $(CROSS_COMPILE)as 357 350 LD = $(CROSS_COMPILE)ld 358 351 CC = $(CROSS_COMPILE)gcc ··· 400 395 KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ 401 396 -fno-strict-aliasing -fno-common \ 402 397 -Werror-implicit-function-declaration \ 403 - -Wno-format-security \ 404 - $(call cc-option,-fno-delete-null-pointer-checks,) 398 + -Wno-format-security 399 + 405 400 KBUILD_AFLAGS_KERNEL := 406 401 KBUILD_CFLAGS_KERNEL := 407 402 KBUILD_AFLAGS := -D__ASSEMBLY__ ··· 509 504 # We're called with mixed targets (*config and build targets). 510 505 # Handle them one by one. 511 506 512 - %:: FORCE 513 - $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= $@ 507 + PHONY += $(MAKECMDGOALS) __build_one_by_one 508 + 509 + $(filter-out __build_one_by_one, $(MAKECMDGOALS)): __build_one_by_one 510 + @: 511 + 512 + __build_one_by_one: 513 + $(Q)set -e; \ 514 + for i in $(MAKECMDGOALS); do \ 515 + $(MAKE) -f $(srctree)/Makefile $$i; \ 516 + done 514 517 515 518 else 516 519 ifeq ($(config-targets),1) ··· 533 520 export KBUILD_DEFCONFIG KBUILD_KCONFIG 534 521 535 522 config: scripts_basic outputmakefile FORCE 536 - $(Q)mkdir -p include/linux include/config 537 523 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 538 524 539 525 %config: scripts_basic outputmakefile FORCE 540 - $(Q)mkdir -p include/linux include/config 541 526 $(Q)$(MAKE) $(build)=scripts/kconfig $@ 542 527 543 528 else ··· 605 594 # Defaults to vmlinux, but the arch makefile usually adds further targets 606 595 all: vmlinux 607 596 597 + include $(srctree)/arch/$(SRCARCH)/Makefile 598 + 599 + KBUILD_CFLAGS += $(call cc-option,-fno-delete-null-pointer-checks,) 600 + 608 601 ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE 609 602 KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) 610 603 else 611 604 KBUILD_CFLAGS += -O2 612 605 endif 613 - 614 - include $(srctree)/arch/$(SRCARCH)/Makefile 615 606 616 607 ifdef CONFIG_READABLE_ASM 617 608 # Disable optimizations that make assembler listings hard to read. ··· 744 731 KBUILD_CFLAGS += -DCC_HAVE_ASM_GOTO 745 732 endif 746 733 734 + include $(srctree)/scripts/Makefile.extrawarn 735 + 747 736 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments 748 737 KBUILD_CPPFLAGS += $(KCPPFLAGS) 749 738 KBUILD_AFLAGS += $(KAFLAGS) ··· 790 775 export MODLIB 791 776 792 777 # 793 - # INSTALL_MOD_STRIP, if defined, will cause modules to be 794 - # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then 795 - # the default option --strip-debug will be used. Otherwise, 796 - # INSTALL_MOD_STRIP value will be used as the options to the strip command. 778 + # INSTALL_MOD_STRIP, if defined, will cause modules to be 779 + # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then 780 + # the default option --strip-debug will be used. Otherwise, 781 + # INSTALL_MOD_STRIP value will be used as the options to the strip command. 797 782 798 783 ifdef INSTALL_MOD_STRIP 799 784 ifeq ($(INSTALL_MOD_STRIP),1) ··· 878 863 endif 879 864 +$(call if_changed,link-vmlinux) 880 865 881 - # The actual objects are generated when descending, 866 + # The actual objects are generated when descending, 882 867 # make sure no implicit rule kicks in 883 868 $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; 884 869 ··· 1036 1021 1037 1022 all: modules 1038 1023 1039 - # Build modules 1024 + # Build modules 1040 1025 # 1041 - # A module can be listed more than once in obj-m resulting in 1042 - # duplicate lines in modules.order files. Those are removed 1043 - # using awk while concatenating to the final file. 1026 + # A module can be listed more than once in obj-m resulting in 1027 + # duplicate lines in modules.order files. Those are removed 1028 + # using awk while concatenating to the final file. 1044 1029 1045 1030 PHONY += modules 1046 1031 modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin ··· 1069 1054 @rm -rf $(MODLIB)/kernel 1070 1055 @rm -f $(MODLIB)/source 1071 1056 @mkdir -p $(MODLIB)/kernel 1072 - @ln -s $(srctree) $(MODLIB)/source 1057 + @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source 1073 1058 @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ 1074 1059 rm -f $(MODLIB)/build ; \ 1075 - ln -s $(objtree) $(MODLIB)/build ; \ 1060 + ln -s $(CURDIR) $(MODLIB)/build ; \ 1076 1061 fi 1077 1062 @cp -f $(objtree)/modules.order $(MODLIB)/ 1078 1063 @cp -f $(objtree)/modules.builtin $(MODLIB)/ ··· 1119 1104 1120 1105 # Directories & files removed with 'make mrproper' 1121 1106 MRPROPER_DIRS += include/config usr/include include/generated \ 1122 - arch/*/include/generated .tmp_objdiff 1107 + arch/*/include/generated .tmp_objdiff 1123 1108 MRPROPER_FILES += .config .config.old .version .old_version $(version_h) \ 1124 1109 Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ 1125 1110 signing_key.priv signing_key.x509 x509.genkey \ ··· 1493 1478 $(build)=$(build-dir) $(@:.ko=.o) 1494 1479 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost 1495 1480 1496 - # FIXME Should go into a make.lib or something 1481 + # FIXME Should go into a make.lib or something 1497 1482 # =========================================================================== 1498 1483 1499 1484 quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
+2 -2
arch/powerpc/boot/Makefile
··· 333 333 $(obj)/zImage.initrd.%: vmlinux $(wrapperbits) 334 334 $(call if_changed,wrap,$*,,,$(obj)/ramdisk.image.gz) 335 335 336 - $(obj)/zImage.%: vmlinux $(wrapperbits) 337 - $(call if_changed,wrap,$*) 336 + $(addprefix $(obj)/, $(sort $(filter zImage.%, $(image-y)))): vmlinux $(wrapperbits) 337 + $(call if_changed,wrap,$(subst $(obj)/zImage.,,$@)) 338 338 339 339 # dtbImage% - a dtbImage is a zImage with an embedded device tree blob 340 340 $(obj)/dtbImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb
+1 -2
arch/um/Makefile
··· 111 111 KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig 112 112 113 113 archheaders: 114 - $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \ 115 - ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders 114 + $(Q)$(MAKE) KBUILD_SRC= ARCH=$(HEADER_ARCH) archheaders 116 115 117 116 archprepare: include/generated/user_constants.h 118 117
+7 -27
firmware/Makefile
··· 4 4 5 5 # Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a 6 6 # leading /, it's relative to $(srctree). 7 - fwdir := $(subst ",,$(CONFIG_EXTRA_FIRMWARE_DIR)) 7 + fwdir := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE_DIR)) 8 8 fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter /%,$(fwdir)) 9 9 10 - fw-external-y := $(subst ",,$(CONFIG_EXTRA_FIRMWARE)) 10 + fw-external-y := $(subst $(quote),,$(CONFIG_EXTRA_FIRMWARE)) 11 11 12 12 # There are three cases to care about: 13 13 # 1. Building kernel with CONFIG_FIRMWARE_IN_KERNEL=y -- $(fw-shipped-y) should ··· 138 138 139 139 fw-shipped-all := $(fw-shipped-y) $(fw-shipped-m) $(fw-shipped-) 140 140 141 - # Directories which we _might_ need to create, so we have a rule for them. 142 - firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all)))) 143 - 144 - quiet_cmd_mkdir = MKDIR $(patsubst $(objtree)/%,%,$@) 145 - cmd_mkdir = mkdir -p $@ 146 - 147 141 quiet_cmd_ihex = IHEX $@ 148 142 cmd_ihex = $(OBJCOPY) -Iihex -Obinary $< $@ 149 143 ··· 178 184 include/config/superh32.h include/config/superh64.h \ 179 185 include/config/x86_32.h include/config/x86_64.h) 180 186 181 - # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. 182 - # It'll end up depending on these targets, so make them a PHONY rule which 183 - # depends on _all_ the directories in $(firmware-dirs), and it'll work out OK. 184 - PHONY += $(objtree)/$$(%) $(objtree)/$(obj)/$$(%) 185 - $(objtree)/$$(%) $(objtree)/$(obj)/$$(%): $(firmware-dirs) 186 - @true 187 - 188 - # For the $$(dir %) trick, where we need % to be expanded first. 189 - .SECONDEXPANSION: 190 - 191 - $(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) \ 192 - | $(objtree)/$$(dir %) 187 + $(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) 193 188 $(call cmd,fwbin,$(patsubst %.gen.S,%,$@)) 194 189 $(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \ 195 - include/config/extra/firmware/dir.h | $(objtree)/$$(dir %) 190 + include/config/extra/firmware/dir.h 196 191 $(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@)) 197 192 198 193 # The .o files depend on the binaries directly; the .S files don't. ··· 190 207 191 208 # .ihex is used just as a simple way to hold binary files in a source tree 192 209 # where binaries are frowned upon. They are directly converted with objcopy. 193 - $(obj)/%: $(obj)/%.ihex | $(objtree)/$(obj)/$$(dir %) 210 + $(obj)/%: $(obj)/%.ihex 194 211 $(call cmd,ihex) 195 212 196 213 # Don't depend on ihex2fw if we're installing and it already exists. ··· 209 226 # is actually meaningful, because the firmware has to be loaded in a certain 210 227 # order rather than as a single binary blob. Thus, we convert them into our 211 228 # more compact binary representation of ihex records (<linux/ihex.h>) 212 - $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) 229 + $(obj)/%.fw: $(obj)/%.HEX $(ihex2fw_dep) 213 230 $(call cmd,ihex2fw) 214 231 215 232 # .H16 is our own modified form of Intel HEX, with 16-bit length for records. 216 - $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) | $(objtree)/$(obj)/$$(dir %) 233 + $(obj)/%.fw: $(obj)/%.H16 $(ihex2fw_dep) 217 234 $(call cmd,h16tofw) 218 - 219 - $(firmware-dirs): 220 - $(call cmd,mkdir) 221 235 222 236 obj-y += $(patsubst %,%.gen.o, $(fw-external-y)) 223 237 obj-$(CONFIG_FIRMWARE_IN_KERNEL) += $(patsubst %,%.gen.o, $(fw-shipped-y))
+1 -1
scripts/Makefile
··· 39 39 subdir-$(CONFIG_DTC) += dtc 40 40 41 41 # Let clean descend into subdirs 42 - subdir- += basic kconfig package selinux 42 + subdir- += basic kconfig package
+2 -63
scripts/Makefile.build
··· 50 50 endif 51 51 endif 52 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 += $(call cc-option, -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 - warning-1 += $(call cc-disable-warning, missing-field-initializers) 73 - 74 - # Clang 75 - warning-1 += $(call cc-disable-warning, initializer-overrides) 76 - warning-1 += $(call cc-disable-warning, unused-value) 77 - warning-1 += $(call cc-disable-warning, format) 78 - warning-1 += $(call cc-disable-warning, unknown-warning-option) 79 - warning-1 += $(call cc-disable-warning, sign-compare) 80 - warning-1 += $(call cc-disable-warning, format-zero-length) 81 - warning-1 += $(call cc-disable-warning, uninitialized) 82 - warning-1 += $(call cc-option, -fcatch-undefined-behavior) 83 - 84 - warning-2 := -Waggregate-return 85 - warning-2 += -Wcast-align 86 - warning-2 += -Wdisabled-optimization 87 - warning-2 += -Wnested-externs 88 - warning-2 += -Wshadow 89 - warning-2 += $(call cc-option, -Wlogical-op) 90 - warning-2 += $(call cc-option, -Wmissing-field-initializers) 91 - 92 - warning-3 := -Wbad-function-cast 93 - warning-3 += -Wcast-qual 94 - warning-3 += -Wconversion 95 - warning-3 += -Wpacked 96 - warning-3 += -Wpadded 97 - warning-3 += -Wpointer-arith 98 - warning-3 += -Wredundant-decls 99 - warning-3 += -Wswitch-default 100 - warning-3 += $(call cc-option, -Wpacked-bitfield-compat) 101 - warning-3 += $(call cc-option, -Wvla) 102 - 103 - warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 104 - warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 105 - warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 106 - 107 - ifeq ("$(strip $(warning))","") 108 - $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) 109 - endif 110 - 111 - KBUILD_CFLAGS += $(warning) 112 - endif 113 - 114 53 include scripts/Makefile.lib 115 54 116 55 ifdef host-progs ··· 281 342 $(real-objs-m:.o=.s): modkern_aflags := $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE) 282 343 283 344 quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ 284 - cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< 345 + cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< 285 346 286 347 $(obj)/%.s: $(src)/%.S FORCE 287 348 $(call if_changed_dep,as_s_S) ··· 375 436 $(filter $(addprefix $(obj)/, \ 376 437 $($(subst $(obj)/,,$(@:.o=-objs))) \ 377 438 $($(subst $(obj)/,,$(@:.o=-y)))), $^) 378 - 439 + 379 440 quiet_cmd_link_multi-y = LD $@ 380 441 cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis) 381 442
+67
scripts/Makefile.extrawarn
··· 1 + # ========================================================================== 2 + # 3 + # make W=... settings 4 + # 5 + # W=1 - warnings that may be relevant and does not occur too often 6 + # W=2 - warnings that occur quite often but may still be relevant 7 + # W=3 - the more obscure warnings, can most likely be ignored 8 + # 9 + # $(call cc-option, -W...) handles gcc -W.. options which 10 + # are not supported by all versions of the compiler 11 + # ========================================================================== 12 + 13 + ifeq ("$(origin W)", "command line") 14 + export KBUILD_ENABLE_EXTRA_GCC_CHECKS := $(W) 15 + endif 16 + 17 + ifdef KBUILD_ENABLE_EXTRA_GCC_CHECKS 18 + warning- := $(empty) 19 + 20 + warning-1 := -Wextra -Wunused -Wno-unused-parameter 21 + warning-1 += -Wmissing-declarations 22 + warning-1 += -Wmissing-format-attribute 23 + warning-1 += $(call cc-option, -Wmissing-prototypes) 24 + warning-1 += -Wold-style-definition 25 + warning-1 += $(call cc-option, -Wmissing-include-dirs) 26 + warning-1 += $(call cc-option, -Wunused-but-set-variable) 27 + warning-1 += $(call cc-disable-warning, missing-field-initializers) 28 + 29 + # Clang 30 + warning-1 += $(call cc-disable-warning, initializer-overrides) 31 + warning-1 += $(call cc-disable-warning, unused-value) 32 + warning-1 += $(call cc-disable-warning, format) 33 + warning-1 += $(call cc-disable-warning, unknown-warning-option) 34 + warning-1 += $(call cc-disable-warning, sign-compare) 35 + warning-1 += $(call cc-disable-warning, format-zero-length) 36 + warning-1 += $(call cc-disable-warning, uninitialized) 37 + warning-1 += $(call cc-option, -fcatch-undefined-behavior) 38 + 39 + warning-2 := -Waggregate-return 40 + warning-2 += -Wcast-align 41 + warning-2 += -Wdisabled-optimization 42 + warning-2 += -Wnested-externs 43 + warning-2 += -Wshadow 44 + warning-2 += $(call cc-option, -Wlogical-op) 45 + warning-2 += $(call cc-option, -Wmissing-field-initializers) 46 + 47 + warning-3 := -Wbad-function-cast 48 + warning-3 += -Wcast-qual 49 + warning-3 += -Wconversion 50 + warning-3 += -Wpacked 51 + warning-3 += -Wpadded 52 + warning-3 += -Wpointer-arith 53 + warning-3 += -Wredundant-decls 54 + warning-3 += -Wswitch-default 55 + warning-3 += $(call cc-option, -Wpacked-bitfield-compat) 56 + warning-3 += $(call cc-option, -Wvla) 57 + 58 + warning := $(warning-$(findstring 1, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 59 + warning += $(warning-$(findstring 2, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 60 + warning += $(warning-$(findstring 3, $(KBUILD_ENABLE_EXTRA_GCC_CHECKS))) 61 + 62 + ifeq ("$(strip $(warning))","") 63 + $(error W=$(KBUILD_ENABLE_EXTRA_GCC_CHECKS) is unknown) 64 + endif 65 + 66 + KBUILD_CFLAGS += $(warning) 67 + endif
+12 -14
scripts/Makefile.fwinst
··· 18 18 include scripts/Makefile.host 19 19 20 20 mod-fw := $(fw-shipped-m) 21 - # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the 21 + # If CONFIG_FIRMWARE_IN_KERNEL isn't set, then install the 22 22 # firmware for in-kernel drivers too. 23 23 ifndef CONFIG_FIRMWARE_IN_KERNEL 24 24 mod-fw += $(fw-shipped-y) 25 25 endif 26 26 27 + ifneq ($(KBUILD_SRC),) 28 + # Create output directory if not already present 29 + _dummy := $(shell [ -d $(obj) ] || mkdir -p $(obj)) 30 + 31 + firmware-dirs := $(sort $(addprefix $(objtree)/$(obj)/,$(dir $(fw-external-y) $(fw-shipped-all)))) 32 + # Create directories for firmware in subdirectories 33 + _dummy := $(foreach d,$(firmware-dirs), $(shell [ -d $(d) ] || mkdir -p $(d))) 34 + endif 35 + 27 36 installed-mod-fw := $(addprefix $(INSTALL_FW_PATH)/,$(mod-fw)) 28 37 29 38 installed-fw := $(addprefix $(INSTALL_FW_PATH)/,$(fw-shipped-all)) 30 - installed-fw-dirs := $(sort $(dir $(installed-fw))) $(INSTALL_FW_PATH)/./ 31 - 32 - # Workaround for make < 3.81, where .SECONDEXPANSION doesn't work. 33 - PHONY += $(INSTALL_FW_PATH)/$$(%) install-all-dirs 34 - $(INSTALL_FW_PATH)/$$(%): install-all-dirs 35 - @true 36 - install-all-dirs: $(installed-fw-dirs) 37 - @true 38 39 39 40 quiet_cmd_install = INSTALL $(subst $(srctree)/,,$@) 40 - cmd_install = $(INSTALL) -m0644 $< $@ 41 + cmd_install = mkdir -p $(@D); $(INSTALL) -m0644 $< $@ 41 42 42 - $(installed-fw-dirs): 43 - $(call cmd,mkdir) 44 - 45 - $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% | $(INSTALL_FW_PATH)/$$(dir %) 43 + $(installed-fw): $(INSTALL_FW_PATH)/%: $(obj)/% 46 44 $(call cmd,install) 47 45 48 46 PHONY += __fw_install __fw_modinst FORCE
+1 -1
scripts/Makefile.host
··· 166 166 $(call if_changed,host-cshlib) 167 167 168 168 targets += $(host-csingle) $(host-cmulti) $(host-cobjs)\ 169 - $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) 169 + $(host-cxxmulti) $(host-cxxobjs) $(host-cshlib) $(host-cshobjs) 170 170
+5 -5
scripts/Makefile.lib
··· 27 27 # --------------------------------------------------------------------------- 28 28 # o if we encounter foo/ in $(obj-y), replace it by foo/built-in.o 29 29 # and add the directory to the list of dirs to descend into: $(subdir-y) 30 - # o if we encounter foo/ in $(obj-m), remove it from $(obj-m) 30 + # o if we encounter foo/ in $(obj-m), remove it from $(obj-m) 31 31 # and add the directory to the list of dirs to descend into: $(subdir-m) 32 32 33 33 # Determine modorder. ··· 46 46 47 47 subdir-ym := $(sort $(subdir-y) $(subdir-m)) 48 48 49 - # if $(foo-objs) exists, foo.o is a composite object 49 + # if $(foo-objs) exists, foo.o is a composite object 50 50 multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 51 51 multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m)))) 52 52 multi-used := $(multi-used-y) $(multi-used-m) ··· 91 91 92 92 # These flags are needed for modversions and compiling, so we define them here 93 93 # already 94 - # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will 94 + # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will 95 95 # end up in (or would, if it gets compiled in) 96 96 # Note: Files that end up in two or more modules are compiled without the 97 97 # KBUILD_MODNAME definition. The reason is that any made-up name would ··· 212 212 213 213 # Commands useful for building a boot image 214 214 # =========================================================================== 215 - # 215 + # 216 216 # Use as following: 217 217 # 218 218 # target: source(s) FORCE ··· 226 226 227 227 quiet_cmd_ld = LD $@ 228 228 cmd_ld = $(LD) $(LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) \ 229 - $(filter-out FORCE,$^) -o $@ 229 + $(filter-out FORCE,$^) -o $@ 230 230 231 231 # Objcopy 232 232 # ---------------------------------------------------------------------------
+6 -6
scripts/conmakehash.c
··· 104 104 } 105 105 } 106 106 107 - /* For now we assume the default font is always 256 characters. */ 107 + /* For now we assume the default font is always 256 characters. */ 108 108 fontlen = 256; 109 109 110 110 /* Initialize table */ ··· 236 236 } 237 237 238 238 /* Okay, we hit EOF, now output hash table */ 239 - 239 + 240 240 fclose(ctbl); 241 - 241 + 242 242 243 243 /* Compute total size of Unicode list */ 244 244 nuni = 0; 245 245 for ( i = 0 ; i < fontlen ; i++ ) 246 246 nuni += unicount[i]; 247 - 247 + 248 248 printf("\ 249 249 /*\n\ 250 250 * Do not edit this file; it was automatically generated by\n\ ··· 268 268 else 269 269 printf(", "); 270 270 } 271 - 271 + 272 272 printf("\nu16 dfont_unitable[%d] = \n{\n\t", nuni); 273 - 273 + 274 274 fp0 = 0; 275 275 nent = 0; 276 276 for ( i = 0 ; i < nuni ; i++ )
+2 -2
scripts/kconfig/Makefile
··· 33 33 $< --$@ $(Kconfig) 34 34 35 35 silentoldconfig: $(obj)/conf 36 - $(Q)mkdir -p include/generated 36 + $(Q)mkdir -p include/config include/generated 37 37 $< --$@ $(Kconfig) 38 38 39 39 localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf 40 - $(Q)mkdir -p include/generated 40 + $(Q)mkdir -p include/config include/generated 41 41 $(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config 42 42 $(Q)if [ -f .config ]; then \ 43 43 cmp -s .tmp.config .config || \
+1 -1
scripts/kconfig/streamline_config.pl
··· 589 589 590 590 # Now we need to see if we have to check selects; 591 591 loop_select; 592 - } 592 + } 593 593 594 594 my %setconfigs; 595 595
+2 -2
scripts/mkcompile_h
··· 68 68 69 69 ( echo /\* This file is auto generated, version $VERSION \*/ 70 70 if [ -n "$CONFIG_FLAGS" ] ; then echo "/* $CONFIG_FLAGS */"; fi 71 - 71 + 72 72 echo \#define UTS_MACHINE \"$ARCH\" 73 73 74 74 echo \#define UTS_VERSION \"`echo $UTS_VERSION | $UTS_TRUNCATE`\" ··· 84 84 # recompilations. 85 85 # We don't consider the file changed if only the date/time changed. 86 86 # A kernel config change will increase the generation number, thus 87 - # causing compile.h to be updated (including date/time) due to the 87 + # causing compile.h to be updated (including date/time) due to the 88 88 # changed comment in the 89 89 # first line. 90 90
+4 -11
scripts/mkmakefile
··· 42 42 43 43 MAKEFLAGS += --no-print-directory 44 44 45 - .PHONY: all \$(MAKECMDGOALS) 45 + .PHONY: __sub-make \$(MAKECMDGOALS) 46 46 47 - all := \$(filter-out all Makefile,\$(MAKECMDGOALS)) 47 + __sub-make: 48 + \$(Q)\$(MAKE) \$(MAKEARGS) \$(MAKECMDGOALS) 48 49 49 - all: 50 - \$(Q)\$(MAKE) \$(MAKEARGS) \$(all) 51 - 52 - Makefile:; 53 - 54 - \$(all): all 55 - @: 56 - 57 - %/: all 50 + \$(filter-out __sub-make, \$(MAKECMDGOALS)): __sub-make 58 51 @: 59 52 EOF
+1 -1
scripts/package/builddeb
··· 130 130 cp System.map "$tmpdir/usr/lib/uml/modules/$version/System.map" 131 131 cp $KCONFIG_CONFIG "$tmpdir/usr/share/doc/$packagename/config" 132 132 gzip "$tmpdir/usr/share/doc/$packagename/config" 133 - else 133 + else 134 134 cp System.map "$tmpdir/boot/System.map-$version" 135 135 cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" 136 136 fi
+2 -2
scripts/patch-kernel
··· 27 27 # Nick Holloway <Nick.Holloway@alfie.demon.co.uk>, 2nd January 1995. 28 28 # 29 29 # Added support for handling multiple types of compression. What includes 30 - # gzip, bzip, bzip2, zip, compress, and plaintext. 30 + # gzip, bzip, bzip2, zip, compress, and plaintext. 31 31 # 32 32 # Adam Sulmicki <adam@cfar.umd.edu>, 1st January 1997. 33 33 # ··· 159 159 fi 160 160 # Remove backup files 161 161 find $sourcedir/ '(' -name '*.orig' -o -name '.*.orig' ')' -exec rm -f {} \; 162 - 162 + 163 163 return 0; 164 164 } 165 165