aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/guide/app.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-09-11 10:46:31 +0200
committerLoïc Hoguin <[email protected]>2015-09-11 10:46:31 +0200
commitdb7035bcfb0d6662fe70b9976f6f80fe5fcb446c (patch)
treef0e87d4ba4916a805a7797f123a5910ffebce9cc /doc/src/guide/app.asciidoc
parent6e768502f8eb46a7b2ae7e457ae55e32951027c6 (diff)
downloaderlang.mk-db7035bcfb0d6662fe70b9976f6f80fe5fcb446c.tar.gz
erlang.mk-db7035bcfb0d6662fe70b9976f6f80fe5fcb446c.tar.bz2
erlang.mk-db7035bcfb0d6662fe70b9976f6f80fe5fcb446c.zip
Add documentation for ERLC_OPTS
Diffstat (limited to 'doc/src/guide/app.asciidoc')
-rw-r--r--doc/src/guide/app.asciidoc38
1 files changed, 38 insertions, 0 deletions
diff --git a/doc/src/guide/app.asciidoc b/doc/src/guide/app.asciidoc
index ec1eb3f..528f6e3 100644
--- a/doc/src/guide/app.asciidoc
+++ b/doc/src/guide/app.asciidoc
@@ -201,6 +201,44 @@ Erlang.mk also comes with plugins for the following formats:
| .proto | src/ | Protocol buffers | ebin/*.beam
|===
+=== Compilation options
+
+Erlang.mk provides a few variables that you can use to customize
+the build process and the resulting files.
+
+==== ERLC_OPTS
+
+`ERLC_OPTS` can be used to pass some options to `erlc`, the Erlang
+compiler. Erlang.mk does not restrict any option. Please refer to
+the http://www.erlang.org/doc/man/erlc.html[erlc Manual] for the
+full list.
+
+By default, Erlang.mk will set the following options:
+
+[source,make]
+ERLC_OPTS = -Werror +debug_info +warn_export_vars +warn_shadow_vars +warn_obsolete_guard
+
+In other words: warnings as errors, debug info (recommended) and
+enable warnings for exported variables, shadow variables and
+obsolete guard functions.
+
+You can redefine this variable in your Makefile to change it
+completely, either before or after including Erlang.mk:
+
+[source,make]
+ERLC_OPTS = +debug_info
+
+You can also filter out some options from the defaults Erlang.mk
+sets, by defining ERLC_OPTS after including Erlang.mk using the
+`:=` operator.
+
+[source,make]
+----
+include erlang.mk
+
+ERLC_OPTS := $(filter-out -Werror,$(ERLC_OPTS))
+----
+
=== Cold and hot builds
The first time you run `make`, Erlang.mk will build everything.