linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.masahiro@socionext.com>
To: linux-kbuild@vger.kernel.org
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 3/4] kbuild: refactor part-of-module
Date: Tue, 11 Dec 2018 21:01:55 +0900	[thread overview]
Message-ID: <1544529716-4917-3-git-send-email-yamada.masahiro@socionext.com> (raw)
In-Reply-To: <1544529716-4917-1-git-send-email-yamada.masahiro@socionext.com>

Use $(foreach ...) to make it shorter.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 scripts/Makefile.build | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index f26ae45..321b5b7 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -94,17 +94,15 @@ endif
 # ---------------------------------------------------------------------------
 
 # Default is built-in, unless we know otherwise
+$(foreach x, i lst o s, $(patsubst %.o,%.$(x),$(real-obj-m))): \
+	part-of-module := y
+
 modkern_cflags =                                          \
 	$(if $(part-of-module),                           \
 		$(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \
 		$(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL))
 quiet_modtag = $(if $(part-of-module),[M],   )
 
-$(real-obj-m)        : part-of-module := y
-$(real-obj-m:.o=.i)  : part-of-module := y
-$(real-obj-m:.o=.s)  : part-of-module := y
-$(real-obj-m:.o=.lst): part-of-module := y
-
 quiet_cmd_cc_s_c = CC $(quiet_modtag)  $@
 cmd_cc_s_c       = $(CC) $(c_flags) $(DISABLE_LTO) -fverbose-asm -S -o $@ $<
 
-- 
2.7.4


  parent reply	other threads:[~2018-12-11 12:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-11 12:01 [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) Masahiro Yamada
2018-12-11 12:01 ` [PATCH 2/4] kbuild: refactor quiet_modtag Masahiro Yamada
2018-12-11 12:01 ` Masahiro Yamada [this message]
2018-12-11 12:01 ` [PATCH 4/4] kbuild: handle part-of-module correctly for *.ll and *.symtypes Masahiro Yamada
2018-12-16 15:40 ` [PATCH 1/4] kbuild: remove redundant quiet_modtag for $(obj-m) 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=1544529716-4917-3-git-send-email-yamada.masahiro@socionext.com \
    --to=yamada.masahiro@socionext.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    /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;
as well as URLs for NNTP newsgroup(s).