From: Nicolas Schier <nicolas@fjasle.eu>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kbuild: replace $(if A,A,B) with $(or A,B)
Date: Thu, 10 Feb 2022 22:00:56 +0100 [thread overview]
Message-ID: <YgV9CHKpS/ptY3my@bergen.fjasle.eu> (raw)
In-Reply-To: <20220210093342.2118196-1-masahiroy@kernel.org>
På to. 10. feb. 2022 kl. 18.33 +0000 skrev Masahiro Yamada:
> Date: Thu, 10 Feb 2022 18:33:42 +0900
> From: Masahiro Yamada <masahiroy@kernel.org>
> To: linux-kbuild@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org, Masahiro Yamada <masahiroy@kernel.org>
> Subject: [PATCH] kbuild: replace $(if A,A,B) with $(or A,B)
> Message-Id: <20220210093342.2118196-1-masahiroy@kernel.org>
> X-Mailer: git-send-email 2.32.0
> X-Mailing-List: linux-kbuild@vger.kernel.org
>
> $(or ...) is available since GNU Make 3.81, and useful to shorten the
> code in some places.
>
> Covert as follows:
>
> $(if A,A,B) --> $(or A,B)
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
> Makefile | 8 ++++----
> scripts/Makefile.build | 3 +--
> scripts/Makefile.clean | 2 +-
> scripts/Makefile.lib | 4 ++--
> tools/bpf/bpftool/Makefile | 4 ++--
> tools/build/Makefile | 2 +-
> tools/counter/Makefile | 2 +-
> tools/gpio/Makefile | 2 +-
> tools/hv/Makefile | 2 +-
> tools/iio/Makefile | 2 +-
> tools/lib/api/Makefile | 2 +-
> tools/lib/bpf/Makefile | 2 +-
> tools/lib/perf/Makefile | 2 +-
> tools/lib/subcmd/Makefile | 2 +-
> tools/objtool/Makefile | 2 +-
> tools/pci/Makefile | 2 +-
> tools/perf/Makefile.perf | 4 ++--
> tools/power/x86/intel-speed-select/Makefile | 2 +-
> tools/scripts/utilities.mak | 2 +-
> tools/spi/Makefile | 6 +++---
> tools/tracing/rtla/Makefile | 2 +-
> tools/usb/Makefile | 2 +-
> 22 files changed, 30 insertions(+), 31 deletions(-)
>
[...]
> diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile
> index f947b61b2107..df1f6ff7bc49 100644
> --- a/tools/lib/bpf/Makefile
> +++ b/tools/lib/bpf/Makefile
> @@ -60,7 +60,7 @@ ifndef VERBOSE
> VERBOSE = 0
> endif
>
> -INCLUDES = -I$(if $(OUTPUT),$(OUTPUT),.) \
> +INCLUDES = -I$(or $(OUTPUT),.) \
> -I$(srctree)/tools/include -I$(srctree)/tools/include/uapi
I think I'd have shortened the whitespaces before the stray backslash.
>
> export prefix libdir src obj
> diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile
> index 08fe6e3c4089..2d985d6a3a96 100644
> --- a/tools/lib/perf/Makefile
> +++ b/tools/lib/perf/Makefile
> @@ -153,7 +153,7 @@ $(TESTS_STATIC): $(TESTS_IN) $(LIBPERF_A) $(LIBAPI)
> $(QUIET_LINK)$(CC) -o $@ $^
>
> $(TESTS_SHARED): $(TESTS_IN) $(LIBAPI)
> - $(QUIET_LINK)$(CC) -o $@ -L$(if $(OUTPUT),$(OUTPUT),.) $^ -lperf
> + $(QUIET_LINK)$(CC) -o $@ -L$(if $(OUTPUT),.) $^ -lperf
$(if ...) -> $(or ...)
With this one fixed:
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Thanks for that patch. I have never seen $(or) in use before but it
definitively makes sense!
Kind regards,
Nicolas
--
epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc
↳ gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f
-- frykten for herren er opphav til kunnskap --
next prev parent reply other threads:[~2022-02-10 21:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-10 9:33 Masahiro Yamada
2022-02-10 21:00 ` Nicolas Schier [this message]
2022-02-11 5:14 ` Masahiro Yamada
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=YgV9CHKpS/ptY3my@bergen.fjasle.eu \
--to=nicolas@fjasle.eu \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
/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
all inboxes | Powered by JetHome®