1make(3) Erlang Module Definition make(3)
2
3
4
6 make - A Make Utility for Erlang
7
9 The module make provides a set of functions similar to the UNIX type
10 Make functions.
11
13 all() -> up_to_date | error
14
15 all(Options) -> up_to_date | error
16
17 Types:
18
19 Options = [Option]
20 Option =
21 noexec | load | netload | {emake, Emake} | compile:op‐
22 tion()
23 Emake = [EmakeElement]
24 EmakeElement = Modules | {Modules, [compile:option()]}
25 Modules = atom() | [atom()]
26
27 This function determines the set of modules to compile and the
28 compile options to use, by first looking for the emake make op‐
29 tion, if not present reads the configuration from a file named
30 Emakefile (see below). If no such file is found, the set of mod‐
31 ules to compile defaults to all modules in the current working
32 directory.
33
34 Traversing the set of modules, it then recompiles every module
35 for which at least one of the following conditions apply:
36
37 * there is no object file, or
38
39 * the source file has been modified since it was last com‐
40 piled, or,
41
42 * an include file has been modified since the source file was
43 last compiled.
44
45 As a side effect, the function prints the name of each module it
46 tries to compile. If compilation fails for a module, the make
47 procedure stops and error is returned.
48
49 Options is a list of make- and compiler options. The following
50 make options exist:
51
52 * noexec
53 No execution mode. Just prints the name of each module that
54 needs to be compiled.
55
56 * load
57 Load mode. Loads all recompiled modules.
58
59 * netload
60 Net load mode. Loads all recompiled modules on all known
61 nodes.
62
63 * {emake, Emake}
64 Rather than reading the Emakefile specify configuration ex‐
65 plicitly.
66
67 All items in Options that are not make options are assumed to be
68 compiler options and are passed as-is to compile:file/2. Options
69 defaults to [].
70
71 files(ModFiles) -> up_to_date | error
72
73 files(ModFiles, Options) -> up_to_date | error
74
75 Types:
76
77 ModFiles = [(Module :: module()) | (File :: file:filename())]
78 Options = [Option]
79 Option = noexec | load | netload | compile:option()
80
81 files/1,2 does exactly the same thing as all/0,1 but for the
82 specified ModFiles, which is a list of module or file names. The
83 file extension .erl may be omitted.
84
85 The Emakefile (if it exists) in the current directory is
86 searched for compiler options for each module. If a given module
87 does not exist in Emakefile or if Emakefile does not exist, the
88 module is still compiled.
89
91 make:all/0,1 and make:files/1,2 first looks for {emake, Emake} in op‐
92 tions, then in the current working directory for a file named Emake‐
93 file. If present Emake should contain elements like this:
94
95 Modules.
96 {Modules,Options}.
97
98 Modules is an atom or a list of atoms. It can be
99
100 * a module name, e.g. file1
101
102 * a module name in another directory, e.g. '../foo/file3'
103
104 * a set of modules specified with a wildcards, e.g. 'file*'
105
106 * a wildcard indicating all modules in current directory, i.e. '*'
107
108 * a list of any of the above, e.g. ['file*','../foo/file3','File4']
109
110 Options is a list of compiler options.
111
112 Emakefile is read from top to bottom. If a module matches more than one
113 entry, the first match is valid. For example, the following Emakefile
114 means that file1 shall be compiled with the options [de‐
115 bug_info,{i,"../foo"}], while all other files in the current directory
116 shall be compiled with only the debug_info flag.
117
118 {'file1',[debug_info,{i,"../foo"}]}.
119 {'*',[debug_info]}.
120
122 compile(3)
123
124
125
126Ericsson AB tools 3.5.2 make(3)