aboutsummaryrefslogtreecommitdiffstats
path: root/guide/ch04.html
blob: c2e8e705f3c44936c6837d02c46299c1dc68704d (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
59
60
61
62
63
64
65
66
67
68
69
<!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}
a{color:#d9230f;text-decoration:none}
a:hover{text-decoration:underline}
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="ch02.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="ch03.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a id="_updating_erlang_mk"></a>Chapter 4. Updating Erlang.mk</h1></div></div></div><p>This chapter describes how to update the <span class="emphasis"><em>erlang.mk</em></span> file
in your repository.</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_initial_bootstrap"></a>4.1. Initial bootstrap</h2></div></div></div><p>The first time you use Erlang.mk, it will bootstrap itself.
It always uses the most recent version for this, so you don’t
have to update after creating your project.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_updating"></a>4.2. Updating</h2></div></div></div><p>Later on though, updating becomes a necessity. Erlang.mk
developers and contributors relentlessly improve the project
and add new features; it would be a waste not to benefit
from this.</p><p>That’s why updating Erlang.mk is so simple. All you need
to do is to call <code class="literal">make erlang-mk</code>:</p><pre class="programlisting">$ make erlang-mk
git clone https://github.com/ninenines/erlang.mk .erlang.mk.build
Cloning into '.erlang.mk.build'...
remote: Counting objects: 4035, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 4035 (delta 8), reused 4 (delta 4), pack-reused 4019
Receiving objects: 100% (4035/4035), 1.10 MiB | 1000.00 KiB/s, done.
Resolving deltas: 100% (2442/2442), done.
Checking connectivity... done.
if [ -f build.config ]; then cp build.config .erlang.mk.build; fi
cd .erlang.mk.build &amp;&amp; make
make[1]: Entering directory '/home/essen/tmp/emkg/hello_joe/.erlang.mk.build'
awk 'FNR==1 &amp;&amp; NR!=1{print ""}1' core/core.mk index/*.mk core/index.mk core/deps.mk plugins/protobuffs.mk core/erlc.mk core/docs.mk core/test.mk plugins/asciidoc.mk plugins/bootstrap.mk plugins/c_src.mk plugins/ci.mk plugins/ct.mk plugins/dialyzer.mk plugins/edoc.mk plugins/elvis.mk plugins/erlydtl.mk plugins/escript.mk plugins/eunit.mk plugins/relx.mk plugins/shell.mk plugins/triq.mk plugins/xref.mk plugins/cover.mk \
    | sed 's/^ERLANG_MK_VERSION = .*/ERLANG_MK_VERSION = 1.2.0-642-gccd2b9f/' &gt; erlang.mk
make[1]: Leaving directory '/home/essen/tmp/emkg/hello_joe/.erlang.mk.build'
cp .erlang.mk.build/erlang.mk ./erlang.mk
rm -rf .erlang.mk.build</pre><p>All that’s left to do is to commit the file!</p><p>Yep, it’s that easy.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_customizing_the_build"></a>4.3. Customizing the build</h2></div></div></div><p>Erlang.mk allows you to customize which plugins are to be included
in the <span class="emphasis"><em>erlang.mk</em></span> file. You can do so by maintaining your own
<span class="emphasis"><em>build.config</em></span> file in your repository. Erlang.mk will automatically
use it the next time you run <code class="literal">make erlang-mk</code>.</p><p>The <span class="emphasis"><em>build.config</em></span> file contains the list of all files that will
be built into the resulting <span class="emphasis"><em>erlang.mk</em></span> file. You can start from
the <a class="ulink" href="https://github.com/ninenines/erlang.mk/blob/master/build.config" target="_top">most recent version</a>
and customize to your needs.</p><p>You can also name the file differently or put it in a separate folder
by modifying the value for <code class="literal">ERLANG_MK_BUILD_CONFIG</code>. You can also
tell Erlang.mk to use a different temporary directory by changing
the <code class="literal">ERLANG_MK_BUILD_DIR</code> variable.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch03.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch05.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>