lkml.org 
[lkml]   [2018]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/4] kbuild: refactor part-of-module
Date
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
\
 
 \ /
  Last update: 2018-12-11 13:02    [W:0.103 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site