build: Fix gresource.xml dependencies generation
Submitted by ast..@..pso.at
Link to original bug (#785764)
Description
Created attachment 356828 build: Fix gresource.xml dependencies generation
shell/Makefile.am was supposed to automatically generate a set of
dependencies for the sources produced from evince.gresource.xml (by way
of glib-compile-resources --generate-dependencies
). However, the
current implementation was broken (on GNU Make, at least). It tried to
do this:
prereq1: $(other_stuff_here)
...
target: prereq1 $(shell filter prereq1)
...
Where "filter" is a program that takes "prereq1" and produces a list of additional prerequisites for "target".
Apparently the intention was for "prereq1" to be updated first, and
then, once "prereq1" has been generated or updated, for "filter" to read
it. But this doesn't work: first, because the expansion for $(shell ...)
happens at the time the rule is parsed; second, because even if the
expansion did occur after the previous prerequisites were updated, it
would still be broken when using parallel recipe execution (-j X
).
The implementation in this patch uses a common make pattern instead: include an auto-generated makefile snippet.
Another problem with the code was that it placed the generated files in the source directory instead of the build directory. This was also fixed.
Patch 356828, "build: Fix gresource.xml dependencies generation":
0001-build-Fix-gresource.xml-dependencies-generation.patch
Version: git master