mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] kbuild: drop dependency on .config for tools/
@ 2026-09-11 10:42 Alexis Lothoré (eBPF Foundation)
  2026-09-11 19:24 ` Nicolas Schier
  0 siblings, 1 reply; 2+ messages in thread
From: Alexis Lothoré (eBPF Foundation) @ 2026-09-11 10:42 UTC (permalink / raw)
  To: Nathan Chancellor, Nicolas Schier
  Cc: ebpf, Thomas Petazzoni, Masahiro Yamada, linux-kbuild,
	linux-kernel, Bastien Curutchet,
	Alexis Lothoré (eBPF Foundation)

When trying to build some tooling from tools/ in an unconfigured kernel
tree, the build fails to start because of missing .config:

  $ make tools/bpf
  ***
  *** Configuration file ".config" not found!
  ***
  *** Please run some configurator (e.g. "make oldconfig" or
  *** "make menuconfig" or "make xconfig").
  ***
  /home/alexis/src/linux/Makefile:810: include/config/auto.conf: No such file or directory
  make[1]: *** [/home/alexis/src/linux/Makefile:892: .config] Error 1
  make: *** [Makefile:248: __sub-make] Error 2

The failure is due to the tools/<foo> targets having need-config=1 set.
With a proper .config present, a standard `make tools/bpf` works, but:
  - those tools don't need a .config to build and run, they are built
    independently of the kernel configuration
  - when trying to build some tools in a specific output directory
    (O=foo), we still end up having to configure a kernel first in this
    directory

Rather than having to systematically configure the kernel to only build
those tools, add the tools/% pattern to the no-dot-config-targets listing.

Signed-off-by: Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>
---
 Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 570f0c68aadd..eb4bdf4a52cc 100644
--- a/Makefile
+++ b/Makefile
@@ -298,7 +298,8 @@ no-dot-config-targets := $(clean-targets) \
 			 %asm-generic kernelversion %src-pkg dt_binding_check \
 			 dt_style_selftest \
 			 outputmakefile rustavailable rustfmt rustfmtcheck \
-			 run-command
+			 run-command \
+			 tools/%
 no-sync-config-targets := $(no-dot-config-targets) %install modules_sign kernelrelease \
 			  image_name
 single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.rsi %.s %/

---
base-commit: 51794b107d54b3c9a8ebbe12a3b81d8495bd482c
change-id: 20260911-tools-build-output-18157e524114

Best regards,
--  
Alexis Lothoré (eBPF Foundation) <alexis.lothore@bootlin.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-11 19:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-11 10:42 [PATCH] kbuild: drop dependency on .config for tools/ Alexis Lothoré (eBPF Foundation)
2026-09-11 19:24 ` Nicolas Schier

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®