summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rebar_erlc_compiler.erl10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/rebar_erlc_compiler.erl b/src/rebar_erlc_compiler.erl
index 355ec3c..5bd04d2 100644
--- a/src/rebar_erlc_compiler.erl
+++ b/src/rebar_erlc_compiler.erl
@@ -178,17 +178,15 @@ erl_first_files(Config, NeededErlFiles) ->
%% dependencies induced by given graph G.
needed_files(G, ErlOpts, Dir, OutDir, SourceFiles) ->
lists:filter(fun(Source) ->
- Target = target_base(OutDir, Source) ++ ".beam",
+ TargetBase = target_base(OutDir, Source),
+ Target = TargetBase ++ ".beam",
Opts = [{outdir, filename:dirname(Target)}
,{i, filename:join(Dir, "include")}] ++ ErlOpts,
digraph:vertex(G, Source) > {Source, filelib:last_modified(Target)}
- orelse opts_changed(Opts, Target)
+ orelse opts_changed(Opts, TargetBase)
end, SourceFiles).
-opts_changed(Opts, Target) ->
- Basename = filename:basename(Target, ".beam"),
- Dirname = filename:dirname(Target),
- ObjectFile = filename:join([Dirname, Basename]),
+opts_changed(Opts, ObjectFile) ->
case code:load_abs(ObjectFile) of
{module, Mod} ->
Compile = Mod:module_info(compile),