diff options
Diffstat (limited to 'docs/en/erlang.mk/1/guide')
-rw-r--r-- | docs/en/erlang.mk/1/guide/app.asciidoc | 14 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/app/index.html | 14 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/common_test.asciidoc | 6 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/common_test/index.html | 7 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/deps.asciidoc | 23 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/deps/index.html | 17 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/edoc.asciidoc | 13 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/edoc/index.html | 8 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/eunit.asciidoc | 2 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/eunit/index.html | 2 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/installation.asciidoc | 8 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/installation/index.html | 2 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/releases.asciidoc | 4 | ||||
-rw-r--r-- | docs/en/erlang.mk/1/guide/releases/index.html | 4 |
14 files changed, 118 insertions, 6 deletions
diff --git a/docs/en/erlang.mk/1/guide/app.asciidoc b/docs/en/erlang.mk/1/guide/app.asciidoc index 9d5e9488..226f24c4 100644 --- a/docs/en/erlang.mk/1/guide/app.asciidoc +++ b/docs/en/erlang.mk/1/guide/app.asciidoc @@ -25,6 +25,20 @@ and conventions. Most of the conventions come from Erlang/OTP itself so any seasoned Erlang developers should feel right at home. +Erlang.mk supports multi-threaded building. Parallel execution +is supported for all targets. To execute Erlang.mk in parallel +the `-j` option must be used: + +[source,bash] +$ make -j8 + +The `MAKEFLAGS` variable can be used to enable parallel +building permanently on your system. It can be set in +your `.zshrc`, `.bashrc` or equivalent file. + +[source,bash] +MAKEFLAGS="-j8" + === What to build Erlang.mk gives you control over three steps of the build diff --git a/docs/en/erlang.mk/1/guide/app/index.html b/docs/en/erlang.mk/1/guide/app/index.html index 13875dda..205542e0 100644 --- a/docs/en/erlang.mk/1/guide/app/index.html +++ b/docs/en/erlang.mk/1/guide/app/index.html @@ -74,6 +74,20 @@ http://www.gnu.org/software/src-highlite --> </div></div> <p>It will work regardless of your project: OTP applications, library applications, NIFs, port drivers or even releases. Erlang.mk also automatically downloads and compiles the dependencies for your project.</p> <p>All this is possible thanks to a combination of configuration and conventions. Most of the conventions come from Erlang/OTP itself so any seasoned Erlang developers should feel right at home.</p> +<p>Erlang.mk supports multi-threaded building. Parallel execution is supported for all targets. To execute Erlang.mk in parallel the <code>-j</code> option must be used:</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><tt>$ make -j<font color="#993399">8</font></tt></pre> +</div></div> +<p>The <code>MAKEFLAGS</code> variable can be used to enable parallel building permanently on your system. It can be set in your <code>.zshrc</code>, <code>.bashrc</code> or equivalent file.</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><tt><font color="#009900">MAKEFLAGS</font><font color="#990000">=</font><font color="#FF0000">"-j8"</font></tt></pre> +</div></div> <h2 id="_what_to_build">What to build</h2> <p>Erlang.mk gives you control over three steps of the build process, allowing you to do a partial build if needed.</p> <p>A build has three phases: first any dependency is fetched and built, then the project itself is built and finally a release may be generated when applicable. A release is only generated for projects specifically configured to do so.</p> diff --git a/docs/en/erlang.mk/1/guide/common_test.asciidoc b/docs/en/erlang.mk/1/guide/common_test.asciidoc index f8f0de3d..993bb8cd 100644 --- a/docs/en/erlang.mk/1/guide/common_test.asciidoc +++ b/docs/en/erlang.mk/1/guide/common_test.asciidoc @@ -93,5 +93,11 @@ as a dependency, you can run the following directly: [source,bash] $ make -C deps/cowboy ct-http t=http_compress +The variable `c` can be used to run a specific test when +the test suite does not group test cases: + +[source,bash] +$ make ct-http c=headers_dupe + Finally, xref:coverage[code coverage] is available, but covered in its own chapter. diff --git a/docs/en/erlang.mk/1/guide/common_test/index.html b/docs/en/erlang.mk/1/guide/common_test/index.html index 8c4c66d2..c50f40be 100644 --- a/docs/en/erlang.mk/1/guide/common_test/index.html +++ b/docs/en/erlang.mk/1/guide/common_test/index.html @@ -146,6 +146,13 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt>$ make -C deps/cowboy ct-http <font color="#009900">t</font><font color="#990000">=</font>http_compress</tt></pre> </div></div> +<p>The variable <code>c</code> can be used to run a specific test when the test suite does not group test cases:</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><tt>$ make ct-http <font color="#009900">c</font><font color="#990000">=</font>headers_dupe</tt></pre> +</div></div> <p>Finally, <a href="../coverage">code coverage</a> is available, but covered in its own chapter.</p> diff --git a/docs/en/erlang.mk/1/guide/deps.asciidoc b/docs/en/erlang.mk/1/guide/deps.asciidoc index 84a53de1..3ba7a398 100644 --- a/docs/en/erlang.mk/1/guide/deps.asciidoc +++ b/docs/en/erlang.mk/1/guide/deps.asciidoc @@ -163,6 +163,7 @@ The following table lists all existing methods: |=== | Name | Format | Description | git | git repo commit | Clone the Git repository and checkout the given version +| git-subfolder | git repo commit subfolder | Clone the Git repository, checkout the given version and use one of its subfolders as a dependency | git-submodule | git-submodule | Initialize and update the Git submodule | hg | hg repo commit | Clone the Mercurial repository and update to the given version | svn | svn repo | Checkout the given SVN repository @@ -514,6 +515,28 @@ projects using the `NO_AUTOPATCH` variable: [source,make] NO_AUTOPATCH = cowboy ranch cowlib +=== Dealing with duplicate modules + +When there are duplicate modules found in both applications +and their dependencies, some tasks may fail. Erlang expects +modules to be unique in general. + +When the duplicates are found in dependencies, you will need +to remove one of the duplicates at fetch time. To do so, you +can add a rule similar to this to your Makefile before including +'erlang.mk': + +[source,make] +---- +DEPS_DIR = $(CURDIR)/deps + +deps:: $(DEPS_DIR)/cowlib + $(verbose) rm -f $(DEPS_DIR)/cowlib/src/cow_ws.erl +---- + +This must be done from the application that has this dependency. +Only define the `DEPS_DIR` variable if necessary. + === Skipping deps It is possible to temporarily skip all dependency operations. diff --git a/docs/en/erlang.mk/1/guide/deps/index.html b/docs/en/erlang.mk/1/guide/deps/index.html index 44c325d0..11e9171f 100644 --- a/docs/en/erlang.mk/1/guide/deps/index.html +++ b/docs/en/erlang.mk/1/guide/deps/index.html @@ -187,6 +187,10 @@ http://www.gnu.org/software/src-highlite --> <td>git repo commit</td> <td>Clone the Git repository and checkout the given version</td> </tr> +<tr><td>git-subfolder</td> +<td>git repo commit subfolder</td> +<td>Clone the Git repository, checkout the given version and use one of its subfolders as a dependency</td> +</tr> <tr><td>git-submodule</td> <td>git-submodule</td> <td>Initialize and update the Git submodule</td> @@ -426,6 +430,19 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt><font color="#009900">NO_AUTOPATCH =</font> cowboy ranch cowlib</tt></pre> </div></div> +<h2 id="_dealing_with_duplicate_modules">Dealing with duplicate modules</h2> +<p>When there are duplicate modules found in both applications and their dependencies, some tasks may fail. Erlang expects modules to be unique in general.</p> +<p>When the duplicates are found in dependencies, you will need to remove one of the duplicates at fetch time. To do so, you can add a rule similar to this to your Makefile before including <em>erlang.mk</em>:</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><tt><font color="#009900">DEPS_DIR =</font> <font color="#009900">$(CURDIR)</font>/deps + +<font color="#990000">deps::</font> <font color="#009900">$(DEPS_DIR)</font>/cowlib + <font color="#009900">$(verbose)</font> rm -f <font color="#009900">$(DEPS_DIR)</font>/cowlib/src/cow_ws.erl</tt></pre> +</div></div> +<p>This must be done from the application that has this dependency. Only define the <code>DEPS_DIR</code> variable if necessary.</p> <h2 id="_skipping_deps">Skipping deps</h2> <p>It is possible to temporarily skip all dependency operations. This is done by defining the <code>SKIP_DEPS</code> variable. Use cases include being somewhere with no connection to download them, or perhaps a peculiar setup.</p> <p>A typical usage would be:</p> diff --git a/docs/en/erlang.mk/1/guide/edoc.asciidoc b/docs/en/erlang.mk/1/guide/edoc.asciidoc index 9fc1a740..2992a37d 100644 --- a/docs/en/erlang.mk/1/guide/edoc.asciidoc +++ b/docs/en/erlang.mk/1/guide/edoc.asciidoc @@ -46,3 +46,16 @@ the following to your Makefile: ---- docs:: edoc ---- + +=== Running EDoc on all applications + +In a multi-application project you may want to run EDoc +against all applications at the same time, instead of +against each applications independently. To do so, you +need to configure the `EDOC_SRC_DIRS` at the end of +your Makefile, after including 'erlang.mk': + +[source,make] +---- +EDOC_SRC_DIRS = $(ALL_APPS_DIRS) +---- diff --git a/docs/en/erlang.mk/1/guide/edoc/index.html b/docs/en/erlang.mk/1/guide/edoc/index.html index 513cb07f..ff876b37 100644 --- a/docs/en/erlang.mk/1/guide/edoc/index.html +++ b/docs/en/erlang.mk/1/guide/edoc/index.html @@ -98,6 +98,14 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt><font color="#990000">docs::</font> edoc</tt></pre> </div></div> +<h2 id="_running_edoc_on_all_applications">Running EDoc on all applications</h2> +<p>In a multi-application project you may want to run EDoc against all applications at the same time, instead of against each applications independently. To do so, you need to configure the <code>EDOC_SRC_DIRS</code> at the end of your Makefile, after including <em>erlang.mk</em>:</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 +by Lorenzo Bettini +http://www.lorenzobettini.it +http://www.gnu.org/software/src-highlite --> +<pre><tt><font color="#009900">EDOC_SRC_DIRS =</font> <font color="#009900">$(ALL_APPS_DIRS)</font></tt></pre> +</div></div> diff --git a/docs/en/erlang.mk/1/guide/eunit.asciidoc b/docs/en/erlang.mk/1/guide/eunit.asciidoc index 496b6749..41e26e39 100644 --- a/docs/en/erlang.mk/1/guide/eunit.asciidoc +++ b/docs/en/erlang.mk/1/guide/eunit.asciidoc @@ -65,7 +65,7 @@ to be passed to `erl` when running EUnit tests. For example, you can load the 'vm.args' and 'sys.config' files: [source,make] -EUNIT_ERL_OPTS = -args_file rel/vm.args -config rel/sys.config +EUNIT_ERL_OPTS = -args_file config/vm.args -config config/sys.config === Usage diff --git a/docs/en/erlang.mk/1/guide/eunit/index.html b/docs/en/erlang.mk/1/guide/eunit/index.html index ba47b6c2..502c76da 100644 --- a/docs/en/erlang.mk/1/guide/eunit/index.html +++ b/docs/en/erlang.mk/1/guide/eunit/index.html @@ -104,7 +104,7 @@ http://www.gnu.org/software/src-highlite --> by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><tt><font color="#009900">EUNIT_ERL_OPTS =</font> -args_file rel/vm.args -config rel/sys.config</tt></pre> +<pre><tt><font color="#009900">EUNIT_ERL_OPTS =</font> -args_file config/vm.args -config config/sys.config</tt></pre> </div></div> <h2 id="_usage">Usage</h2> <p>To run all tests (including EUnit):</p> diff --git a/docs/en/erlang.mk/1/guide/installation.asciidoc b/docs/en/erlang.mk/1/guide/installation.asciidoc index 3298db2d..254b461d 100644 --- a/docs/en/erlang.mk/1/guide/installation.asciidoc +++ b/docs/en/erlang.mk/1/guide/installation.asciidoc @@ -28,6 +28,9 @@ Alpine Linux and other distributions based on BusyBox come with an incompatible `awk` program. Installing the GNU Awk (`gawk` on Alpine) solves this issue. +Parallel builds may require the program `flock` that can +be found in the package `util-linux`. + ==== FreeBSD FreeBSD comes with binary and source packages: @@ -56,6 +59,11 @@ is the one provided by Apple. [source,bash] $ sudo port install erlang git gmake +Parallel builds may require the program `flock` which can +be installed via Homebrew or manually. The instructions +to install are available from its repository: +https://github.com/discoteq/flock + === On Windows Erlang.mk can be used on Windows inside an MSYS2 environment. diff --git a/docs/en/erlang.mk/1/guide/installation/index.html b/docs/en/erlang.mk/1/guide/installation/index.html index 3d49f35e..981bab8d 100644 --- a/docs/en/erlang.mk/1/guide/installation/index.html +++ b/docs/en/erlang.mk/1/guide/installation/index.html @@ -77,6 +77,7 @@ http://www.gnu.org/software/src-highlite --> <pre><tt>$ pacman -S erlang git make</tt></pre> </div></div> <p>Alpine Linux and other distributions based on BusyBox come with an incompatible <code>awk</code> program. Installing the GNU Awk (<code>gawk</code> on Alpine) solves this issue.</p> +<p>Parallel builds may require the program <code>flock</code> that can be found in the package <code>util-linux</code>.</p> <h4 id="_freebsd">FreeBSD</h4> <p>FreeBSD comes with binary and source packages:</p> <div class="listingblock"><div class="title">Install binary packages</div> @@ -104,6 +105,7 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt>$ sudo port install erlang git gmake</tt></pre> </div></div> +<p>Parallel builds may require the program <code>flock</code> which can be installed via Homebrew or manually. The instructions to install are available from its repository: <a href="https://github.com/discoteq/flock">https://github.com/discoteq/flock</a></p> <h2 id="_on_windows">On Windows</h2> <p>Erlang.mk can be used on Windows inside an MSYS2 environment. Cygwin, MSYS (the original) and native Windows (both Batch and PowerShell) are currently not supported.</p> <p>NOTE: Erlang.mk expects Unix line breaks in most of the files (LF instead of CRLF). Make sure to configure your text editor adequately.</p> diff --git a/docs/en/erlang.mk/1/guide/releases.asciidoc b/docs/en/erlang.mk/1/guide/releases.asciidoc index f1e20e6b..92968ff8 100644 --- a/docs/en/erlang.mk/1/guide/releases.asciidoc +++ b/docs/en/erlang.mk/1/guide/releases.asciidoc @@ -124,7 +124,7 @@ Your release was upgraded! There is a *workaround* to get the semver value which is generated by Relx based on VCS history. -Create a file 'rel/version' with only one line inside: +Create a file 'config/version' with only one line inside: [source,erlang] {{ release_version }} @@ -133,7 +133,7 @@ Add/Update the `overlay` section of your `relx.config`: [source,erlang] {overlay, [ - {template, "rel/version", "version"} + {template, "config/version", "version"} ]}. When you run `make rel` it creates the file '$(RELX_OUTPUT_DIR)/example/version' diff --git a/docs/en/erlang.mk/1/guide/releases/index.html b/docs/en/erlang.mk/1/guide/releases/index.html index 3224897f..86dc56f1 100644 --- a/docs/en/erlang.mk/1/guide/releases/index.html +++ b/docs/en/erlang.mk/1/guide/releases/index.html @@ -152,7 +152,7 @@ http://www.gnu.org/software/src-highlite --> <p>Your release was upgraded!</p> <h2 id="_getting_relx_semver_value">Getting Relx semver value</h2> <p>There is a <strong>workaround</strong> to get the semver value which is generated by Relx based on VCS history.</p> -<p>Create a file <em>rel/version</em> with only one line inside:</p> +<p>Create a file <em>config/version</em> with only one line inside:</p> <div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 by Lorenzo Bettini http://www.lorenzobettini.it @@ -165,7 +165,7 @@ by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><tt>{<font color="#FF6600">overlay</font>, [ - {<font color="#FF6600">template</font>, <font color="#FF0000">"rel/version"</font>, <font color="#FF0000">"version"</font>} + {<font color="#FF6600">template</font>, <font color="#FF0000">"config/version"</font>, <font color="#FF0000">"version"</font>} ]}<font color="#990000">.</font></tt></pre> </div></div> <p>When you run <code>make rel</code> it creates the file <em>$(RELX_OUTPUT_DIR)/example/version</em> which contains the version value generated by Relx.</p> |