From: Sam Ravnborg <sam@ravnborg.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: linux-kbuild@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Bernd Edlinger <bernd.edlinger@hotmail.de>,
Borislav Petkov <bp@suse.de>,
Michal Marek <michal.lkml@markovi.net>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] kbuild: provide a new place to check necessary host tools
Date: Tue, 16 Oct 2018 17:47:17 +0200 [thread overview]
Message-ID: <20181016154717.GA25717@ravnborg.org> (raw)
In-Reply-To: <1539681053-24388-2-git-send-email-yamada.masahiro@socionext.com>
Hi Masahiro.
Looks good, a few nits below.
Sam
> The top Makefile is too cluttered
So true...
> This adds a new file scripts/Makefile.toolcheck to check additional
> tools depending on the kernel configuration. This check is run
> immediately after syncconfig, i.e., when a user attempts to build
> something with a new set of CONFIG options.
>
> [1] https://patchwork.kernel.org/patch/10516049/
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
The use of toolcheck-y should be documented in Documentation/kbuild/...
>
> Makefile | 1 +
> scripts/Makefile.toolcheck | 35 +++++++++++++++++++++++++++++++++++
> 2 files changed, 36 insertions(+)
> create mode 100644 scripts/Makefile.toolcheck
>
> diff --git a/Makefile b/Makefile
> index bf3786e..23a204a 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -633,6 +633,7 @@ $(KCONFIG_CONFIG) include/config/auto.conf.cmd: ;
> # include/config/auto.conf (which mirrors .config).
> include/config/%.conf: $(KCONFIG_CONFIG) include/config/auto.conf.cmd
> $(Q)$(MAKE) -f $(srctree)/Makefile syncconfig
> + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.toolcheck
> else
> # External modules and some install targets need include/generated/autoconf.h
> # and include/config/auto.conf but do not care if they are up-to-date.
> diff --git a/scripts/Makefile.toolcheck b/scripts/Makefile.toolcheck
> new file mode 100644
> index 0000000..f3c165d
> --- /dev/null
> +++ b/scripts/Makefile.toolcheck
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: GPL-2.0
> +# ===========================================================================
> +# Host tools check
> +# ===========================================================================
> +#
> +# Some additional tools might be required depending on the kernel configuration.
> +# Check if they are installed on the host machine, and if missing, error out
> +# with a user-friendly message.
> +
> +include include/config/auto.conf
> +
> +__toolcheck:
> + @:
> +
> +PHONY += $(toolcheck-y)
> +__toolcheck: $(toolcheck-y)
> +
> +define populate_toolcheck
> +__toolcheck: check_$(1)
> +PHONY += check_$(1)
> +check_$(1):
> + $(Q){ $(chk_$(1)); } >/dev/null 2>&1 || { \
> + echo "*" >&2; \
> + for msg in $(msg_$(1)); \
> + do \
> + echo "* $$$${msg}" >&2; \
> + done; \
> + echo "*" >&2; \
> + /bin/false; \
> + }
Very dense, but usign if [ ... ] may result is somethign that
is a little more readable.
And maybe a litle hint on the usage...
> +$(foreach c, $(toolcheck-y), $(eval $(call populate_toolcheck,$(c))))
Good use of $(eval ...)
next prev parent reply other threads:[~2018-10-16 15:47 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-16 9:10 [PATCH 0/3] kbuild: add scripts/Makefile.toolcheck to check necessary host tools Masahiro Yamada
2018-10-16 9:10 ` [PATCH 1/3] kbuild: provide a new place " Masahiro Yamada
2018-10-16 15:47 ` Sam Ravnborg [this message]
2018-10-16 9:10 ` [PATCH 2/3] objtool: move libelf check out of top Makefile Masahiro Yamada
2018-10-16 14:25 ` Josh Poimboeuf
2018-10-16 15:51 ` Masahiro Yamada
2018-10-16 16:15 ` Josh Poimboeuf
2018-10-19 6:04 ` Masahiro Yamada
2018-10-19 19:28 ` Josh Poimboeuf
2018-10-16 9:10 ` [PATCH 3/3] kbuild: check the presence of lzo and lz4 tools when necessary Masahiro Yamada
2018-10-16 19:54 ` Borislav Petkov
2018-10-17 8:59 ` Masahiro Yamada
2018-10-17 9:10 ` Borislav Petkov
2018-10-17 9:25 ` Masahiro Yamada
2018-10-17 9:47 ` Borislav Petkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181016154717.GA25717@ravnborg.org \
--to=sam@ravnborg.org \
--cc=bernd.edlinger@hotmail.de \
--cc=bp@suse.de \
--cc=jpoimboe@redhat.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.lkml@markovi.net \
--cc=mingo@redhat.com \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).