From: Wei Yang <richard.weiyang@gmail.com>
To: masahiroy@kernel.org, nathan@kernel.org, nicolas@fjasle.eu
Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
Wei Yang <richard.weiyang@gmail.com>,
Miguel Ojeda <ojeda@kernel.org>
Subject: [PATCH] kbuild: take vmlinux.[ao] out of single-targets
Date: Mon, 15 Jan 2024 00:16:06 +0000 [thread overview]
Message-ID: <20240115001606.15477-1-richard.weiyang@gmail.com> (raw)
For current kernel, when we make vmlinux.a or vmlinux.o, following
message would display.
$make vmlinux.o
/dir/to/kernel/Makefile:1887: warning: overriding recipe for target 'vmlinux.o'
/dir/to/kernel/Makefile:1138: warning: ignoring old recipe for target 'vmlinux.o'
CALL scripts/checksyscalls.sh
DESCEND objtool
INSTALL libsubcmd_headers
make[2]: Nothing to be done for 'vmlinux.o'.
The reason is vmlinux.[ao] is treated as single target, while the rule
is written in root Makefile.
This patch fixes this by take them out of single-targets.
Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Masahiro Yamada <masahiroy@kernel.org>
CC: Miguel Ojeda <ojeda@kernel.org>
CC: Nathan Chancellor <nathan@kernel.org>
---
Makefile | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index f1b2fd977275..66fb08f6d971 100644
--- a/Makefile
+++ b/Makefile
@@ -280,6 +280,7 @@ no-dot-config-targets := $(clean-targets) \
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 %.symtypes %/
+no-single-targets := vmlinux.o vmlinux.a
config-build :=
mixed-build :=
@@ -315,11 +316,14 @@ ifeq ($(KBUILD_EXTMOD),)
endif
# We cannot build single targets and the others at the same time
-ifneq ($(filter $(single-targets), $(MAKECMDGOALS)),)
+ifneq ($(filter-out $(no-single-targets), $(filter $(single-targets), $(MAKECMDGOALS))),)
single-build := 1
ifneq ($(filter-out $(single-targets), $(MAKECMDGOALS)),)
mixed-build := 1
endif
+ ifneq ($(filter $(no-single-targets), $(MAKECMDGOALS)),)
+ mixed-build := 1
+ endif
endif
# For "make -j clean all", "make -j mrproper defconfig all", etc.
--
2.34.1
next reply other threads:[~2024-01-15 0:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-15 0:16 Wei Yang [this message]
2024-01-16 11:00 ` [PATCH] kbuild: take vmlinux.[ao] out of single-targets Masahiro Yamada
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=20240115001606.15477-1-richard.weiyang@gmail.com \
--to=richard.weiyang@gmail.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=nathan@kernel.org \
--cc=nicolas@fjasle.eu \
--cc=ojeda@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.