Re: [PATCH 1/2] Makefile: make sure KCFLAGS options are at the end

From: Sam Ravnborg
Date: Fri May 04 2012 - 04:56:35 EST


On Fri, May 04, 2012 at 10:42:34AM +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <artem.bityutskiy@xxxxxxxxxxxxxxx>
>
> When I build the kernel like this:
>
> $ make W=1 KCFLAGS="-Wno-sign-compare"
>
> the "-Wno-sign-compare" option is ignore. The reason is that we append gcc
> options associated with W=1 _after_ KCFLAGS, so W=1 overrides my KCFLAGS
> options. This patch tries to fix the issue by moving the "W=[123]" stiff
> from "scripts/Makefile.build" to the main Maikefile. This fixes the issue
> as well as this should be a small improvent because "scripts/Makefile.build"
> is parsed by make many times (I think for each file), bue we do not need
> to re-assign all the warnings stuff so many times - it is enough to do it
> only once.

Moving all the W=... support out of Makefile.build is a good thing,
as we really should do the evaluation only once.

But I detest that this is added to the top-level Makefile.
The top-level Makefile is full of all sort of strange stuff
already and very hard to navigate / update for this reason.

How about introducing a new file : scripts/Kbuild.config
This file should be included only _once_ from the top-level Makefile.
And it should contains all the trivial assignments to
CC, CFLAGS, etc...

Including exporting of variables so they a visible in sub-makes.

First step could be to move the W=... support, and then it could be
gradually extended.

Michal - any comments on this?

Sam
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/