]> git.draconx.ca Git - upkg.git/commit
Improve GOB rebuild rules for VPATH builds.
authorNick Bowler <nbowler@draconx.ca>
Fri, 31 Jan 2020 20:04:14 +0000 (15:04 -0500)
committerNick Bowler <nbowler@draconx.ca>
Fri, 31 Jan 2020 20:20:44 +0000 (15:20 -0500)
commitdb03b6ae47317f74767e4850da14a02afaa90d6b
tree4dcc7f510372b0e48208ca9717d9b0c772d56f11
parentc5663c4e00361d7b054233fbdb5eb1cd2be53c1f
Improve GOB rebuild rules for VPATH builds.

In a VPATH build, if make explicitly targets a .gobstamp in srcdir, the
.c and .h outputs currently end up in builddir while the .gobstamp ends
up in srcdir.

This behaviour can be triggered when distributed headers in srcdir are
referenced by the automatic dependency tracking and then the .gob file
is updated.

Ideally everything would always go in builddir whenever gob files are
rebuilt but it turns out this is rather difficult to get right: when
headers originally in srcdir are updated in builddir, make will not
detect all necessary rebuilds.

However we can avoid most problems by just ensuring all the files end
up wherever make is trying to update the gobstamp.  This will typically
be builddir from a clean build but may be srcdir if automatic dependency
tracking is used.  The gob2 interface is a bit annoying because we cannot
explicitly specify the output filename but it is fairly simple to work
around in the shell.

While we are here, make sure the .gobstamp timestamp precedes the
other generated files, as otherwise the deletion recovery rules will
be run every build.
Makefile.am