aboutsummaryrefslogtreecommitdiffstats
path: root/guide/shell.html
blob: 2e79fb11b7aaa9f860e9c7282c451e36ff46ed43 (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
<!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="tests.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="eunit.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="shell"></a>Chapter 14. Erlang shell</h2></div></div></div><p>Erlang.mk provides a convenient target for starting a shell
with all the paths set properly to experiment with your code.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_configuration_2"></a>14.1. Configuration</h2></div></div></div><p>The <code class="literal">SHELL_DEPS</code> variable can be used to define dependencies
that are only to be used when the <code class="literal">make shell</code> command is called.
For example, if you want to use <span class="emphasis"><em>kjell</em></span> as your shell:</p><pre class="programlisting">SHELL_DEPS = kjell</pre><p>Dependencies are downloaded and compiled the first time you
run the <code class="literal">make shell</code> command.</p><p>You can customize the executable used to start the Erlang shell.
To continue with our example, if you want to use <span class="emphasis"><em>kjell</em></span> as your
shell, you also need to change <code class="literal">SHELL_ERL</code> and point it to the
<code class="literal">kjell</code> executable:</p><pre class="programlisting">SHELL_ERL = $(DEPS_DIR)/kjell/bin/kjell</pre><p>You can specify additional options to be used when starting the
shell using the <code class="literal">SHELL_OPTS</code> variable:</p><pre class="programlisting">SHELL_OPTS = -setcookie chocolate</pre><p>Any of the usual <code class="literal">erl</code> options can be used, including <code class="literal">-eval</code>:</p><pre class="programlisting">SHELL_OPTS = -eval 'my_app:run()'</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_usage"></a>14.2. Usage</h2></div></div></div><p>To start the shell, all you need is the following command:</p><pre class="programlisting">$ make shell</pre><p>The shell can be stopped as usual with a double Ctrl+C or the
command <code class="literal">q().</code>.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tests.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tests.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="eunit.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>