From: Alexander Lobakin <aleksander.lobakin@intel.com>
To: Masahiro Yamada <masahiroy@kernel.org>, David Gow <davidgow@google.com>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Nicolas Schier <nicolas@fjasle.eu>,
"Jonathan Corbet" <corbet@lwn.net>,
Sadiya Kazi <sadiyakazi@google.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Brendan Higgins <brendanhiggins@google.com>,
<linux-kbuild@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Documentation: kbuild: Add note about using (subst m,y)
Date: Tue, 28 Feb 2023 16:15:17 +0100 [thread overview]
Message-ID: <e8addca3-e539-110c-ea2b-9a4921a45d71@intel.com> (raw)
In-Reply-To: <CAK7LNASBznyHmAwSRApOHw_6dyAXFuskmtKav65xFwKZdvNWJw@mail.gmail.com>
From: Masahiro Yamada <masahiroy@kernel.org>
Date: Tue, 28 Feb 2023 17:30:09 +0900
> On Tue, Feb 28, 2023 at 12:13 PM David Gow <davidgow@google.com> wrote:
[...]
>> +Example::
>> +
>> + #drivers/Makefile
>> + obj-$(subst m,y,$(CONFIG_HYPERV)) += hv/
>> +
>
>
> I think many subsystems simply do
>
> obj-y += hv/
This creates a ton of empty built-in.a, each of them is listed in the
Kbuild output. Someone may think that if a directory contains
built-in.a, then something was built there. Sure it's their problems,
but I'd prefer to not pollute the log and built-in.a contents when
possible (empty files are still listed there IIRC).
>
>
> I do not think we need to advertise hyperv's way
> since it does not look very pretty.
>
>
>
>
>
>
>
> Mostly, it looks like this:
>
>
> obj-y += kunit/
>
> and
>
> obj-$(CONFIG_KUNIT_HOOK) += hook.o
>
>
>
>
>
>
>
> Bikeshed:
>
> I think Linus' suggestion is OK, but
> the BSD style seems less ugly,
> of course, that is just a matter of style.
>
>
> obj-$(CONFIG_HYPERV:m=y) += kunit/
I'd vote for this one, it's compact and readable.
>
>
>
>
>> Kbuild also supports dedicated syntax, subdir-y and subdir-m, for
>> descending into subdirectories. It is a good fit when you know they
>> do not contain kernel-space objects at all. A typical usage is to let
>> --
>> 2.39.2.722.g9855ee24e9-goog
>>
>
>
> --
> Best Regards
> Masahiro Yamada
>
Thanks,
Olek
next prev parent reply other threads:[~2023-02-28 15:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-28 3:13 [PATCH] Documentation: kbuild: Add note about using (subst m,y) David Gow
2023-02-28 8:30 ` Masahiro Yamada
2023-02-28 15:15 ` Alexander Lobakin [this message]
2023-02-28 16:25 ` 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=e8addca3-e539-110c-ea2b-9a4921a45d71@intel.com \
--to=aleksander.lobakin@intel.com \
--cc=brendanhiggins@google.com \
--cc=corbet@lwn.net \
--cc=davidgow@google.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=nicolas@fjasle.eu \
--cc=sadiyakazi@google.com \
--cc=torvalds@linux-foundation.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