anchor.diff:          []     -> Target ++ ".exe";
           _Other -> Target
       end.
  -
  -%% TODO: DEPRECATED: remove support for non-port_specs syntax [old_*()]
  -old_get_specs(Config, AppFile) ->
  -    OsType = os:type(),
  -    SourceFiles = old_get_sources(Config),
  -    {NewConfig, Specs} =
  -        case rebar_config:get_local(Config, so_specs, undefined) of
  -            undefined ->
  -                Objects = port_objects(SourceFiles),
  -                %% New form of so_specs is not provided. See if the old form
  -                %% of {so_name} is available instead
  -                Dir = "priv",
  -                {Config2, SoName} =
  -                    case rebar_config:get_local(Config, so_name, undefined) of
  -                        undefined ->
  -                            %% Ok, neither old nor new form is
  -                            %% available. Use the app name and
  -                            %% generate a sensible default.
  -                            {Config1, AppName} =
  -                                rebar_app_utils:app_name(Config, AppFile),
  -                            DrvName = ?FMT("~s_drv.so", [AppName]),
  -                            {Config1, filename:join([Dir, DrvName])};
  -                        AName ->
  -                            %% Old form is available -- use it
  -                            {Config, filename:join(Dir, AName)}
  -                    end,
  -                {Config2, [old_get_so_spec({SoName, Objects}, OsType)]};
  -            SoSpecs ->
  -                {Config, [old_get_so_spec(S, OsType) || S <- SoSpecs]}
  -        end,
  -    {NewConfig, {SourceFiles, Specs}}.
  -
  -old_get_sources(Config) ->
  -    RawSources = rebar_config:get_local(Config, port_sources,
  -                                        ["c_src/*.c"]),
  -    FilteredSources = old_filter_port_sources(RawSources),
  -    old_expand_sources(FilteredSources).
  -
  -old_filter_port_sources(PortSources) ->
  -    [S || S <- PortSources, old_is_arch_port_sources(S)].
  -
  -old_is_arch_port_sources({Arch, _Sources}) -> rebar_utils:is_arch(Arch);
  -old_is_arch_port_sources(_Sources)         -> true.
  -
  -old_expand_sources(Sources) ->
  -    lists:flatmap(fun filelib:wildcard/1, Sources).
  -
  -old_get_so_spec({Target, Objects}, OsType) ->
  -    #spec{type=drv,
  -          target=maybe_switch_extension(OsType, Target),
  -          sources=[],
  -          objects=Objects,
  -          opts=[]}.
   
   %%
   %% == port_env ==
  
positive.code: %% == compile and link ==
  %%
  
  compile_sources([], Specs, SharedEnv) ->        % port_spec
      lists:foldl(
        fun(#spec{sources=Sources, type=Type, opts=Opts}, NewBins) ->
                Env = proplists:get_value(env, Opts, SharedEnv),
                compile_each(Sources, Type, Env, NewBins)
        end, [], Specs);
  compile_sources(OldSources, _Specs, SharedEnv) -> % deprecated
      compile_each(OldSources, drv, SharedEnv, []).
  
  compile_each([], _Type, _Env, NewBins) ->
      lists:reverse(NewBins);
  
negative.code:     %% merge with the default for this operating system. This enables
      %% max flexibility for users.
      DefaultEnv  = filter_env(default_env(), []),
      RawPortEnv = rebar_config:get_list(Config, port_env, []),
      PortEnv = filter_env(RawPortEnv, []),
      GlobalDefines = global_defines(Config),
      OverrideEnv = GlobalDefines ++ PortEnv ++ filter_env(ExtraEnv, []),
      RawEnv = apply_defaults(os_env(), DefaultEnv) ++ OverrideEnv,
  