Created
November 2, 2009 15:56
-
-
Save dysinger/224242 to your computer and use it in GitHub Desktop.
Simple Erlang Build File
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env escript | |
| %% -*- erlang -*- | |
| main([]) -> build(compile); | |
| main(Tasks) -> [build(list_to_atom(Task)) || Task <- Tasks]. | |
| build(clean) -> | |
| [ok = file:delete(X) || X <- filelib:wildcard(filename:join("ebin","*"))], | |
| ok = file:del_dir("ebin"); | |
| build(compile) -> | |
| file:make_dir("ebin"), | |
| [{ok,_} = file:copy(X,filename:join("ebin",filename:basename(X))) || | |
| X <- filelib:wildcard(filename:join("src","*.app"))], | |
| [case lfe_comp:file(X,[report,{outdir,"ebin"}]) of | |
| error -> halt(1); | |
| {ok,_} -> ok | |
| end || X <- filelib:wildcard(filename:join("src","*.lfe"))]; | |
| build(X) -> io:format("Unknown build target -> ~s~n",[X]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment