[erlang-questions] escript lives

Wayne Vucenic nightphotos@REDACTED
Mon Oct 16 23:42:57 CEST 2006


Hi Bengt,

I was able to resolve one of the problem I was seeing.  Since my
goal is to get this working on Windows, I had unzipped the files
on Windows and was working with them there.  When I decided to
try OS X, I copied over the unzipped files.  Instead I now tried
moving over Joe's .tgz file and unzipping it on OS X.  This
fixes the problem I was seeing with mk_escript.sh.  I'm not
sure what the significant difference was, as that file had
the x flag even when copied from Windows.  But I'm still
having some difficulties with trying to make '.beam'.

I start with a new clean extract on OS X of Joe's .tgz file:

Mini:~/erlang/escript-4.0 wayne$ ls -la
total 88
drwx------   11 wayne  wayne   374 Oct 16 13:55 .
drwxr-xr-x   12 wayne  wayne   408 Oct 16 13:54 ..
-rw-------    1 wayne  wayne  6148 Oct 16 13:55 .DS_Store
-rwx------    1 wayne  wayne   545 Oct  5 01:21 Makefile
-rwx------    1 wayne  wayne  5291 Oct  5 01:21 escript.erl
-rwx------    1 wayne  wayne  2736 Oct  5 01:21 escript.html
-rwx------    1 wayne  wayne   396 Oct  5 01:21 factorial
-rwx------    1 wayne  wayne   478 Oct  5 01:21 fibc
-rwx------    1 wayne  wayne   390 Oct  5 01:21 fibi
-rwx------    1 wayne  wayne  3113 Oct  5 01:21 history
-rwx------    1 wayne  wayne   309 Oct  5 01:21 mk_escript.sh
Mini:~/erlang/escript-4.0 wayne$ make
erlc escript.erl
make: *** No rule to make target `.beam', needed by `all'.  Stop.

a .beam file was not created:

Mini:~/erlang/escript-4.0 wayne$ ls -la
total 96
drwx------   12 wayne  wayne   408 Oct 16 13:58 .
drwxr-xr-x   12 wayne  wayne   408 Oct 16 13:54 ..
-rw-------    1 wayne  wayne  6148 Oct 16 13:55 .DS_Store
-rwx------    1 wayne  wayne   545 Oct  5 01:21 Makefile
-rw-r--r--    1 wayne  wayne  4092 Oct 16 13:58 escript.beam
-rwx------    1 wayne  wayne  5291 Oct  5 01:21 escript.erl
-rwx------    1 wayne  wayne  2736 Oct  5 01:21 escript.html
-rwx------    1 wayne  wayne   396 Oct  5 01:21 factorial
-rwx------    1 wayne  wayne   478 Oct  5 01:21 fibc
-rwx------    1 wayne  wayne   390 Oct  5 01:21 fibi
-rwx------    1 wayne  wayne  3113 Oct  5 01:21 history
-rwx------    1 wayne  wayne   309 Oct  5 01:21 mk_escript.sh

changed Makefile to
all:
echo ${BEAM_FILES}
as you suggested:

Mini:~/erlang/escript-4.0 wayne$ make
echo escript.beam .beam
escript.beam .beam

well, that explains what we're seeing.  It correctly makes
escript.beam, then fails to make .beam
changed Makefile to
all: escript.beam escript
to get past this error, and now it works:

Mini:~/erlang/escript-4.0 wayne$ make
./mk_escript.sh
Mini:~/erlang/escript-4.0 wayne$ ./fibc 20
fib 20 = 10946

One fix would be to change the first 3 lines in the Makefile from

MODS = escript
ERL_FILES = $(MODS:=.erl)
BEAM_FILES = $(MODS:=.beam)

to

ERL_FILES = escript.erl
BEAM_FILES = escript.beam

With this one change it all builds correctly.

Thanks,

Wayne

---
Wayne Vucenic
No Bugs Software
Ruby, C#, and Erlang Agile Contract Programming in Silicon Valley



More information about the erlang-questions mailing list