[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=VKoJs=TEh=ddHLOE4b-p3BC5e30PCcgxtqqyEuy6fMkw@mail.gmail.com>
Date: Mon, 9 Oct 2017 15:03:24 -0700
From: Doug Anderson <dianders@...omium.org>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Sam Ravnborg <sam@...nborg.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/4] kbuild: re-order the code to not parse unnecessary variables
Hi,
On Tue, Oct 3, 2017 at 8:56 PM, Masahiro Yamada
<yamada.masahiro@...ionext.com> wrote:
> The top Makefile is divided into some sections such as mixed targets,
> config targets, build targets, etc.
>
> When we build mixed targets, Kbuild just invokes submake to process
> them one by one. In this case, compiler-related variables like CC,
> KBUILD_CFLAGS, etc. are unneeded.
>
> Check what kind of targets we are building first, then parse necessary
> variables for building them.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> ---
>
> Makefile | 233 ++++++++++++++++++++++++++++++++-------------------------------
> 1 file changed, 118 insertions(+), 115 deletions(-)
I'm even further outside my comfort zone with this big of a change,
but I will say that as far as I can tell this seems like a good
change. If it were me I'd have probably broken it up into several
tinier changes that were each massively easy to check/verify, but
presumably for those who know the Makefile better then rolling them
together is fine. ;)
I're spent some time reviewing this (not tons--maybe an hour or so),
but IMHO I don't know this well enough to add a Reviewed-by tag.
> diff --git a/Makefile b/Makefile
> index 39a7c03..a4fd682 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -186,15 +186,6 @@ ifeq ("$(origin M)", "command line")
> KBUILD_EXTMOD := $(M)
> endif
>
> -# If building an external module we do not care about the all: rule
> -# but instead _all depend on modules
> -PHONY += all
> -ifeq ($(KBUILD_EXTMOD),)
> -_all: all
> -else
> -_all: modules
> -endif
> -
> ifeq ($(KBUILD_SRC),)
> # building in the source tree
> srctree := .
> @@ -206,6 +197,9 @@ else
> srctree := $(KBUILD_SRC)
> endif
> endif
> +
> +export KBUILD_CHECKSRC KBUILD_EXTMOD KBUILD_SRC
The old Makefile also used to export KBUILD_SRC, but I'm not sure why.
Shouldn't this be implicit because KBUILD_SRC always comes from a
command line parameter or environment variable?
-Doug
Powered by blists - more mailing lists