Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586239 > unrolled thread

[PATCH] kbuild: strip the last slash in KBUILD_EXTMOD

Started byWei Yang <richard.weiyang@gmail.com>
First post2017-02-22 16:10 +0100
Last post2017-02-22 16:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] kbuild: strip the last slash in KBUILD_EXTMOD Wei Yang <richard.weiyang@gmail.com> - 2017-02-22 16:10 +0100

#1586239 — [PATCH] kbuild: strip the last slash in KBUILD_EXTMOD

FromWei Yang <richard.weiyang@gmail.com>
Date2017-02-22 16:10 +0100
Subject[PATCH] kbuild: strip the last slash in KBUILD_EXTMOD
Message-ID<tdGIi-3wm-9@gated-at.bofh.it>
Current kbuild will build the target again if we run "make M=dir" and "make
M=dir/" by turns, since if_changed will see the prerequisite is changed.
The behavior may confuse the user a little, since actually we are building
the same target and no difference.

According to current implementation in scripts/Makefile.build, the obj
passed to next level is a directory name with last slash stripped. This
patch strips the last slash in KBUILD_EXTMOD which is assigned from "M=".

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index b1037774e8e8..db6ed60928ab 100644
--- a/Makefile
+++ b/Makefile
@@ -184,13 +184,15 @@ endif
 # Old syntax make ... SUBDIRS=$PWD is still supported
 # Setting the environment variable KBUILD_EXTMOD take precedence
 ifdef SUBDIRS
-  KBUILD_EXTMOD ?= $(SUBDIRS)
+  __KBUILD_EXTMOD ?= $(SUBDIRS)
 endif
 
 ifeq ("$(origin M)", "command line")
-  KBUILD_EXTMOD := $(M)
+  __KBUILD_EXTMOD := $(M)
 endif
 
+KBUILD_EXTMOD = $(patsubst %/,%,$(__KBUILD_EXTMOD))
+
 # If building an external module we do not care about the all: rule
 # but instead _all depend on modules
 PHONY += all
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web