I am currently using:
c(module_name)
: to build my Erlang files ones by one, and I was wondering about how other people handle the build process for Erlang when they have multiple files
I am currently using:
c(module_name)
: to build my Erlang files ones by one, and I was wondering about how other people handle the build process for Erlang when they have multiple files
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]}.
a lot of projects use a regular old make file and erlc
erlc -h
Usage: erlc [options] file.ext ...
Options:
-b type type of output file (e.g. jam or beam)
-d turn on debugging of erlc itself
-Dname define name
-Dname=value define name to have value
-hybrid compile using hybrid-heap emulator
-help shows this help text
-I path where to search for include files
-o name name output directory or file
-pa path add path to the front of Erlang's code path
-pz path add path to the end of Erlang's code path
-smp compile using SMP emulator
-v verbose compiler output
-Werror make all warnings into errors
-W0 disable warnings
-Wnumber set warning level to number
-Wall enable all warnings
-W enable warnings (default; same as -W1)
-E generate listing of expanded code (Erlang compiler)
-S generate assembly listing (Erlang compiler)
-P generate listing of preprocessed code (Erlang compiler)
+term pass the Erlang term unchanged to the compiler
Erlang Make and Emakefiles are probably a good way to start.
As an example, you might want to have a look to the build system of Erlang Web.
In the specific, you might want to look at their Emakefile and their compile.erl.