[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5c40293a-a24a-2c85-e7ef-a08a8c732d19@infradead.org>
Date: Mon, 23 Nov 2020 10:03:20 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: Masahiro Yamada <masahiroy@...nel.org>,
linux-kbuild@...r.kernel.org
Cc: Jonathan Corbet <corbet@....net>,
Michal Marek <michal.lkml@...kovi.net>,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] kbuild: doc: document subdir-y syntax
On 11/22/20 8:54 PM, Masahiro Yamada wrote:
> There is no explanation about subdir-y.
>
> Let's document it.
>
> Signed-off-by: Masahiro Yamada <masahiroy@...nel.org>
> ---
>
> Documentation/kbuild/makefiles.rst | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/Documentation/kbuild/makefiles.rst b/Documentation/kbuild/makefiles.rst
> index 159e470f2616..6332b9ca7942 100644
> --- a/Documentation/kbuild/makefiles.rst
> +++ b/Documentation/kbuild/makefiles.rst
> @@ -319,6 +319,20 @@ more details, with real examples.
> that directory specifies obj-y, those objects will be left orphan.
> It is very likely a bug of the Makefile or of dependencies in Kconfig.
>
> + 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
> + Kbuild descend into subdirectories to build tools.
> +
> + Examples::
> +
> + subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins
> + subdir-$(CONFIG_MODVERSIONS) += genksyms
> + subdir-$(CONFIG_SECURITY_SELINUX) += selinux
> +
> + Unlike obj-y/m, subdir-y/m does not need the trailing slash since this
> + syntax is always used for directories.
> +
Just curious: Is a trailing slash allowed here? say for consistency?
> It is good practice to use a `CONFIG_` variable when assigning directory
> names. This allows kbuild to totally skip the directory if the
> corresponding `CONFIG_` option is neither 'y' nor 'm'.
>
Reviewed-by: Randy Dunlap <rdunlap@...radead.org>
thanks.
--
~Randy
Powered by blists - more mailing lists