Skip to content

Commit 890676c

Browse files
committed
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 <[email protected]> Signed-off-by: Michal Marek <[email protected]>
1 parent 7e1c047 commit 890676c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ else
149149
_all: modules
150150
endif
151151

152-
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
152+
srctree := $(if $(KBUILD_SRC),$(KBUILD_SRC),.)
153153
objtree := .
154154
src := $(srctree)
155155
obj := $(objtree)
@@ -1059,7 +1059,7 @@ _modinst_:
10591059
@rm -rf $(MODLIB)/kernel
10601060
@rm -f $(MODLIB)/source
10611061
@mkdir -p $(MODLIB)/kernel
1062-
@ln -s $(srctree) $(MODLIB)/source
1062+
@ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
10631063
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
10641064
rm -f $(MODLIB)/build ; \
10651065
ln -s $(CURDIR) $(MODLIB)/build ; \

0 commit comments

Comments
 (0)