On 07/12/09 11:01, Christoph Groth wrote:
Hello,
in the Makefile of my project I would like to always run (before
everything else) a command which updates the submodules of the project.
I do this by having the line
$(shell to-be-run)
somewhere in the Makefile.
However, when the automatically generated dependencies are re-generated,
which happens every time some source file has been changed, the Makefile
is re-initialized. As a consequence, `to-be-run' is executed a second
time.
It sounds like you've got a two-pass system: the first pass generates
the dependencies, the second pass builds it.
A better way is to generate the dependencies while compiling (-MD gcc
option, other compilers have a similar option), so that make completes
in one pass. When there are no dependencies everything gets built, when
there are dependencies generated by the previous build it only rebuilds
what has changed since the previous build.
--
Max
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make