Changes by: Jason Hickey (jyh at cs.caltech.edu)
Date: 2003-11-16 11:57:21 -0800 (Sun, 16 Nov 2003)
Revision: 273
Log message:

      In this version, the source dependencies for implicit targets
      are computed lazily.  This means that rules like this make sense:
      
      %.cmi: $(if $(target-exists %.mli, %.mli), %.ml)
         ...
      
      However, I don't know if I like this method because the semantics
      are confusing.  Since the dependencies are lazy, the dependency
      list is evaluated in the context where the rule is instantiated.
      For example, this top-level rule does not have the desired effect:
      
      %.cmi %.cmiz: $(MPINSTALL) $(PRLC)
      
      If this rule is instantiated in, say, theories/itt, then
      $(MPINSTALL) is bound to theories/itt/mp.install, not the top-level
      mp.install as you get with eager evaluation.  There is a solution,
      which is to force evaluation:
      
      %.cmi %.cmiz: $,(target $(MPINSTALL) $(PRLC))
      
      The $, forces eager evaluation, and the target function fetches
      the .PHONY node in the root context.
      
      This seems too complicated--the uniform eager semantics earlier
      was easier.
      
      Here is my new proposed solution.  First, allow for multiple
      kinds of source dependencies.
      
          d ::= exp               (* dependencies, eager evaluation *)
             | d :lazy: exp       (* dependencies, lazy evaluation *)
             | d :optional: exp   (* optional dependencies, eager *)
             | d :exists: exp     (* existential dependencies, eager *)
      
      Second, allow computed rules, where the rule body is a function
      that computes the actual rule.  Evaluation of the rule body is lazy.
      
      %.cmi: %.ml :compute:
          if $(NATIVE_ENABLED)
              %.cmi %.cmx %$(EXT_OBJ): %.ml
                 $(OCAMLOPT) ...
          else
              %.cmi %.cmo: %.ml
                 $(OCAMLC) ...
      
      For now, I'll leave this branch idle and explore the new option.
      

Changes  Path
+3 -0 omake-branches/lazy_implicit_sources/Files
+8 -8 omake-branches/lazy_implicit_sources/OMakeroot.src.in
+6 -6 omake-branches/lazy_implicit_sources/src/build/omake_build.ml
+113 -166 omake-branches/lazy_implicit_sources/src/build/omake_builtin.ml
+5 -1 omake-branches/lazy_implicit_sources/src/env/omake_ast_lex.mll
+137 -93 omake-branches/lazy_implicit_sources/src/env/omake_env.ml
+15 -7 omake-branches/lazy_implicit_sources/src/env/omake_env.mli
+30 -115 omake-branches/lazy_implicit_sources/src/eval/omake_eval.ml
+0 -6 omake-branches/lazy_implicit_sources/src/eval/omake_eval.mli
+20 -6 omake-branches/lazy_implicit_sources/src/eval/omake_target.ml
Added omake-branches/lazy_implicit_sources/src/eval/omake_value.ml
Properties omake-branches/lazy_implicit_sources/src/eval/omake_value.ml
Added omake-branches/lazy_implicit_sources/src/eval/omake_value.mli
Properties omake-branches/lazy_implicit_sources/src/eval/omake_value.mli
+3 -4 omake-branches/lazy_implicit_sources/src/ir/omake_cache.ml
+1 -1 omake-branches/lazy_implicit_sources/src/ir/omake_ir_print.ml
+27 -80 omake-branches/lazy_implicit_sources/src/ir/omake_node.ml
+0 -1 omake-branches/lazy_implicit_sources/src/ir/omake_node.mli
+5 -17 omake-branches/lazy_implicit_sources/src/ir/omake_node_sig.ml
+35 -40 omake-branches/lazy_implicit_sources/src/util/omake_wild.ml
+15 -8 omake-branches/lazy_implicit_sources/src/util/omake_wild.mli