Makefile

Vance Shipley vances@REDACTED
Sat Sep 15 01:08:07 CEST 2001


I finally found out what the problem with my Makefile
syntax for building releases was.  I was using:

%.tar.gz:   all %.boot
	erl -noshell -s systools make_tar $* -s erlang halt

With this I kept getting truncated tar files.  The reason
for which seems to be that erlang:halt/0 is a nasty way to
terminate things.  The suggestions I had originally gotten
on how to run something from the Unix command line was to
use the form:

	erl -noshell -s <module> <function> <arglist> -s erlang halt

This was probably the best way at one time but now it seems
the best syntax would be:

	erl -noshell -run <module> <function> <arglist> -run init stop

This allows a graceful shutdown, and gives everything time to 
finish up.  So now my Makefile syntax is:


ERL            = erl
ERLC           = erlc
ERLCFLAGS      = +no_debug_info -W -v

%.beam:%.erl
   $(ERLC) $(ERLCFLAGS) $<

%.boot:%.rel
   $(ERLC) $<

%.tar.gz:   all %.boot
   $(ERL) -noshell -run systools make_tar $* -run init stop

%.bin:%.mib
    $(ERLC) $<


Since this was a thorn in my side for such a long time, and the
list hadn't given me an answer when I originally asked, I thought
I'd share it.

	-Vance


Vance Shipley
Motivity Telecom Inc.
+1 519 579 5816




More information about the erlang-questions mailing list