Makefile and Erlang
Alexis Le-Quoc
alexis@REDACTED
Tue Jan 30 03:27:46 CET 2001
Thank you Sean and Vance for your most helpful answers. The erlang
community is great!
I've read and read and read again the documentation about make_script and
make_tar. I've furthered my understanding a bit and I'd like to ask the
experts if the following is possible.
I've packaged my app in app1.tar.gz but a closer look at the start.script
makes me think that all paths are defined relative to $ROOT. I infer that
$ROOT is set by the 'erl' script and cannot be changed at run-time. I'd
like to change that path to something I choose.
The {variable, [{"TEST", "some_path"]} and {path, [...]} in
systools:make_script/2 put a $TEST in the boot script. Then, I un-tarred
the file to some place and ran:
erl -boot_var TEST `pwd`/lib -boot `pwd`/releases/1/start but it crashes
the VM, since it can't find the code. I set TEST to `pwd`/lib because the
$TEST variable appears followed by myapp-vsn/ebin in the script. To no
avail. I also tried to set TEST to the directory where I un-tarred
the package; it did not work either.
I took a look at the Install script that you sent and I'd like, for
testing purposes, not to copy the erl/erlc to the new directory. This
problem, overall, looks a bit like the classical java "CLASSPATH not set"
problem.
Maybe I should look into the code_server / loader documentation to clarify
this issue.
Alexis
On Mon, 29 Jan 2001, Sean Hinde wrote:
> Alexis,
>
> A few things which might be of use..
>
> After untarring you need to also move some files around and set up some
> paths in other files.
>
> The Install shell script embedded in the depths of the open source
> distribution (erts/etc/unix) can be used for this (it does all sorts of
> stuff including building start.boot files etc). I also attach my version
> which is somewhat cut down from the full one but deals with a few other
> things like setting up the IP address in my SNMP config files etc.
>
> It also uses start.src from this directory which you can edit beforehand to
> add any other fixed options you want such as -embedded etc
>
> Usage is
>
> ./Install erl-root-dir release-vsn rel-file node-name
>
> So for your case I guess it would be something like
> ./Install /home/otpuser../ 1 app1 nodename
>
> If it doesn't run straight away in your environment it should give you some
> idea of the sorts of things you need to do
>
> Good luck,
>
> Sean
>
> > -----Original Message-----
> > From: Alexis Le-Quoc [mailto:alexis@REDACTED]
> > Sent: 27 January 2001 01:35
> > To: erlang-questions@REDACTED
> > Subject: Makefile and Erlang
> >
> >
> > Hello,
> >
> > First of all, let me state the obvious, the more I use
> > Erlang, the more
> > impressed I am! I've been fiddling with the release tools and
> > I find them
> > absolutely useful.
> >
> > I'm stumbling on two problems:
> >
> > 1) I wrote a Makefile (for GNU make) which is about 3 lines long:
> > all:
> > erl -noinput -make
> > echo "systools:make_tar(app1)." | erl -noshell
> >
> > The third line obviously never returns but produces the
> > expected .tar.gz.
> >
> > It looks like:
> > lib/app-1/...
> > lib/kernel-.../...
> > lib/sasl-.../...
> > lib/stdlib-.../...
> > releases/1/start.boot
> >
> > 2) Once I have that tarball, I un-tar it to my_directory and do a cd
> > my_directory. Then I try erl -boot releases/1/start but it
> > crashes since I
> > suspect it does not find the appropriate *.beam files. I'm missing
> > something here. Is is the {path, Path} trick in the .rel file?
> >
> > Thank you,
> >
> > -- Alexis
> >
More information about the erlang-questions
mailing list