summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-01-16 16:42:25 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-01-16 16:43:53 +0100
commit12dc0ec5e3c7e1a12569d5cfdbb8ceaa5a5f5f58 (patch)
treef2b0d540f6b3b5636ed1901cd74808249a666b16
parent3da9c4c757ff0b6b1df0daf36a8a12274292a9e1 (diff)
downloadautomake-12dc0ec5e3c7e1a12569d5cfdbb8ceaa5a5f5f58.tar.gz
vala: avoid potential useless remakes (minor bugfix)
* automake.in (lang_vala_finish_target): Ensure the timestamp file from which the C files generated from Vala sources depend on gets created with a modification time that is truly older than those of said generated C files. This prevents make from attempting useless rebuilds (which were bound to happen deterministically on systems with sub-second timestamp resolutions). It is worth noting that, luckily, those useless rebuild ended up being a no-op, since the Vala compiler is careful not to update the timestamp of an output file if its content has not changed from the previous version. Still, the useless rebuilds messed up "make -q" and "make -n" invocations, and were technically incorrect (despite being, as noted, inoffensive in practice). Problem revealed by failure of tests vala-mix.test and vala5.test on a fast Solaris 10 system whose filesystem had a sub-second timestamp resolution.
-rw-r--r--automake.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/automake.in b/automake.in
index eb859e2fd..50a9d8730 100644
--- a/automake.in
+++ b/automake.in
@@ -6077,8 +6077,15 @@ sub lang_vala_finish_target ($$)
$output_rules .=
"\$(srcdir)/${derived}_vala.stamp: \$(${derived}_SOURCES)\n".
+# Since the C files generated from the vala sources depend on the
+# ${derived}_vala.stamp file, we must ensure its timestamp is older than
+# those of the C files generated by the valac invocation below (this is
+# especially important on systems with sub-second timestamp resolution).
+# Thus we need to create the stamp file *before* invoking valac, and to
+# move it to its final location only after valac has been invoked.
+ "\t${silent}rm -f \$@ && echo stamp > \$@-t\n".
"\t${verbose}\$(am__cd) \$(srcdir) && ${compile} \$(${derived}_SOURCES)\n".
- "\t${silent}touch \$@\n";
+ "\t${silent}mv -f \$@-t \$@\n";
push_dist_common ("${derived}_vala.stamp");