Commit 890676c6 authored by Michal Marek's avatar Michal Marek

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: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarMichal Marek <mmarek@suse.cz>
parent 7e1c0477
...@@ -149,7 +149,7 @@ else ...@@ -149,7 +149,7 @@ else
_all: modules _all: modules
endif endif
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR)) srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
objtree := . objtree := .
src := $(srctree) src := $(srctree)
obj := $(objtree) obj := $(objtree)
...@@ -1059,7 +1059,7 @@ _modinst_: ...@@ -1059,7 +1059,7 @@ _modinst_:
@rm -rf $(MODLIB)/kernel @rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/source @rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel @mkdir -p $(MODLIB)/kernel
@ln -s $(srctree) $(MODLIB)/source @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \ @if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
rm -f $(MODLIB)/build ; \ rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment