Chapter 3. Overview

Now that you know how to get started, let’s take a look at what Erlang.mk can do for you.

3.1. Building your project

Erlang.mk is first and foremost a build tool. It is especially tailored for Erlang developers and follows widely accepted practices in the Erlang community.

Erlang.mk will happily build all Erlang-specific files Chapter 6, Building you throw at it. Other kinds of files too, like C or C++ code when you are working on a NIF or a port driver Chapter 8, NIFs and port drivers.

Erlang.mk embraces the concept of source dependencies Chapter 7, Packages and dependencies. It can fetch dependency source code using a variety of mechanisms, including fetching from Git, Mercurial or SVN.

Erlang.mk will automatically generate releases Chapter 9, Releases when applicable. It can also generate escripts Chapter 11, Escripts.

3.2. Exploring the package index

Erlang.mk comes with a built-in package index Chapter 7, Packages and dependencies. It is built as an extension of the dependency system and is meant to be used for discovery purposes.

No package is ever installed, they are only used as dependencies and are always project-specific. They can be thought of as a shortcut over plain dependencies.

You can get a list of all packages known to Erlang.mk by using the search target:

$ make search

You can also use this target to search across all packages, for example to find all packages related to Cowboy:

$ make search q=cowboy

3.3. Generating documentation

Erlang.mk supports EDoc and Asciidoc.

EDoc Chapter 15, EDoc comments generates HTML documentation directly from your source code.

While it is convenient, ask yourself: if all the documentation is inside the source code, why not just open the source code directly? That’s where Asciidoc comes in.

The Asciidoc Chapter 14, AsciiDoc documentation plugin expects all documentation to be separate from source. It will generate HTML, PDF, man pages and more from the documentation you write in the doc/src/ folder in your repository.

3.4. Running tests

Erlang.mk supports a lot of different testing and static analysis tools.

The make shell Chapter 17, Erlang shell command allows you to test your project manually. You can automate these unit tests with EUnit Chapter 18, EUnit and test your entire system with Common Test Chapter 19, Common Test. Code coverage Chapter 20, Code coverage can of course be enabled during tests.

Erlang.mk comes with features to make your life easier when setting up and using Continuous integration Chapter 21, Continuous integration.

On the static analysis side of things, Erlang.mk comes with support for Dialyzer Chapter 22, Dialyzer and Xref Chapter 23, Xref, to perform success typing analysis and cross referencing of the code.

3.5. Need more?

Not convinced yet? You can read about why you should use Erlang.mk Chapter 26, Why Erlang.mk and its history Chapter 27, Short history. And if you’re still not convinced after that, it’s OK! The world would be boring if everyone agreed on everything all the time.