aboutsummaryrefslogtreecommitdiffstats
path: root/guide/sfx.html
blob: e31cb98a89532299ed0d37b2c923051906762d8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Erlang.mk User Guide</title>
<style type="text/css"><!--
body{background:white;color:black;font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;justify-content:center;margin:0 auto;padding:0;width:600px}
header {align-items:center;display:flex;justify-content:center}
header nav.left{text-align:right;width:150px}
header nav.right{text-align:left;width:150px}
header nav a{display:block;margin:1.5em 1em}
main{margin-top:2em;text-align:justify}
main h2, main h3{margin-top:2em}
main h1, main div.chapter>div.titlepage h2{font-size:2em;margin-top:.67em}
a{color:#d9230f;text-decoration:none}
a:hover{text-decoration:underline}
a.xref{display:none}
h1, h2, h3{font-weight:normal}
div.navfooter{margin-bottom:1em}
--></style>
</head>
<body>
<header>
	<nav class="left">
		<a href="index.html">User guide</a>
		<a href="getting_started.html">Tutorials</a>
	</nav>
	<a href="/" class="logo"><img src="../res/logo-small.png" alt="Erlang.mk" title="Erlang.mk: A build tool for Erlang that just works" height="200" width="206"/></a>
	<nav class="right">
		<a href="https://github.com/ninenines/erlang.mk/tree/master/index">470+ packages</a>
		<a href="https://github.com/ninenines/erlang.mk/issues">Issues?</a>
	</nav>
</header>
<main>

<div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="relx.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="escript.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="sfx"></a>Chapter 10. Self-extracting releases</h2></div></div></div><p>Erlang.mk allows you to package <a class="link" href="relx.html" title="Chapter 9. Releases">Relx releases</a> as
self-extracting archives. These archives contain all the
files in the release and come in the form of a script that
will extract and run the release automatically.</p><p>This allows you to package the release as a single file
that can then be executed.</p><p>This feature is currently experimental. Feedback is much
appreciated.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_generating_the_self_extracting_archive"></a>10.1. Generating the self-extracting archive</h2></div></div></div><p>To generate a self-extracting release, all you need to do
is pass the <code class="literal">SFX=1</code> variable to Make when you build the
release:</p><pre class="programlisting">$ make SFX=1</pre><p>This will create a self-extracting archive in
<code class="literal">$RELX_OUTPUT_DIR/&lt;name&gt;.run</code>. For example if the release
is named <code class="literal">hello_world</code> and <code class="literal">$RELX_OUTPUT_DIR</code> is the default,
the file will be located at <code class="literal">_rel/hello_world.run</code>.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_running_the_release_2"></a>10.2. Running the release</h2></div></div></div><p>Simply execute the script to get started:</p><pre class="programlisting">$ ./_rel/hello_world.run
Exec: /tmp/tmp.3eeEq7E1ta/erts-8.1/bin/erlexec ...
Root: /tmp/tmp.3eeEq7E1ta
/tmp/tmp.3eeEq7E1ta
Erlang/OTP 19 [erts-8.1] [source] [64-bit] [smp:4:4] ...

Eshell V8.1  (abort with ^G)
(hello_world@localhost)1&gt;</pre><p>As you can see the archive is extracted to a temporary
directory before the release can be started.</p><p>The self-extracting script currently only supports starting
the release in <code class="literal">console</code> mode.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="relx.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="code.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="escript.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
</main>
</body>
</html>