diff options
author | Jean-Sébastien Pédron <[email protected]> | 2009-12-14 23:04:00 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-02-18 12:20:41 +0100 |
commit | dd3e666c5114f81c9518e9f5ba14959ced079ab6 (patch) | |
tree | 87b38ff7f2c660e5426c371fae6dc66064e1fd77 /lib/compiler/doc/src/compile.xml | |
parent | ab1c28eadc968d8475ce42a97b2ae143590d5cc1 (diff) | |
download | otp-dd3e666c5114f81c9518e9f5ba14959ced079ab6.tar.gz otp-dd3e666c5114f81c9518e9f5ba14959ced079ab6.tar.bz2 otp-dd3e666c5114f81c9518e9f5ba14959ced079ab6.zip |
Add dependencies Makefile generation to erlc(1) and compile(3)
This is useful when a project is built with Makefiles and erlc(1)
instead of EMakefiles. Tracking dependencies by hand is error-prone and
it becomes painful when using external application headers like EUnit's
one.
A dependencies Makefile will look like this:
module.beam: module.erl \
/usr/local/lib/erlang/lib/eunit-2.1.4/include/eunit.hrl \
header.hrl
When included in the main Makefile, 'module' will be recompiled only
when needed.
GCC offers the same feature and new erlc(1) options are compatible with
it.
More informations at:
http://wiki.github.com/dumbbell/otp/dependencies-makefile
Diffstat (limited to 'lib/compiler/doc/src/compile.xml')
-rw-r--r-- | lib/compiler/doc/src/compile.xml | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index c3d65b4cb5..77f3e9b0be 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -164,6 +164,70 @@ for details.</p> </item> + <tag><c>makedep</c></tag> + <item> + <p>Produce a Makefile rule to track headers dependencies. + No object file is produced. + </p> + <p>By default, this rule is written to + <c><![CDATA[<File>.Pbeam]]></c>. However, if the option + <c>binary</c> is set, nothing is written and the rule is + returned in <c>Binary</c>. + </p> + <p>For instance, if one has the following module: + </p> + <code> +-module(module). + +-include_lib("eunit/include/eunit.hrl"). +-include("header.hrl"). + </code> + <p>Here is the Makefile rule generated by this option: + </p> + <code> +module.beam: module.erl \ + /usr/local/lib/erlang/lib/eunit/include/eunit.hrl \ + header.hrl + </code> + </item> + + <tag><c>{makedep_output, Output}</c></tag> + <item> + <p>Write generated rule(s) to <c>Output</c> instead of the + default <c><![CDATA[<File>.Pbeam]]></c>. <c>Output</c> + can be a filename or an <c>io_device()</c>. To write to + stdout, use <c>standard_io</c>. However if <c>binary</c> + is set, nothing is written to <c>Output</c> and the + result is returned to the caller with + <c>{ok, ModuleName, Binary}</c>. + </p> + </item> + + <tag><c>{makedep_target, Target}</c></tag> + <item> + <p>Change the name of the rule emitted to <c>Target</c>. + </p> + </item> + + <tag><c>makedep_quote_target</c></tag> + <item> + <p>Characters in <c>Target</c> special to make(1) are quoted. + </p> + </item> + + <tag><c>makedep_add_missing</c></tag> + <item> + <p>Consider missing headers as generated files and add them to the + dependencies. + </p> + </item> + + <tag><c>makedep_phony</c></tag> + <item> + <p>Add a phony target for each dependency. + </p> + </item> + <tag><c>'P'</c></tag> <item> <p>Produces a listing of the parsed code after preprocessing |