anchor.diff:  
   run(Config, FirstFiles, SourceDir, SourceExt, TargetDir, TargetExt,
       Compile3Fn, Opts) ->
  -    %% Convert simple extension to proper regex
  -    SourceExtRe = "^[^._].*\\" ++ SourceExt ++ [$$],
  -
  +
  +    %% Find all possible source files
       Recursive = proplists:get_value(recursive, Opts, true),
  -    %% Find all possible source files
  -    FoundFiles = rebar_utils:find_files(SourceDir, SourceExtRe, Recursive),
  +    FoundFiles = rebar_utils:find_files_by_ext(SourceDir, SourceExt, Recursive),
  +
       %% Remove first files from found files
       RestFiles = [Source || Source <- FoundFiles,
                              not lists:member(Source, FirstFiles)],
   
  +    FirstUnits = source_to_unit_each(FirstFiles,
  +                                     SourceDir, SourceExt,
  +                                     TargetDir, TargetExt),
  +    RestUnits = source_to_unit_each(RestFiles,
  +                                    SourceDir, SourceExt,
  +                                    TargetDir, TargetExt),
  +    run(Config, FirstUnits, RestUnits, Compile3Fn, Opts).
  +
  +%% FirstUnits and RestUnits are lists of tuples: {Source,Target}
  +run(Config, FirstUnits, RestUnits, Compile3Fn, Opts) ->
  +
       %% Check opts for flag indicating that compile should check lastmod
       CheckLastMod = proplists:get_bool(check_last_mod, Opts),
   
  -    run(Config, FirstFiles, RestFiles,
  -        fun(S, C) ->
  -                Target = target_file(S, SourceDir, SourceExt,
  -                                     TargetDir, TargetExt),
  +    run(Config, FirstUnits, RestUnits,
  +        fun({S, Target}, C) ->
                   simple_compile_wrapper(S, Target, Compile3Fn, C, CheckLastMod)
           end).
   
  
positive.code: 
  compile_each([], _Config, _CompileFn) ->
      ok;
  compile_each([Source | Rest], Config, CompileFn) ->
      case compile(Source, Config, CompileFn) of
          ok ->
              ?CONSOLE("Compiled ~s\n", [Source]);
          {ok, Warnings} ->
              report(Warnings),
              ?CONSOLE("Compiled ~s\n", [Source]);
          skipped ->
              ?INFO("Skipped ~s\n", [Source]);
          Error ->
              ?CONSOLE("Compiling ~s failed:\n",
                       [maybe_absname(Config, Source)]),
              maybe_report(Error),
              ?DEBUG("Compilation failed: ~p\n", [Error]),
              ?FAIL
      end,
      compile_each(Rest, Config, CompileFn).
  
  compile_queue(_Config, [], []) ->
      ok;
  
negative.code: -export([run/4,
           run/7,
           run/8,
           run/5,
           ok_tuple/3,
           error_tuple/5]).
  
  