On Sat, Jun 2, 2012 at 2:17 PM, normvcr <[email protected]> wrote:
> I have come across a puzzling problem while building with make.
>
> make all
>
> While building the targets, make eventually comes to building
> foo.o, but quits with an error, that it cannot find foo.cpp .
>
> However, when I now do, again, at the OS prompt:
>
> make all
>
> make picks up where it left off, and  succeeds; the echo of the command
> shows that make
> is correctly using  .../src/foo.cpp  through the vpath directives.
>
> My question is, why did make not find .../src/foo.cpp  in the course
> of the original invokation of make?

I believe the most common cause of this is because some makefile rule
builds a file other than $@.  In this case, ../src/foo.cpp  didn't
exist before the first run but did afterwards, but make didn't know
that some rule that it had run had created it.  What was the rule that
generated ../src/foo.cpp?


Philip Guenther

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to