From: Rob Herring <robh@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Saravana Kannan <saravanak@kernel.org>
Cc: David Heidelberg <david@ixit.cz>, Arnd Bergmann <arnd@arndb.de>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v3 2/2] kbuild: Support directory targets for building DTBs
Date: Thu, 8 Oct 2026 10:38:37 -0500 [thread overview]
Message-ID: <20261008153837.GC183998-robh@kernel.org> (raw)
In-Reply-To: <20261007-dtb-dirs-v3-v3-2-b3ab32b64fa6@kernel.org>
On Wed, Oct 07, 2026 at 01:39:41PM -0500, Rob Herring (Arm) wrote:
> It is useful to be able to build all the DTBs for a vendor. One can list
> all the .dts files in a directory and convert those to %.dtb targets,
> but that doesn't work for base+overlay DTB targets.
>
> The 'dtbs' and 'dtbs_check' targets can use the directory rule targets
> as well which avoids different make paths for building DTBs.
>
> Assisted-by: LLM
> Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
> ---
> v3:
> - Reworked on top of single target rule for %.dtb
> - Make dtbs target use directory rule.
> - Move adding boot/dts subdir out of the arch code. Now supported on
> every arch (not that useful without vendor dirs).
> - Removed the need to look at MAKECMDGOALS
> - Fixed unnecessary rebuilding DT base+overlay targets
> - Link to v2: https://lore.kernel.org/all/20251120204812.1983452-4-robh@kernel.org/
>
> v2:
> - Convert arm, mips and riscv. The other DT enabled arches don't have
> vendor directories.
> - Link to v1: https://lore.kernel.org/all/20251113225952.867138-1-robh@kernel.org/
> ---
> Makefile | 8 ++++----
> scripts/Makefile.build | 7 +++++++
> scripts/Makefile.dtbs | 2 ++
> 3 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index c307ee9293bc..75d290c2b7d8 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1664,8 +1664,8 @@ dtbindingtree := Documentation/devicetree/bindings
> ifneq ($(dtstree),)
>
> PHONY += dtbs dtbs_prepare dtbs_install dtbs_check
> -dtbs: dtbs_prepare
> - $(Q)$(MAKE) $(build)=$(dtstree) need-dtbslist=1
> +dtbs:
> + $(Q)$(MAKE) $(dtstree)/
>
> # include/config/kernel.release is actually needed when installing DTBs because
> # INSTALL_DTBS_PATH contains $(KERNELRELEASE). However, we do not want to make
> @@ -2216,7 +2216,7 @@ single-goals := $(addprefix $(build-dir)/, $(single-no-ko))
>
> # DT-only targets need host tools, but no architecture-specific preparation.
> ifneq ($(dtstree),)
> -single-dt-patterns := $(addprefix $(dtstree)/,%.dtb %.dtbo)
> +single-dt-patterns := $(dtstree)/ $(addprefix $(dtstree)/,%.dtb %.dtbo %/)
> ifeq ($(filter-out $(single-dt-patterns),$(single-no-ko)),)
> single-build-prep := dtbs_prepare
> endif
> @@ -2234,7 +2234,7 @@ prepare: outputmakefile
> # Error messages still appears in the original language
> PHONY += $(build-dir)
> $(build-dir): $(single-build-prep)
> - $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 $(single-goals)
> + $(Q)$(MAKE) $(build)=$@ need-builtin=1 need-modorder=1 need-dtbslist=1 $(single-goals)
sashiko points out that this creates dtblist files in every directory.
Will make it conditional on having DTB targets.
Rob
next prev parent reply other threads:[~2026-10-08 15:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-07 18:39 [PATCH v3 0/2] kbuild: Support directory targets for DTBs Rob Herring (Arm)
2026-10-07 18:39 ` [PATCH v3 1/2] kbuild: Convert %.dtb(o) targets to single target rules Rob Herring (Arm)
2026-10-13 7:29 ` Nicolas Schier
2026-10-07 18:39 ` [PATCH v3 2/2] kbuild: Support directory targets for building DTBs Rob Herring (Arm)
2026-10-07 19:03 ` sashiko-bot
2026-10-08 15:38 ` Rob Herring [this message]
2026-10-13 7:29 ` Nicolas Schier
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=20261008153837.GC183998-robh@kernel.org \
--to=robh@kernel.org \
--cc=arnd@arndb.de \
--cc=david@ixit.cz \
--cc=devicetree@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=saravanak@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.