Makefile and Erlang

Sean Hinde <>
Tue Jan 30 13:11:53 CET 2001


> Note also that systools:make_tar is primarily intended for
> building a tar file that is used to upgrade an already
> existing system.

It is, and that is a bit of a shame. It is not at all obvious from the docs
that this is the case, and then not at all clear how to create an initial
release which works. I struggled with this for quite some time before
getting help under my commercial support agreement.

Having said that, the tar file created with

systools:make_tar("app1", [{erts, "/home/user/erl5.0.1"}]).

has all the files required for a full installation and I use it all the time
in combination with the Install script attached to my last post to build and
install new installations.

Ach, here goes:

The complete procedure I use is to put all my own apps into a dedicated
build directory like:

Build--myapp-1.0/ebin
      |
      -myapp2-1.3/ebin

In this dir I also put the sys.config I wish to use and the .rel file for
all the applications including the standard ones I wish to include.

"app1.rel" contains e.g:

{release, {"app1 initial build","app1"}, {erts, "5.0.1"},
 [{kernel,"2.6.1.6"},
  {stdlib,"1.9.3"},
  {sasl, "1.9.1"},
  {runtime_tools, "1.1.2"},
  {os_mon, "1.3.9"},
  {snmp, "3.2.1"},
  {mnesia, "3.9.3"},
  {myapp, "1.0"},
  {myapp2, "1.3"}]}.

"sys.config" usefully can have at least this (as my Install creates this dir
for sasl files):

[{sasl, [{error_logger_mf_dir, "/../target_install_dir/sasl_logfiles/"}].

In here I also have a .erlang which looks like:

Myroot = "/opt/erlang/Build/".
code:add_pathz(Myroot++"myapp-1.0/ebin").
code:add_pathz(Myroot++"myapp2-1.3/ebin").

So, after making sure that my two own apps have correct .app files in their
ebin dirs I just run up an erlang shell (the same one containing the desired
versions of the standard apps) then:

1>systoools:make_script("app1").
ok
2>
systools:make_tar("app1", [{erts, "/home/user/erl5.0.1"}]).
ok

If you copy the tar file to your host machine, untar it and run the Install
script you should have something which starts the whole app using

bin/start

run directly from the untar directory.

Then to attach to the shell for this node use:

bin/to_erl

You get some nice error info in the log directory if it fails to start up
(i.e. if there is a problem with startup of any of the included apps it
crashes)

You can also use bin/erl which will use the start.boot in the bin dir
(copied from the erts-5.0.1/bin dir by Install)

This is about as simple as I have managed to make the process and it works
every time for me in my environment (I've never tested it on open source
Erlang - the initial whereabouts of start.src files etc is quite possibly a
bit different).

- Sean



NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list