     targets.forEach (target)=>
       build_vars = @compileDict target.main_inputs
 
+      target.rule = commandHash
+
       target.main_inputs =
         MistGlobber.doAllGlobs target.main_inputs, @mistDir
 

    @rootDir
    @registry.vars = @registry.vars || []
    @registry.rules = @registry.rules || {}
    @registry.targets = @registry.rules || []

    @commandDict = @compileCommandDict()
    @commandDictRefs = {}

        lines.pushScoped "#{k}=#{v}"

    for target in @registry.targets
      outputs = target.main_outputs + target.aux_outputs
      lines.push "build #{outputs}: " +
           "#{target.rule} " +
           "#{target.main_inputs}" +
           "#{if target.dep_inputs.length then " | "}#{target.dep_inputs}" +
           "#{if target.order_inputs.length then " || "}" +
           "#{target.order_inputs}"
      for k, v of target.build_vars
        lines.pushScoped "#{k}=#{v}"

    lines.push '' # Ninja requires a newline at the end :)
