|
@@ -99,25 +99,38 @@ compile_one_erl(File, Path2, Emakefile_Settings) ->
|
|
|
[report, return, {i, [Inc_Dir]}, {outdir, Ebin_Dir}]
|
|
|
end,
|
|
|
|
|
|
+ Module_Name = erlang:list_to_atom(lists:flatten(string:replace(File, ".erl", ""))),
|
|
|
+ %io:format("~Module_Name: ~p~n", [Module_Name]),
|
|
|
+
|
|
|
io:format("~nCompiling ~p: ", [File_Path]),
|
|
|
|
|
|
- case compile:file(File_Path, Options) of
|
|
|
- error ->
|
|
|
- io:format("~nError!~n", []);
|
|
|
+ RZ = compile:file(File_Path, Options),
|
|
|
+ %io:format("~nRZ: ~p~n",[RZ]),
|
|
|
+
|
|
|
+ case RZ of
|
|
|
+ %error ->
|
|
|
+ % io:format("~nError!~n", []);
|
|
|
{error, [], Warning} ->
|
|
|
io:format("~nWarning: ~p~n", [Warning]);
|
|
|
|
|
|
- {error, [{File_Path, [{1,erl_lint,undefined_module}]}], []} ->
|
|
|
+ {error, [{File_Path, [{1, erl_lint, undefined_module}]}], []} ->
|
|
|
ok; % do not show message "undefined_module" when all ok
|
|
|
|
|
|
{error, Error, Warning} ->
|
|
|
io:format("~nErrors and warnings:~n ~p~n ~p~n", [Error, Warning]);
|
|
|
|
|
|
- _ ->
|
|
|
- io:format("ok~n", []),
|
|
|
- Module = erlang:list_to_atom(lists:flatten(string:replace(File, ".erl", ""))),
|
|
|
- code:purge(Module),
|
|
|
- code:load_file(Module)
|
|
|
+ {ok, Module_Name} ->
|
|
|
+ io:format("ok - (no warnings)~n", []),
|
|
|
+ code:purge(Module_Name),
|
|
|
+ code:load_file(Module_Name);
|
|
|
+
|
|
|
+ {ok, Module_Name, Warnings} ->
|
|
|
+ case Warnings of
|
|
|
+ [] -> io:format("ok (no warnings)~n", []);
|
|
|
+ _ -> io:format("ok, warnings:~n~p~n", [Warnings])
|
|
|
+ end,
|
|
|
+ code:purge(Module_Name),
|
|
|
+ code:load_file(Module_Name)
|
|
|
end,
|
|
|
ok;
|
|
|
_ ->
|