[Swan-dev] Relative build paths
Andrew Cagney
andrew.cagney at gmail.com
Wed Jan 28 19:02:08 EET 2015
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
More information about the Swan-dev
mailing list