mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vincent Mailhol <mailhol@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>, Nicolas Schier <nsc@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	 Vincent Mailhol <mailhol@kernel.org>
Subject: [PATCH 3/3] kbuild: move scripts/mod target out of single-build
Date: Wed, 11 Nov 2026 14:41:05 +0100	[thread overview]
Message-ID: <20261111-reduce-single-build-dependencies-v1-3-7196ca986a85@kernel.org> (raw)
In-Reply-To: <20261111-reduce-single-build-dependencies-v1-0-7196ca986a85@kernel.org>

The scripts/mod target is currently set as a preparation dependency.
However, this is not needed to compile, for example, a single object.

Add a new modpost_prepare target for scripts/mod and make in-tree
modpost and modules_prepare depend on it so that the prepare target does
not trigger that dependency anymore.

Signed-off-by: Vincent Mailhol <mailhol@kernel.org>
---
 Makefile | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 2c1289a44c56..93236f310f08 100644
--- a/Makefile
+++ b/Makefile
@@ -1405,7 +1405,7 @@ scripts: scripts_basic scripts_dtc
 # archprepare is used in arch Makefiles and when processed asm symlink,
 # version.h and scripts_basic is processed / created.
 
-PHONY += prepare archprepare
+PHONY += prepare archprepare modpost_prepare
 
 archprepare: outputmakefile archheaders archscripts scripts include/config/kernel.release \
 	asm-generic $(version_h) include/generated/utsrelease.h \
@@ -1414,6 +1414,8 @@ archprepare: outputmakefile archheaders archscripts scripts include/config/kerne
 
 prepare0: archprepare
 	$(Q)$(MAKE) $(build)=. prepare $(if $(single-build),,prepare_checks)
+
+modpost_prepare: archprepare
 	$(Q)$(MAKE) $(build)=scripts/mod
 
 # All the preparing..
@@ -1765,7 +1767,7 @@ endif
 modules: modules_prepare
 
 # Target to prepare building external modules
-modules_prepare: prepare
+modules_prepare: prepare modpost_prepare
 	$(Q)$(MAKE) $(build)=scripts scripts/module.lds
 
 endif # CONFIG_MODULES
@@ -2189,7 +2191,8 @@ KBUILD_MODULES :=
 endif # CONFIG_MODULES
 
 PHONY += modpost
-modpost: $(if $(single-build),, $(if $(KBUILD_BUILTIN), vmlinux.o)) \
+modpost: $(if $(KBUILD_EXTMOD),,modpost_prepare) \
+	 $(if $(single-build),, $(if $(KBUILD_BUILTIN), vmlinux.o)) \
 	 $(if $(KBUILD_MODULES), modules_check)
 	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 

-- 
2.56.1


      parent reply	other threads:[~2026-11-11 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 13:41 [PATCH 0/3] kbuild: reduce single-build dependencies Vincent Mailhol
2026-11-11 13:41 ` [PATCH 1/3] kbuild: make rq-offsets-file an explicit preparation dependency Vincent Mailhol
2026-11-11 13:41 ` [PATCH 2/3] kbuild: move preparation checks out of single-build Vincent Mailhol
2026-11-11 13:41 ` Vincent Mailhol [this message]

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=20261111-reduce-single-build-dependencies-v1-3-7196ca986a85@kernel.org \
    --to=mailhol@kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=nsc@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®