On Tue, 2012-12-04 at 20:35 +0000, Ben Guthro wrote:
> Unstable does not leave these files modified, as far as I can see -
> Though a simple diff of the 2 libxl dirs does not make it immediately
> obvious what might be modifying these files.
The makefile is supposed to not rerun flex/bison unless something has
actually changed in the source files.
I suspect this has something to do with the timestamps stored in
mercurial/git. As far as I can tell both create files with the time of
the clone/update and not the time which is committed. This commonly
results in them having the same timestamp AFAICT.
A common problem with keeping generated files in the VCS is that the
timestamps are not preserved and make gets confused into thinking
something needs updating when it doesn''t. If you happen to have a
different version of the tool installed then this will likely result in
changes to the generated files.
A simple local workaround would be to touch the output files after
checkout.
Solving it properly seems like it would be harder. One idea would be a
helper (e.g. a call_if_changed make macro) which stashes a checksum of
the input file somewhere (perhaps the last line of the output file) and
does
if checksum($input) == tail -n 1 $output:
touch $output
else
regenerate $input
checksum($input) >> $output
endif
(Needs to inject/strip suitable comment characters for the language used
in $output)
Nasty.
Ian.