Erlang Mailing Lists

Author Message

<  Erlang questions mailing list  ~  systools and scripts

dustin at spy.net
Posted: Thu May 06, 2004 5:40 am Reply with quote
Guest
I'm trying to use a makefile to build my application, but I can't
figure out how to run systools from the erl commandline. I want to run
the following command:

systools:make_script("environ", [local]).

...but I can't seem to express that.


I've just added another module to my build system that creates the
.boot and the .tar.gz, but is this necessary?

--
SPY My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin_at_spy.net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________



Post generated using Mail2Forum (http://m2f.sourceforge.net)
mikael.karlsson at creado
Posted: Thu May 06, 2004 6:16 am Reply with quote
Guest
Starting with erl -s or erl -run makes it possible to pass
arguments as atoms or lists. So in your case I guess you
would have to write some "glue" module that takes only
atoms (or strings) and pass them on to the make_script
with right types:

erl -pa `pwd` -s mygluemodule make_script environ local -s erlang halt

Or is there a better way?

/Mikael

torsdag 06 maj 2004 07:40 skrev Dustin Sallings:
> I'm trying to use a makefile to build my application, but I can't
> figure out how to run systools from the erl commandline. I want to run
> the following command:
>
> systools:make_script("environ", [local]).
>
> ...but I can't seem to express that.
>
>
> I've just added another module to my build system that creates the
> .boot and the .tar.gz, but is this necessary?
>
> --
> SPY My girlfriend asked me which one I like better.
> pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin_at_spy.net>
>
> | Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
>
> L_______________________ I hope the answer won't upset her. ____________


Post generated using Mail2Forum (http://m2f.sourceforge.net)
dustin at spy.net
Posted: Thu May 06, 2004 6:51 am Reply with quote
Guest
On May 5, 2004, at 22:27, Mikael Karlsson wrote:

> erl -pa `pwd` -s mygluemodule make_script environ local -s erlang
> halt
>
> Or is there a better way?

That's pretty much what I did. It just seems unnecessary.

--
SPY My girlfriend asked me which one I like better.
pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin_at_spy.net>
| Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
L_______________________ I hope the answer won't upset her. ____________



Post generated using Mail2Forum (http://m2f.sourceforge.net)
mikael.karlsson at creado
Posted: Thu May 06, 2004 7:46 am Reply with quote
Guest
Have you checked the builder program.
Qoute from from doc:
>>
This program compiles .rel, .script, .boot and sys.config files for erlang
applications. It supports incremental and recursive builds, and is intended
to be (much) easier and safer to use than doing it all manually.
<<
It can be checked out from the jungerl project at sourceforge.net

Otherwise Joes old ermake might be handy:
http://www.erlang.org/user.html#ermake-2.0

Thu 06 maj 2004 08:50, Dustin Sallings:
> On May 5, 2004, at 22:27, Mikael Karlsson wrote:
> > erl -pa `pwd` -s mygluemodule make_script environ local -s erlang
> > halt
> >
> > Or is there a better way?
>
> That's pretty much what I did. It just seems unnecessary.
>



Post generated using Mail2Forum (http://m2f.sourceforge.net)
peter at erix.ericsson.se
Posted: Thu May 06, 2004 1:50 pm Reply with quote
Guest
There is a module `target_system.erl' listed in the `System Principles'
User's Guide. That module might be handy.

/Peter

> Have you checked the builder program.
> Qoute from from doc:
> >>
> This program compiles .rel, .script, .boot and sys.config files for erlang
> applications. It supports incremental and recursive builds, and is intended
> to be (much) easier and safer to use than doing it all manually.
> <<
> It can be checked out from the jungerl project at sourceforge.net
>
> Otherwise Joes old ermake might be handy:
> http://www.erlang.org/user.html#ermake-2.0
>
> Thu 06 maj 2004 08:50, Dustin Sallings:
> > On May 5, 2004, at 22:27, Mikael Karlsson wrote:
> > > erl -pa `pwd` -s mygluemodule make_script environ local -s erlang
> > > halt
> > >
> > > Or is there a better way?
> >
> > That's pretty much what I did. It just seems unnecessary.
> >
>



Post generated using Mail2Forum (http://m2f.sourceforge.net)
vances at motivity.ca
Posted: Thu May 06, 2004 5:23 pm Reply with quote
Guest
Dustin,

Here's what I use in my make files. The erlc program recognizes
.rel files and builds .boot files automatically.

-Vance


ERLC = erlc
ERLCFLAGS = +no_debug_info +warn_unused_vars -W -v
EMULATOR = beam

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

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



Post generated using Mail2Forum (http://m2f.sourceforge.net)
dustin at spy.net
Posted: Thu May 06, 2004 6:20 pm Reply with quote
Guest
On May 6, 2004, at 10:23, Vance Shipley wrote:

> Here's what I use in my make files. The erlc program recognizes
> .rel files and builds .boot files automatically.

Oh, excellent. Your makefile sample got rid of a whole module for me.
Thanks!

--
Dustin Sallings



Post generated using Mail2Forum (http://m2f.sourceforge.net)
mlogan at futuresource.co
Posted: Fri May 07, 2004 3:58 pm Reply with quote
Guest
I wrote the following function that will apply any function from the
command line.


%%--------------------------------------------------------------------
%% _at_doc Allows any function to be called from the command line via erl
-s
%% all arguments should be passed in the following manner:
%% erl -s mod func "arg1. " "arg2. "...
%% <pre>
%% Variables:
%% MFSList - a list containing the mod func and a list of args to apply
comming via erl -s
%%
%% Types:
%% MFAList = [Mod, Func|Args] Example [file, list_dir, '"/var/log". ']
%%
%% Example Invocation:
%% erl -pz ../ebin/ -s fs_lib s_apply io format ""hello ~p". "
"[world]. "
%%
%% </pre>
%% _at_spec s_apply(MFAList) -> void()
%% _at_end
%%--------------------------------------------------------------------
s_apply([Mod, Func|Args]) ->
io:format("fs_lib:s_apply args before parsing: ~w~n", [Args]),
TokedArgs = lists:map(fun(ArgAtom) ->
{ok, Toks, Line} =
erl_scan:string(atom_to_list(ArgAtom), 1),
{ok, Term} =
erl_parse:parse_term(Toks),
Term
end, Args),
io:format("apply the following: apply(~w, ~w, ~p)~n", [Mod, Func,
TokedArgs]),
apply(Mod, Func, TokedArgs).


so to run this function from the command line for a function like

io:format("hello ~p~n", [world]).

you would invoke

erl -pz ../ebin/ -s fs_lib s_apply io format ""hello ~p". "
"[world]. "

notice that all the arguments for the function that you want applied are
strings containing terms. The containing strings are terminated with a
.<space? see the docs for erl_scan and erl_parse for an explaination.
Make sure that you properly escape any of the terms contained by the
strings.

Cheers,
Martin




On Thu, 2004-05-06 at 00:40, Dustin Sallings wrote:
> I'm trying to use a makefile to build my application, but I can't
> figure out how to run systools from the erl commandline. I want to run
> the following command:
>
> systools:make_script("environ", [local]).
>
> ...but I can't seem to express that.
>
>
> I've just added another module to my build system that creates the
> .boot and the .tar.gz, but is this necessary?
>
> --
> SPY My girlfriend asked me which one I like better.
> pub 1024/3CAE01D5 1994/11/03 Dustin Sallings <dustin_at_spy.net>
> | Key fingerprint = 87 02 57 08 02 D0 DA D6 C8 0F 3E 65 51 98 D8 BE
> L_______________________ I hope the answer won't upset her. ____________



Post generated using Mail2Forum (http://m2f.sourceforge.net)
wuji
Posted: Sat Aug 11, 2012 1:45 am Reply with quote
User Joined: 10 Aug 2012 Posts: 654
tate with roughly the same population as the city of of cheap polo shirts of San Antonio, has been a momentum-setter in presidential elections
nearly a century.While Iowa has held its caucus before New New [h4]red bottom shoes[/h4] New Hampshire's primary every year since 1972, Iowa's caucus results
non-binding and delegates are not officially awarded until June, making making cheap designer *beep* making New Hampshire the first state to award delegates in
presidential nominating cycle.Since its first-in-the-nation status became official more than than cheap Christian Louboutin than 30 years ago, only two Republican presidential candidates have
in New Hampshire and gone on to win the nomination.With nomination.With Christian Louboutin Outlet nomination.With Mitt Romney taking a narrow win in Iowa and
a
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum