]> Git Repo - linux.git/commitdiff
kbuild: Use relative path when building in a subdir of the source tree
authorMichal Marek <[email protected]>
Fri, 25 Apr 2014 21:25:18 +0000 (23:25 +0200)
committerMichal Marek <[email protected]>
Wed, 14 May 2014 20:43:05 +0000 (22:43 +0200)
When doing make O=<subdir>, use '..' to refer to the source tree. This
allows for more readable compiler messages, and, more importantly, it
sets the VPATH to '..', so filenames in WARN_ON() etc. will be shorter.

Acked-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
Makefile

index 3e134ec4c3d339b8e1723a6032c548c819c4c9b2..f4702c10b2b8daba066f6e3c796db7c2ab1f3488 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -149,7 +149,17 @@ else
 _all: modules
 endif
 
-srctree                := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
+ifeq ($(KBUILD_SRC),)
+        # building in the source tree
+        srctree := .
+else
+        ifeq ($(KBUILD_SRC)/,$(dir $(CURDIR)))
+                # building in a subdirectory of the source tree
+                srctree := ..
+        else
+                srctree := $(KBUILD_SRC)
+        endif
+endif
 objtree                := .
 src            := $(srctree)
 obj            := $(objtree)
This page took 0.05885 seconds and 4 git commands to generate.