[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZyaVZhPfiVszWhcp@fjasle.eu>
Date: Sat, 2 Nov 2024 22:11:02 +0100
From: Nicolas Schier <nicolas@...sle.eu>
To: Vegard Nossum <vegard.nossum@...cle.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>, linux-kbuild@...r.kernel.org,
Nathan Chancellor <nathan@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Morten Linderud <morten@...derud.pw>,
Haelwenn Monnier <contact@...odan.eu>, Jann Horn <jannh@...gle.com>,
Kees Cook <kees@...nel.org>,
James Bottomley <James.Bottomley@...senpartnership.com>,
Theodore Ts'o <tytso@....edu>, linux-hardening@...r.kernel.org
Subject: Re: [RFC PATCH 06/11] kbuild: set $dry_run when running in --dry-run
mode
On Mon, Aug 19, 2024 at 06:03:03PM +0200 Vegard Nossum wrote:
> Add a convenience variable that allows us to use 'ifdef dry_run...endif'
> in Makefiles or '[ -v dry_run ]' in shell scripts to test whether make
> was invoked with '-n'.
>
> See [1] for an explanation of this particular construction.
>
> [1]: https://www.gnu.org/software/make/manual/make.html#Testing-Flags
>
> Signed-off-by: Vegard Nossum <vegard.nossum@...cle.com>
> ---
> Makefile | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/Makefile b/Makefile
> index 58f3843ccfac6..953951157ec92 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -22,6 +22,11 @@ $(if $(filter __%, $(MAKECMDGOALS)), \
> PHONY := __all
> __all:
>
> +# Was make invoked with --dry-run/-n? Record this in a convenience variable.
> +ifeq (n,$(findstring n,$(firstword -$(MAKEFLAGS))))
> +export dry_run := 1
> +endif
As in patch 1:
As we still also support make v3.80 to v4.0, please use $(short-opts)
defined around line 27.
> +
> # We are using a recursive build, so we need to do a little thinking
> # to get the ordering right.
> #
> --
> 2.34.1
>
I will have a look at the remaining patches within a few days.
Thanks and kind regards,
Nicolas
Powered by blists - more mailing lists