diff options
author | Björn Gustavsson <[email protected]> | 2017-02-09 11:44:28 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2017-02-09 11:44:28 +0100 |
commit | aff4e82fce59e4eaefa84ed0d1dd5c40927637e5 (patch) | |
tree | 56dd7ab69e25ec36a20e95c7040cc5d54af8eb36 /lib/stdlib/doc/src/c.xml | |
parent | b4471746fbf987b44420aa350dc3c2a899e6f0a5 (diff) | |
parent | 1d886081027c4d4fcfbf7f73d4708694cad582f5 (diff) | |
download | otp-aff4e82fce59e4eaefa84ed0d1dd5c40927637e5.tar.gz otp-aff4e82fce59e4eaefa84ed0d1dd5c40927637e5.tar.bz2 otp-aff4e82fce59e4eaefa84ed0d1dd5c40927637e5.zip |
Merge pull request #1312 from richcarl/shell-smart-compile
Extend shell c(...) to find and recompile modules
OTP-14190
Diffstat (limited to 'lib/stdlib/doc/src/c.xml')
-rw-r--r-- | lib/stdlib/doc/src/c.xml | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/lib/stdlib/doc/src/c.xml b/lib/stdlib/doc/src/c.xml index 55a77d1bc5..7666699183 100644 --- a/lib/stdlib/doc/src/c.xml +++ b/lib/stdlib/doc/src/c.xml @@ -52,13 +52,27 @@ <func> <name name="c" arity="1"/> <name name="c" arity="2"/> - <fsummary>Compile and load code in a file.</fsummary> + <name name="c" arity="3"/> + <fsummary>Compile and load a file or module.</fsummary> <desc> - <p>Compiles and then purges and loads the code for a file. - <c><anno>Options</anno></c> defaults to <c>[]</c>. Compilation is - equivalent to:</p> - <code type="none"> -compile:file(<anno>File</anno>, <anno>Options</anno> ++ [report_errors, report_warnings])</code> + <p>Compiles and then purges and loads the code for a module. + <c><anno>Module</anno></c> can be either a module name or a source + file path, with or without <c>.erl</c> extension. + <c><anno>Options</anno></c> defaults to <c>[]</c>.</p> + <p>If <c><anno>Module</anno></c> is an atom and is not the path of a + source file, then the code path is searched to locate the object + file for the module and extract its original compiler options and + source path. If the source file is not found in the original + location, <seealso + marker="filelib#find_source/1"><c>filelib:find_source/1</c></seealso> + is used to search for it relative to the directory of the object + file.</p> + <p>The source file is compiled with the the original + options appended to the given <c><anno>Options</anno></c>, the + output replacing the old object file if and only if compilation + succeeds. A function <c><anno>Filter</anno></c> can be specified + for removing elements from from the original compiler options + before the new options are added.</p> <p>Notice that purging the code means that any processes lingering in old code for the module are killed without warning. For more information, see <c>code/3</c>.</p> |