make(3erl)
π make β A Make Utility for Erlang π
okay so bestie, welcome to make(3erl) β the Erlang Module Definition for make, aka Erlang's very own take on UNIX Make. iykyk, this thing is iconic and you're gonna love her π
β¨ DESCRIPTION β¨
So the make module ships a set of functions that are basically the UNIX-type Make functions, but make it Erlang π¦. same energy, different font, no cap.
πΈ EXPORTS πΈ
π all() -> up_to_date | error
π all(Options) -> up_to_date | error
Types:
Options = [Option]
Option =
noexec | load | netload | {emake, Emake} |
compile:option()
Emake = [EmakeElement]
EmakeElement = Modules | {Modules, [compile:option()]}
Modules = atom() | [atom()]
okay so here's the tea β β this function figures out which modules to compile and which compile options to use. how? first it goes looking for the emake make option. if that's not there, it reads the config from a file named Emakefile (more on her below π). and if it can't find that file either? no worries, the set of modules to compile just defaults to all modules in the current working directory. slay, she's flexible πββοΈ
then she walks through the whole set of modules and recompiles every single module where at least one of these is true:
- there's no object file, or
- the source file has been modified since it was last compiled, or,
- an include file has been modified since the source file was last compiled.
as a lil side effect π the function prints the name of every module it tries to compile. and if compilation fails for a module, the make procedure stops right there and error is returned. no halfway situations, periodt π
Options is a list of make- and compiler options. the make options that exist are:
noexecβ No execution mode. it literally just prints the name of each module that needs to be compiled. all vibes, zero action π«Άloadβ Load mode. loads all recompiled modules.netloadβ Net load mode. loads all recompiled modules on all known nodes. she's networked, she's everywhere π{emake, Emake}β instead of reading theEmakefile, you just specify the configuration explicitly right there. main character behavior, honestly π
everything in Options that isn't a make option gets assumed to be a compiler option and is passed as-is to compile:file/2. and Options defaults to []. yes bestie, empty list, that's the default π
π files(ModFiles) -> up_to_date | error
π files(ModFiles, Options) -> up_to_date | error
Types:
ModFiles = [(Module :: module()) | (File :: file:filename())]
Options = [Option]
Option = noexec | load | netload | compile:option()
files/1,2 does exactly the same thing as all/0,1, but for the specified ModFiles, which is a list of module names or file names. and the file extension .erl may be omitted, so you don't gotta type it out β she gets it π
the Emakefile (if it exists) in the current directory is searched for compiler options for each module. and listen β if a given module does not exist in Emakefile, or if Emakefile doesn't exist at all, the module is still compiled. she's not gonna abandon you just because the config file ghosted you ππ«Ά
π¦ EMAKEFILE π¦
so make:all/0,1 and make:files/1,2 first look for {emake, Emake} in the options, and then go looking in the current working directory for a file named Emakefile. if present, Emake should contain elements like this:
Modules.
{Modules,Options}.
Modules is an atom or a list of atoms. it can be:
- a module name, e.g.
file1 - a module name in another directory, e.g.
'../foo/file3' - a set of modules specified with a wildcards, e.g.
'file*' - a wildcard indicating all modules in current directory, i.e.
'*' - a list of any of the above, e.g.
['file*','../foo/file3','File4']
Options is a list of compiler options.
Emakefile is read from top to bottom β¬οΈ and if a module matches more than one entry, the first match is the valid one. no cap, first come first served.
for example, this Emakefile right here means that file1 shall be compiled with the options [debug_info,{i,"../foo"}], while all other files in the current directory shall be compiled with only the debug_info flag. iconic, specific, gorgeous π
{'file1',[debug_info,{i,"../foo"}]}.
{'*',[debug_info]}.
β SEE ALSO β
go compile something, bestie. you got this πͺβ¨
Ericsson AB Β· tools 3.5.3 Β· make(3erl) β that's the source slash version slash date situation, mwah π sending you off with a kiss, xoxo ππ
π¦ where this page comes from
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u1 Β· Apache-2.0
- debian bookworm: erlang-manpages 1:25.2.3+dfsg-1+deb12u4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms