Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2006-06-22 21:19:33 -0700 (Thu, 22 Jun 2006)
Revision: 9373
Log message:
Resolved the "strage" bug (see the discussion).
http://lists.metaprl.org/pipermail/omake-devel/2006-June/000261.html
Here were the issues:
1. target-exists and friends should not be called until the
build phase (after all OMakefiles are evaluated). This
was not the source of the error.
2. When testing whether a target exists, we must switch to
the environment (the directory) for the target.
For #2, suppose we want to build a/a.boo, and
a/OMakefile contains a rule
# a/OMakefile
%.boo: ../b/%.boo
and b/OMakefile has
# b/OMakefile
%.boo: %.moo
...
Basically, we must use the appropriate OMakefile when determining
whether a target can be built so a/a.boo <- b/b.boo <- b/b.moo
(assuming b.moo can be built).
As usual for implicit rules, if the dependencies are cyclic,
omake will loop. Say, b/OMakefile instead contains
%.boo: ../a/%.boo
...
The implicit dep computation is Turing complete, so a complete
check for termination is undecidable.