Erlang emakefile解释

com*_*tta 8 erlang

我有一个Emakefile,看起来像:

%% --
%%
%% --

{'/Users/user/projects/custom_test/trunk/*', 
 [debug_info, 
  {outdir, "/Users/user/projects/custom_test/trunk/ebin"},  
  {i, "/Users/user/projects/custom_test/trunk/include/."}
 ]
}.
Run Code Online (Sandbox Code Playgroud)
  1. 外行人的条款对每个项目在列表中的作用有何解释?
  2. 如何运行emakefile以便我能够编译它?
  3. 编译后,如何运行生成的BEAM文件?

Eri*_*ric 13

1/ {"source files globbed", Options}

这里的选项是:

  • debug_info 为调试器添加调试信息

  • {outdir, "/Users/user/projects/custom_test/trunk/ebin"} 应该在哪里写入输出(.beam文件)

  • {i, "/Users/user/projects/custom_test/trunk/include/."}在哪里可以找到.hrl头文件.

2/erl -make

3/erl -pa /Users/user/projects/custom_test/trunk/ebin开始一个shell.

找到用作应用程序入口点的模块并调用函数: module:start().

您还可以以交互方式运行代码:

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


Jon*_*tar 4

  1. 对于 Emakefile synax,请访问手册页
  2. 在运行Emakefile的目录下erl -make使用Emakefile进行编译
  3. 最简单的运行方法是使用命令在与 Beam 文件相同的目录中启动一个 erlang shell erl。然后运行代码module_name:function_name().(包括点)。