开发者

Erlang emakefile explain

I have an Emakefile that looks like:

%% --
%%
%% --

{'/Users/user/projects/custom_test/trunk/*', 
 [debug_info, 
  {outdir, "/Users/user/projects/custom_test/trunk/ebin"},  
  {i, "/Users/user/projects/custom_test/trunk/include/."}
 ]
}.
  1. What is an explanation in layman's terms for what each i开发者_StackOverflow中文版tem does in the list?
  2. How do I run the emakefile so that I am able to compile it?
  3. After compilation, how do I run that generated BEAM file?


1/ {"source files globbed", Options}

Here the options are :

  • debug_info add debug info for the debugger

  • {outdir, "/Users/user/projects/custom_test/trunk/ebin"} where should the output be written (the .beam files)

  • {i, "/Users/user/projects/custom_test/trunk/include/."} where to find the .hrl header files.

2/ erl -make

3/ erl -pa /Users/user/projects/custom_test/trunk/ebin starts a shell.

Find the module serving as an entry point in your application and call the functions : module:start().

You can also run the code non interactively :

erl -noinput -noshell -pa /Users/user/projects/custom_test/trunk/ebin -s module start


  1. For the Emakefile synax visit the man page
  2. In the directory where the Emakefile is run erl -make to compile using the Emakefile
  3. Simplest way to run would be to simply start an erlang shell in the same directory as the beam files with the command erl. Then run the code with module_name:function_name(). (including the dot).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜