summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2021-05-12 08:52:00 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2021-05-24 05:06:51 +0200
commit1bb0b18a06dceee1fdc32161a72e28eab6f011c4 (patch)
treeec5307b8cb4f8ebf542d28cc893463216ad78298 /Makefile
parentMakefile: extend 32B aligned debug option to 64B aligned (diff)
downloadlinux-1bb0b18a06dceee1fdc32161a72e28eab6f011c4.tar.xz
linux-1bb0b18a06dceee1fdc32161a72e28eab6f011c4.zip
kbuild: hide tools/ build targets from external module builds
The tools/ directory only exists in the kernel source tree, not in external modules. Do not expose the meaningless targets to external modules. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 16 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index bc59bc6e1701..034a36ece49d 100644
--- a/Makefile
+++ b/Makefile
@@ -1352,6 +1352,22 @@ scripts_unifdef: scripts_basic
$(Q)$(MAKE) $(build)=scripts scripts/unifdef
# ---------------------------------------------------------------------------
+# Tools
+
+# Clear a bunch of variables before executing the submake
+ifeq ($(quiet),silent_)
+tools_silent=s
+endif
+
+tools/: FORCE
+ $(Q)mkdir -p $(objtree)/tools
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
+
+tools/%: FORCE
+ $(Q)mkdir -p $(objtree)/tools
+ $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
+
+# ---------------------------------------------------------------------------
# Kernel selftest
PHONY += kselftest
@@ -1951,20 +1967,6 @@ kernelversion:
image_name:
@echo $(KBUILD_IMAGE)
-# Clear a bunch of variables before executing the submake
-
-ifeq ($(quiet),silent_)
-tools_silent=s
-endif
-
-tools/: FORCE
- $(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/
-
-tools/%: FORCE
- $(Q)mkdir -p $(objtree)/tools
- $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
-
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
cmd_rmfiles = rm -rf $(rm-files)