tags:

views:

475

answers:

2

i have an emakefile look like below

%% --
%%
%% --

{'/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.can someone please explain in lay man term what does each item in the list means?
2. how to run the emakefile so that i able to compile it?
3. after compiled, those generated BEAM file, how to run?

+2  A: 
  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).
Jon Gretar
may i know how to call the start function in this erl file http://www.copypastecode.com/13830/ it has 2 arguments
cometta
+4  A: 

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

cstar
no need to run c(module). ? how to find out entry point for app?
cometta
no, erl -make does that for you.The entry point : read the code, find an aptly named function, I can't help you here.
cstar
may i know how to call the start function in this erl file http://www.copypastecode.com/13830/ it has 2 arguments
cometta
You should have an .app file in the ebin folder.It means it's an OTP app, and it can be started with :application:start(weazard).In the console.Now I can recommend reading the documentation.
cstar
1.i try to run the weazard.app but it tell me 'classic environment no longer supported' . 2.by the way how to generate the weazard.app? it doesnt generated by erl -make . 3 weazard.app is a plaintext macos executable file? 4. how to run wezard.app , double click ?
cometta