anchor.diff:      rebar_file_utils:delete_each([source_to_bin(S) || S <- Sources]),
   
       %% Delete the .so file
  -    rebar_file_utils:delete_each([so_name(Config, AppFile)]),
  +    rebar_file_utils:delete_each(lists:map(fun({SoName,_}) -> SoName end, so_specs(Config, AppFile, expand_objects(Sources)))),
   
       %% Run the cleanup script, if it exists
       run_cleanup_hook(Config).
  
positive.code: expand_sources([Spec | Rest], Acc) ->
      Acc2 = filelib:wildcard(Spec) ++ Acc,
      expand_sources(Rest, Acc2).
  
  run_precompile_hook(Config, Env) ->
      case rebar_config:get(Config, port_pre_script, undefined) of
  
negative.code:             {NewBins, ExistingBins} = compile_each(Sources, Config, Env, [], []),
  
              %% Construct the driver name and make sure priv/ exists
              SoSpecs = so_specs(Config, AppFile, NewBins ++ ExistingBins),
              ?INFO("Using specs ~p\n", [SoSpecs]),
              lists:foreach(fun({SoName,_}) -> ok = filelib:ensure_dir(SoName) end, SoSpecs),
  
              %% Only relink if necessary, given the SoName and list of new binaries
              lists:foreach(fun({SoName,Bins}) ->
                  case needs_link(SoName, sets:to_list(sets:intersection([sets:from_list(Bins),sets:from_list(NewBins)]))) of
                    true ->
                      rebar_utils:sh_failfast(?FMT("$CC ~s $LDFLAGS $DRV_LDFLAGS -o ~s",
                                                    [string:join(Bins, " "), SoName]), Env);
                    false ->
                      ?INFO("Skipping relink of ~s\n", [SoName]),
                      ok
                  end
                end, SoSpecs)
      end.
  
  clean(Config, AppFile) ->
  