From 4a5838ad9d2d4f7354a310982483f4c76aa0abeb Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Tue, 1 Mar 2011 09:35:29 +0100 Subject: kbuild: Add extra gcc checks Add a 'W=1' Makefile switch which adds additional checking per build object. The idea behind this option is targeted at developers who, in the process of writing their code, want to do the occasional make W=1 [target.o] and let gcc do more extensive code checking for them. Then, they could eyeball the output for valid gcc warnings about various bugs/discrepancies which are not reported during the normal build process. For more background information and a use case, read through this thread: http://marc.info/?l=kernel-janitors&m=129802065918147&w=2 Cc: Michal Marek Cc: linux-kbuild@vger.kernel.org Acked-by: Sam Ravnborg Acked-by: Ingo Molnar Signed-off-by: Borislav Petkov Signed-off-by: Michal Marek --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index abb49bf..2b1e37d 100644 --- a/Makefile +++ b/Makefile @@ -102,6 +102,10 @@ ifeq ("$(origin O)", "command line") KBUILD_OUTPUT := $(O) endif +ifeq ("$(origin W)", "command line") + export KBUILD_ENABLE_EXTRA_GCC_CHECKS := 1 +endif + # That's our default target when none is given on the command line PHONY := _all _all: @@ -1262,6 +1266,7 @@ help: @echo ' make O=dir [targets] Locate all output files in "dir", including .config' @echo ' make C=1 [targets] Check all c source with $$CHECK (sparse by default)' @echo ' make C=2 [targets] Force check of all c source with $$CHECK' + @echo ' make W=1 [targets] Enable extra gcc checks' @echo '' @echo 'Execute "make" or "make all" to build all targets marked with [*] ' @echo 'For further info see the ./README file' -- cgit v1.1 From e1b702cf224df446b4ce0416dfb02858e7cc068b Mon Sep 17 00:00:00 2001 From: Mike Waychison Date: Mon, 14 Mar 2011 23:34:25 -0700 Subject: KBuild: silence "'scripts/unifdef' is up to date." While changing our build system over to use the headers_install target as part of our klibc build, the following message started showing up in our logs: make[2]: `scripts/unifdef' is up to date. It turns out that the build blindly invokes a recursive make on this target, which causes make to emit this message when the target is already up to date. This isn't seen for most targets as the rest of the build relies primarily on the default target and on PHONY targets when invoking make recursively. Silence the above message when building unifdef as part of headers_install by hiding it behind a new PHONY target called "build_unifdef" that has an empty recipe. Signed-off-by: Mike Waychison Acked-by: WANG Cong Signed-off-by: Michal Marek --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 2b1e37d..0bf29dc 100644 --- a/Makefile +++ b/Makefile @@ -1022,7 +1022,7 @@ hdr-dst = $(if $(KBUILD_HEADERS), dst=include/asm-$(hdr-arch), dst=include/asm) PHONY += __headers __headers: include/linux/version.h scripts_basic FORCE - $(Q)$(MAKE) $(build)=scripts scripts/unifdef + $(Q)$(MAKE) $(build)=scripts build_unifdef PHONY += headers_install_all headers_install_all: -- cgit v1.1