From b5d4cb91f80c833795a2d87050c3674bb7aecdc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 3 Oct 2017 13:39:41 +0200 Subject: Update Hugo, docs --- docs/en/erlang.mk/1/guide/escripts/index.html | 184 ++++++++++++++------------ 1 file changed, 96 insertions(+), 88 deletions(-) (limited to 'docs/en/erlang.mk/1/guide/escripts/index.html') diff --git a/docs/en/erlang.mk/1/guide/escripts/index.html b/docs/en/erlang.mk/1/guide/escripts/index.html index 2bdc36bf..89cffc80 100644 --- a/docs/en/erlang.mk/1/guide/escripts/index.html +++ b/docs/en/erlang.mk/1/guide/escripts/index.html @@ -7,7 +7,7 @@ - + Nine Nines: Escripts @@ -67,97 +67,105 @@

Escripts

-

Escripts are an alternative to release. They are meant to be -used for small command line executables written in Erlang.

-

They are not self-contained, unlike releases. -Erlang must be installed for them to run. This however means -that they are fairly small compared to releases.

-

For self-contained executables, check self-extracting releases.

-
-

Requirements

-
-

Erlang.mk uses p7zip by default to generate the escript -archive. Make sure it is installed. On most systems the -package is named p7zip; on Ubuntu you need p7zip-full.

-

If p7zip is unavailable, zip may be used by setting -the ESCRIPT_ZIP variable. For example:

-
-
-
$ make escript ESCRIPT_ZIP=zip
-
-
-
-

Generating an escript

-
-

Run the following command to generate an escript:

-
-
-
$ make escript
-

This will by default create an escript with the same name as -the project, in the project’s directory. If the project is -called relx then the escript will be in ./relx.

-

You can run the escript as you would any executable:

-
-
-
$ ./relx
-
-
-
-

Configuration

-
-

You can change the name of the escript by setting ESCRIPT_NAME. -The name determines both the default output file name and the -entry module containing the function main/1.

-

ESCRIPT_FILE can be set if you need a different file name -or location.

-

The escript header can be entirely customized. The first line -is the shebang, set by ESCRIPT_SHEBANG. The second line is -a comment, set by ESCRIPT_COMMENT. The third line is the -arguments the VM will use when running the escript, set by -ESCRIPT_EMU_ARGS.

-

Finally, ESCRIPT_ZIP can be set to customize the command used -to create the zip file. Read on for more information.

-
-
-
-

Extra files

-
-

Generating an escript is a two-part process. First, a zip file -is created with the contents of the escript. Then a header is -added to this file to create the escript.

-

It is possible to add commands that will be executed between -the two steps. You can for example add extra files to the zip -archive:

-
-
-

The ESCRIPT_ZIP variable contains the command to run to add -files to the zip archive ESCRIPT_ZIP_FILE.

-
-
-
-

Optimizing for size

-
-

Erlang.mk will by default compile BEAM files with debug -information. You may want to disable this behavior to obtain -smaller escript files. Simply set ERLC_OPTS to a value that -does not include +debug_info.

-
-
+

Escripts are an alternative to release. They are meant to be +used for small command line executables written in Erlang.

+

They are not self-contained, unlike releases. +Erlang must be installed for them to run. This however means +that they are fairly small compared to releases.

+

For self-contained executables, check self-extracting releases.

+
+

Requirements

+
+

Erlang.mk uses p7zip by default to generate the escript +archive. Make sure it is installed. On most systems the +package is named p7zip; on Ubuntu you need p7zip-full.

+

If p7zip is unavailable, zip may be used by setting +the ESCRIPT_ZIP variable. For example:

+
+
+
$ make escript ESCRIPT_ZIP=zip
+
+
+
+

Generating an escript

+
+

Run the following command to generate an escript:

+
+
+
$ make escript
+

This will by default create an escript with the same name as +the project, in the project’s directory. If the project is +called relx then the escript will be in ./relx.

+

You can run the escript as you would any executable:

+
+
+
$ ./relx
+
+
+
+

Configuration

+
+

You can change the name of the escript by setting ESCRIPT_NAME. +The name determines both the default output file name and the +entry module containing the function main/1.

+

ESCRIPT_FILE can be set if you need a different file name +or location.

+

The escript header can be entirely customized. The first line +is the shebang, set by ESCRIPT_SHEBANG. The second line is +a comment, set by ESCRIPT_COMMENT. The third line is the +arguments the VM will use when running the escript, set by +ESCRIPT_EMU_ARGS.

+

Finally, ESCRIPT_ZIP can be set to customize the command used +to create the zip file. Read on for more information.

+
+
+
+

Extra files

+
+

Generating an escript is a two-part process. First, a zip file +is created with the contents of the escript. Then a header is +added to this file to create the escript.

+

It is possible to add commands that will be executed between +the two steps. You can for example add extra files to the zip +archive:

+
+
+
escript-zip::
+    $(verbose) $(ESCRIPT_ZIP) $(ESCRIPT_ZIP_FILE) priv/templates/*
+

The ESCRIPT_ZIP variable contains the command to run to add +files to the zip archive ESCRIPT_ZIP_FILE.

+
+
+
+

Optimizing for size

+
+

Erlang.mk will by default compile BEAM files with debug +information. You may want to disable this behavior to obtain +smaller escript files. Simply set ERLC_OPTS to a value that +does not include +debug_info.

+
+
+ + + -- cgit v1.2.3