Commit 890676c65d699db3ad82e7dddd0cf8fb449031af

Authored by Michal Marek
1 parent 7e1c04779e

kbuild: Use relative path when building in the source tree

When not using O=, $(srctree) refers to the same directory as
$(objtree), so we can set it to '.' as well. This makes the default
include path more compact and results in more readable messages from the
compiler. The only case where we need the absolute path is when creating
the 'source' symlink in /lib/modules.

Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>

Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff

... ... @@ -149,7 +149,7 @@
149 149 _all: modules
150 150 endif
151 151  
152   -srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
  152 +srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
153 153 objtree := .
154 154 src := $(srctree)
155 155 obj := $(objtree)
... ... @@ -1059,7 +1059,7 @@
1059 1059 @rm -rf $(MODLIB)/kernel
1060 1060 @rm -f $(MODLIB)/source
1061 1061 @mkdir -p $(MODLIB)/kernel
1062   - @ln -s $(srctree) $(MODLIB)/source
  1062 + @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
1063 1063 @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
1064 1064 rm -f $(MODLIB)/build ; \
1065 1065 ln -s $(CURDIR) $(MODLIB)/build ; \