Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Erlang emakefile explain

Tags:

erlang

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 item 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?
like image 224
cometta Avatar asked Nov 03 '09 14:11

cometta


People also ask

Is Erlang compiled or interpreted?

Erlang programs must be compiled to object code. The compiler can generate a new file that contains the object code. The current abstract machine, which runs the object code, is called BEAM, therefore the object files get the suffix . beam.

Which function is used to compile an Erlang file?

To print a complete list of the options to produce list files, type compile:options() at the Erlang shell prompt. The options are printed in the order that the passes are executed.


1 Answers

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

like image 106
Eric Avatar answered Sep 26 '22 01:09

Eric