From 4684b443bbe71bd9b7acd7a4b5aec5160031ae71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 4 Jun 2018 12:04:40 +0200 Subject: Update user guide --- guide/getting_started.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'guide/getting_started.html') diff --git a/guide/getting_started.html b/guide/getting_started.html index 06b92cd..d779c71 100644 --- a/guide/getting_started.html +++ b/guide/getting_started.html @@ -62,8 +62,7 @@ cp .erlang.mk.build/erlang.mk ./erlang.mk rm -rf .erlang.mk.build

This is Erlang.mk bootstrapping itself. Indeed, the file you initially downloaded contains nothing more than the code needed to bootstrap. This operation is done only once. Consult the -Updating Erlang.mk -Chapter 4, Updating Erlang.mk chapter for more +Updating Erlang.mk chapter for more information.

Of course, the generated project can now be compiled:

$ make

Cheers!

2.4. Getting started with OTP libraries

An OTP library is an Erlang application that has no supervision tree. In other words, it is nothing but modules.

This kind of project can also be generated by Erlang.mk, using the bootstrap-lib target:

$ make -f erlang.mk bootstrap-lib

Erlang.mk will once again bootstrap itself and generate all @@ -76,7 +75,6 @@ create a project that will build a release:

$ mak
 commands useful during operations, and put the components
 of the system in separate applications that you will then
 depend on. Consult the Packages and dependencies
-Chapter 7, Packages and dependencies
 chapter for more information.

When you run make from now on, Erlang.mk will compile your project and build the release:

$ make
  APP    hello_joe.app.src
@@ -93,7 +91,6 @@ project and build the release:

$ make
 relx, the release building tool. So don’t worry if you see
 more output than above.

If building the release is slow, no need to upgrade your hardware just yet. Just consult the Releases -Chapter 9, Releases chapter for various tips to speed up build time during development.

You can start the release using the ./_rel/hello_joe_release/bin/hello_joe_release script, or simply run make run. The latter will also compile @@ -135,7 +132,7 @@ boilerplate. It is rarely an issue of course, except when creating new modules. That’s why Erlang.mk not only comes with templates for generating projects, but also individual modules!

You can list all available templates with the list-templates target:

$ make list-templates
-Available templates: cowboy_http cowboy_loop cowboy_rest cowboy_ws gen_fsm gen_server ranch_protocol supervisor

To generate a module, let’s say a gen_server, all you need to +Available templates: cowboy_http cowboy_loop cowboy_rest cowboy_ws gen_fsm gen_server gen_statem ranch_protocol supervisor

To generate a module, let’s say a gen_server, all you need to do is to call make new with the appropriate arguments:

$ make new t=gen_server n=my_server

This will create a module located in src/my_server.erl using the gen_server template.

This module is automatically compiled the next time you run make:

$ make
-- 
cgit v1.2.3