Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building multiple Erlang Beam files?

Tags:

I am currently using

c(module_name) 

to build my Erlang files one by one. How can the build process for Erlang be handle when they have multiple files?

like image 918
yazz.com Avatar asked Mar 30 '10 21:03

yazz.com


People also ask

What is BEAM file in Erlang?

BEAM is the virtual machine at the core of the Erlang Open Telecom Platform (OTP). BEAM is part of the Erlang Run-Time System (ERTS), which compiles Erlang source code into bytecode, which is then executed on the BEAM. BEAM bytecode files have the . beam file extension.

Does Erlang compile?

The Erlang compiler is written in Erlang and always available and can compile to either a file or a binary which can be immediately loaded into the system.

What is a BEAM file?

Executable file generated by the Erlang compiler, a program used for building BEAM files from . ERL source code files; saved in a binary format, called bytecode, and can be run with the Erlang virtual machine (VM).


2 Answers

I start out by using Erlang make, because it starts the VM once and compiles everything that needs to be recompiled.

Try the following in your source directory, it will compile those .erl files that are missing a corresponding Beam file or those where the .erl file has been modified since the Beam file was compiled:

erl -make 

Learn about Emakefile for additional tricks, such as compiling all source files with debug_info and placing the .beam files in ebin:

{'*',     [{outdir,"../ebin"},     debug_info]}. 
like image 60
Christian Avatar answered Oct 19 '22 08:10

Christian


This compiles everything in the directory you're currently in:

cover:compile_directory(). 
like image 44
Jens Avatar answered Oct 19 '22 06:10

Jens