These functions are similar to the UNIX type Make
functions.
They can be used to develop programs which consist of several files.
make
can also be used to recompile entire directories. If
updates are made, make
exits with the value up_to_date
.
This function is the same as all([])
.
all(Options) -> up_to_date | error
Checks all Erlang files in the current directory and compiles
those files which have been modified after the creation of the object file.
Options
is a list of valid options for make
, together with
valid options for compile
.
Compares time stamps of .erl
and object code files. If the time stamp of the
source file is later than the object file, or the object file is
missing, the source file is recompiled.
The list of files to be compared is taken from the file
Emakefile
, if it exists. Failing this, it is taken from the current
directory.
This function returns error
if compilation fails for any file.
The elements of Options
can be:
noexec
load
netload
net:broadcast/3
,
par
make
is used in parallel on all nodes included in the expression (node () | nodes ()
For example:
1> make:all ([par, netload, trace]).
make
is used in parallel on all nodes. This ensures that the produced object
files are loaded on all nodes and the trace
flag is passed to the compiler.
This produces traceable code.
files(FileList, Options) -> up_to_date | error
This is the same as all/0
and all/1
, but with an explicit
list of files.
This function returns error
if compilation fails for any file or
if a non-existing file is specified.
This program assumes that a file named Emakefile
exists and
that it is located in the current directory. The file must be named
Emakefile
and it must contain the names of the files concerned as
atoms, each followed by a period. For example:
file1. file2. '../foo/file3'. 'File4'. ^ (a new line )
If the Emakefile
does not exist, all Erlang files in the current
directory are used as input. This is useful when recompiling
entire directories.