1
<?xml version="1.0" encoding="latin1" ?>
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
9
<holder>Ericsson AB, All Rights Reserved</holder>
12
The contents of this file are subject to the Erlang Public License,
13
Version 1.1, (the "License"); you may not use this file except in
14
compliance with the License. You should have received a copy of the
15
Erlang Public License along with this software. If not, it can be
16
retrieved online at http://www.erlang.org/.
18
Software distributed under the License is distributed on an "AS IS"
19
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
20
the License for the specific language governing rights and limitations
23
The Initial Developer of the Original Code is Ericsson AB.
33
<modulesummary>A Make Utility for Erlang</modulesummary>
35
<p>The module <c>make</c> provides a set of functions similar to
36
the UNIX type <c>Make</c> functions.</p>
40
<name>all() -> up_to_date | error</name>
41
<name>all(Options) -> up_to_date | error</name>
42
<fsummary>Compile a set of modules.</fsummary>
44
<v>Options = [Option]</v>
45
<v> Option = noexec | load | netload | <compiler option></v>
48
<p>This function first looks in the current working directory
49
for a file named <c>Emakefile</c> (see below) specifying the
50
set of modules to compile and the compile options to use. If
51
no such file is found, the set of modules to compile
52
defaults to all modules in the current working
54
<p>Traversing the set of modules, it then recompiles every module for
55
which at least one of the following conditions apply:</p>
56
<list type="bulleted">
57
<item>there is no object file, or</item>
58
<item>the source file has been modified since it was last compiled,
60
<item>an include file has been modified since the source file was
63
<p>As a side effect, the function prints the name of each module it
64
tries to compile. If compilation fails for a module, the make
65
procedure stops and <c>error</c> is returned.</p>
66
<p><c>Options</c> is a list of make- and compiler options.
67
The following make options exist:</p>
68
<list type="bulleted">
69
<item><c>noexec</c> <br></br>
71
No execution mode. Just prints the name of each module that needs
72
to be compiled.</item>
73
<item><c>load</c> <br></br>
75
Load mode. Loads all recompiled modules.</item>
76
<item><c>netload</c> <br></br>
78
Net load mode. Loads all recompiled modules an all known nodes.</item>
80
<p>All items in <c>Options</c> that are not make options are assumed
81
to be compiler options and are passed as-is to
82
<c>compile:file/2</c>. <c>Options</c> defaults to <c>[]</c>.</p>
86
<name>files(ModFiles) -> up_to_date | error</name>
87
<name>files(ModFiles, Options) -> up_to_date | error</name>
88
<fsummary>Compile a set of modules.</fsummary>
90
<v>ModFiles = [Module | File]</v>
91
<v> Module = atom()</v>
92
<v> File = string()</v>
93
<v>Options = [Option]</v>
94
<v> Option = noexec | load | netload | <compiler option></v>
97
<p><c>files/1,2</c> does exactly the same thing as <c>all/0,1</c> but
98
for the specified <c>ModFiles</c>, which is a list of module or
99
file names. The file extension <c>.erl</c> may be omitted.</p>
100
<p>The <c>Emakefile</c> (if it exists) in the current
101
directory is searched for compiler options for each module. If
102
a given module does not exist in <c>Emakefile</c> or if
103
<c>Emakefile</c> does not exist, the module is still compiled.</p>
109
<title>Emakefile</title>
110
<p><c>make:all/0,1</c> and <c>make:files/1,2</c> looks in the
111
current working directory for a file named <c>Emakefile</c>. If
112
it exists, <c>Emakefile</c> should contain elements like this:</p>
115
{Modules,Options}. </code>
116
<p><c>Modules</c> is an atom or a list of atoms. It can be
118
<list type="bulleted">
119
<item>a module name, e.g. <c>file1</c></item>
120
<item>a module name in another directory,
121
e.g. <c>../foo/file3</c></item>
122
<item>a set of modules specified with a wildcards,
123
e.g. <c>'file*'</c></item>
124
<item>a wildcard indicating all modules in current directory,
125
i.e. <c>'*'</c></item>
126
<item>a list of any of the above,
127
e.g. <c>['file*','../foo/file3','File4']</c></item>
129
<p><c>Options</c> is a list of compiler options.
131
<p><c>Emakefile</c> is read from top to bottom. If a module
132
matches more than one entry, the first match is valid. For
133
example, the following <c>Emakefile</c> means that <c>file1</c>
134
shall be compiled with the options
135
<c>[debug_info,{i,"../foo"}]</c>, while all other files in the
136
current directory shall be compiled with only the
137
<c>debug_info</c> flag.</p>
139
{'file1',[debug_info,{i,"../foo"}]}.
140
{'*',[debug_info]}. </code>