.TH make 3erl "tools 3.5.3" "Ericsson AB" "Erlang Module Definition" .SH NAME make \- A Make Utility for Erlang .SH DESCRIPTION .LP The module \fImake\fR\& provides a set of functions similar to the UNIX type \fIMake\fR\& functions\&. .SH EXPORTS .LP .nf .B all() -> up_to_date | error .br .fi .br .nf .B all(Options) -> up_to_date | error .br .fi .br .RS .LP Types: .RS 3 Options = [Option] .br Option = .br noexec | load | netload | {emake, Emake} | compile:option() .br Emake = [EmakeElement] .br EmakeElement = Modules | {Modules, [compile:option()]} .br Modules = atom() | [atom()] .br .RE .RE .RS .LP This function determines the set of modules to compile and the compile options to use, by first looking for the \fIemake\fR\& make option, if not present reads the configuration from a file named \fIEmakefile\fR\& (see below)\&. If no such file is found, the set of modules to compile defaults to all modules in the current working directory\&. .LP Traversing the set of modules, it then recompiles every module for which at least one of the following conditions apply: .RS 2 .TP 2 * there is no object file, or .LP .TP 2 * the source file has been modified since it was last compiled, or, .LP .TP 2 * an include file has been modified since the source file was last compiled\&. .LP .RE .LP As a side effect, the function prints the name of each module it tries to compile\&. If compilation fails for a module, the make procedure stops and \fIerror\fR\& is returned\&. .LP \fIOptions\fR\& is a list of make- and compiler options\&. The following make options exist: .RS 2 .TP 2 * \fInoexec\fR\& .br No execution mode\&. Just prints the name of each module that needs to be compiled\&. .LP .TP 2 * \fIload\fR\& .br Load mode\&. Loads all recompiled modules\&. .LP .TP 2 * \fInetload\fR\& .br Net load mode\&. Loads all recompiled modules on all known nodes\&. .LP .TP 2 * \fI{emake, Emake}\fR\& .br Rather than reading the \fIEmakefile\fR\& specify configuration explicitly\&. .LP .RE .LP All items in \fIOptions\fR\& that are not make options are assumed to be compiler options and are passed as-is to \fIcompile:file/2\fR\&\&. \fIOptions\fR\& defaults to \fI[]\fR\&\&. .RE .LP .nf .B files(ModFiles) -> up_to_date | error .br .fi .br .nf .B files(ModFiles, Options) -> up_to_date | error .br .fi .br .RS .LP Types: .RS 3 ModFiles = [(Module :: module()) | (File :: file:filename())] .br Options = [Option] .br Option = noexec | load | netload | compile:option() .br .RE .RE .RS .LP \fIfiles/1,2\fR\& does exactly the same thing as \fIall/0,1\fR\& but for the specified \fIModFiles\fR\&, which is a list of module or file names\&. The file extension \fI\&.erl\fR\& may be omitted\&. .LP The \fIEmakefile\fR\& (if it exists) in the current directory is searched for compiler options for each module\&. If a given module does not exist in \fIEmakefile\fR\& or if \fIEmakefile\fR\& does not exist, the module is still compiled\&. .RE .SH "EMAKEFILE" .LP \fImake:all/0,1\fR\& and \fImake:files/1,2\fR\& first looks for \fI{emake, Emake}\fR\& in options, then in the current working directory for a file named \fIEmakefile\fR\&\&. If present \fIEmake\fR\& should contain elements like this: .LP .nf Modules. {Modules,Options}. .fi .LP \fIModules\fR\& is an atom or a list of atoms\&. It can be .RS 2 .TP 2 * a module name, e\&.g\&. \fIfile1\fR\& .LP .TP 2 * a module name in another directory, e\&.g\&. \fI\&'\&.\&./foo/file3\&'\fR\& .LP .TP 2 * a set of modules specified with a wildcards, e\&.g\&. \fI\&'file*\&'\fR\& .LP .TP 2 * a wildcard indicating all modules in current directory, i\&.e\&. \fI\&'*\&'\fR\& .LP .TP 2 * a list of any of the above, e\&.g\&. \fI[\&'file*\&',\&'\&.\&./foo/file3\&',\&'File4\&']\fR\& .LP .RE .LP \fIOptions\fR\& is a list of compiler options\&. .LP \fIEmakefile\fR\& is read from top to bottom\&. If a module matches more than one entry, the first match is valid\&. For example, the following \fIEmakefile\fR\& means that \fIfile1\fR\& shall be compiled with the options \fI[debug_info,{i,"\&.\&./foo"}]\fR\&, while all other files in the current directory shall be compiled with only the \fIdebug_info\fR\& flag\&. .LP .nf {'file1',[debug_info,{i,"../foo"}]}. {'*',[debug_info]}. .fi .LP .SH "SEE ALSO" .LP \fIcompile(3erl)\fR\&