Re: [PATCH 0/5] kbuild: Use relative paths if possible

From: Michal Marek
Date: Thu May 08 2014 - 16:44:15 EST


On Wed, Apr 30, 2014 at 06:13:59PM +0200, Sam Ravnborg wrote:
> On Tue, Apr 29, 2014 at 04:08:08PM +0200, Michal Marek wrote:
> > Hi,
> >
> > This series changes the Makefile to use relative paths for $(objtree),
> > always setting it to '.', and for $(srctree) setting either to '.' or
> > '..', when building in the source tree or a subdirectory thereof,
> > respectively. The goal is to make compiler messages and Ooopses more
> > readable by avoiding the full path to the source/object directory.
> >
> > Patch 2/5 is just an unrelated cleanup.
> >
> > Michal
> >
> > Michal Marek (5):
> > firmware: Simplify directory creation
> > firmware: Use $(quote) in the Makefile
> > kbuild: Use relative path for $(objtree)
> > kbuild: Use relative path when building in the source tree
> > kbuild: Use relative path when building in a subdir of the source tree
>
> For patch 2,3,4 and 5 you can add my:
> Acked-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
>
> Patch 1 also looks good, but I did not fully grasp it and this is MO
> implied by an ack. So please do not hold it back due to this as
> the cleanup looked good.

I found a bug caused by 3/5 and 4/5: The source and build symlinks
created by modules_install were wrong. The fix is simple:

diff --git a/Makefile b/Makefile
index 3d311b6..9872c53 100644
--- a/Makefile
+++ b/Makefile
@@ -1064,10 +1064,10 @@ _modinst_:
@rm -rf $(MODLIB)/kernel
@rm -f $(MODLIB)/source
@mkdir -p $(MODLIB)/kernel
- @ln -s $(srctree) $(MODLIB)/source
+ @ln -s `cd $(srctree) && /bin/pwd` $(MODLIB)/source
@if [ ! $(objtree) -ef $(MODLIB)/build ]; then \
rm -f $(MODLIB)/build ; \
- ln -s $(objtree) $(MODLIB)/build ; \
+ ln -s $(CURDIR) $(MODLIB)/build ; \
fi
@cp -f $(objtree)/modules.order $(MODLIB)/
@cp -f $(objtree)/modules.builtin $(MODLIB)/

I will fold it into the respective patches and send a V2.

Michal
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/