Skip to content
Browse files

Updating generate_deps to the latest

  • Loading branch information...
1 parent f5fb0df commit 4091668580c69e2bb9e1d598c05bf59746178ad5 Matthew Sackman committed Mar 31, 2010
Showing with 5 additions and 3 deletions.
  1. +5 −3 generate_deps
View
8 generate_deps
@@ -23,10 +23,11 @@ main([IncludeDir, ErlDir, EbinDir, TargetFile]) ->
ok;
(Path, Dep, ok) ->
Module = filename:basename(Path, ".erl"),
- ok = file:write(Hdl, [EbinDir, "/", Module, ".beam:"]),
+ ok = file:write(Hdl, [EbinDir, "/", Module, ".beam: ",
+ Path]),
ok = sets:fold(fun (E, ok) -> file:write(Hdl, [" ", E]) end,
ok, Dep),
- file:write(Hdl, [" ", ErlDir, "/", Module, ".erl\n"])
+ file:write(Hdl, ["\n"])
end, ok, Deps),
ok = file:write(Hdl, [TargetFile, ": ", escript:script_name(), "\n"]),
ok = file:sync(Hdl),
@@ -35,7 +36,8 @@ main([IncludeDir, ErlDir, EbinDir, TargetFile]) ->
detect_deps(IncludeDir, EbinDir, Modules, Headers, Path) ->
{ok, Forms} = epp:parse_file(Path, [IncludeDir], [{use_specs, true}]),
lists:foldl(
- fun ({attribute, _LineNumber, behaviour, Behaviour}, Deps) ->
+ fun ({attribute, _LineNumber, Attribute, Behaviour}, Deps)
+ when Attribute =:= behaviour orelse Attribute =:= behavior ->
case sets:is_element(Behaviour, Modules) of
true -> sets:add_element(
[EbinDir, "/", atom_to_list(Behaviour), ".beam"],

0 comments on commit 4091668

Please sign in to comment.
Something went wrong with that request. Please try again.