[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1518338429-5587-1-git-send-email-yamada.masahiro@socionext.com>
Date: Sun, 11 Feb 2018 17:40:29 +0900
From: Masahiro Yamada <yamada.masahiro@...ionext.com>
To: linux-kbuild@...r.kernel.org
Cc: Sam Ravnborg <sam@...nborg.org>,
Michal Marek <michal.lkml@...kovi.net>,
Thomas Meyer <thomas@...3r.de>,
Masahiro Yamada <yamada.masahiro@...ionext.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH] kbuild: process mixture of clean/build targets one by one
I sometimes receive a question why "make -j<N> clean all" does not
work. It is actually possible to make it work by handling targets
one by one.
Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
---
Makefile | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index cd9145c..31d138e 100644
--- a/Makefile
+++ b/Makefile
@@ -220,7 +220,8 @@ export srctree objtree VPATH
version_h := include/generated/uapi/linux/version.h
old_version_h := include/linux/version.h
-no-dot-config-targets := clean mrproper distclean \
+clean-targets := %clean mrproper cleandocs
+no-dot-config-targets := $(clean-targets) \
cscope gtags TAGS tags help% %docs check% coccicheck \
$(version_h) headers_% archheaders archscripts \
kernelversion %src-pkg
@@ -243,6 +244,14 @@ ifeq ($(KBUILD_EXTMOD),)
endif
endif
endif
+
+# For "make -j clean all", "make -j mrproper defconfig all", etc.
+ifneq ($(filter $(clean-targets),$(MAKECMDGOALS)),)
+ ifneq ($(filter-out $(clean-targets),$(MAKECMDGOALS)),)
+ mixed-targets := 1
+ endif
+endif
+
# install and modules_install need also be processed one by one
ifneq ($(filter install,$(MAKECMDGOALS)),)
ifneq ($(filter modules_install,$(MAKECMDGOALS)),)
--
2.7.4
Powered by blists - more mailing lists