[Swan-dev] Relative build paths

Antony Antony antony at phenome.org
Wed Jan 28 21:10:28 EET 2015


Relative path not a bad idea. If it is relative to 'src top' dir, the experience could be better. However, if it is relative to OBJ.linux.x86_64/programs/pluto it is a pain. The paths look like ../../../programs/pluto/plutomain.c. 

Would use use of 'src top' or whatever the autmake convention help?
src_top=/home/cagney/libreswan-master 

For me the issue was when compiling inside KVM guest and I am editing the file on the host. Yes I know we have a convoluted directory structure betwen the host and guests, /source/ which I would love to get rid off.  Instead just mount /home/build then swan test could take directory name (/home/cagney/libreswan-master) as an argument.

Oh, thanks for fixing Makefile.depend. It is no more in the source directory, only in OBJ.linux.x86_64/*

-antony


On Wed, Jan 28, 2015 at 12:02:08PM -0500, Andrew Cagney wrote:
> Something unintentionally changed in my srcdir commit was to change
> VPATH to a relative path (As an aside my preference is to push
> changes, especially to the build system, early and slowly so that
> problems are caught before too big a hole has been dug :-)
> 
> It is probably worth explaining a little as to what got changed.
> 
> Before this round, generated Makefiles under OBJ looked like:
> 
> $ cat OBJ.linux.x86_64/programs/pluto/Makefile
> srcdir=/home/cagney/libreswan-master/programs/pluto/
> OBJDIR=OBJ.linux.x86_64
> OBJDIRTOP=/home/cagney/libreswan-master/OBJ.linux.x86_64
> ...
> LIBRESWANSRCDIR=/home/cagney/libreswan-master
> ...
> 
> they now look like:
> 
> $ cat OBJ.linux.x86_64/programs/pluto/Makefile
> OBJDIR=OBJ.linux.x86_64
> top_builddir=../..
> include $(top_builddir)/../Makefile.dirs
> SRCDIR=$(abs_srcdir)/
> ...
> 
> notice how everything is relative.  If an absolute path is required it
> is computed at runtime by Makefile.dirs (mumble something about
> wanting to move Makefile.dirs to mk/dirs.mk :-).
> 
> This is a good thing (tm).  Moving things around is no longer a pain.
> For instance:
> 
> $ ( cd libreswan-master && make programs )
> $ mv libreswan-master libreswan-foo
> $ ( cd libreswan-foo && make clean )
> 
> now does the right thing(tm).
> 
> As for relative VPATHs, I didn't notice.  Emacs (and I'd assume any
> IDE) happily deal with it.   Debuggers also happily deal with it.   It
> even makes debugging a moved build easier.
> 
> In the future, want to consider making a relative VPATH an option.
> 
> Andrew
> _______________________________________________
> Swan-dev mailing list
> Swan-dev at lists.libreswan.org
> https://lists.libreswan.org/mailman/listinfo/swan-dev
> 


More information about the Swan-dev mailing list