summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Sackman <matthew@lshift.net>2009-10-30 12:02:51 +0000
committerMatthew Sackman <matthew@lshift.net>2009-10-30 12:02:51 +0000
commit79f0d28ffd22f72dea5c392633181cc2b2eb3e34 (patch)
treec1bf97f2209052055cafb32b987d8b732f26de27
parent3394efabb87ad14d20a8df7bd681345658594e09 (diff)
downloadrabbitmq-server-git-79f0d28ffd22f72dea5c392633181cc2b2eb3e34.tar.gz
Added destination file, and lifted the code from rabbit_misc:write_term_file (though with ~p, not ~w)
-rw-r--r--Makefile2
-rw-r--r--generate_app6
2 files changed, 5 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ad0316fcd8..132a7c19f1 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ ERL_EBIN=erl -noinput -pa $(EBIN_DIR)
all: $(TARGETS)
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
- escript generate_app $(EBIN_DIR) < $< > $@
+ escript generate_app $(EBIN_DIR) $@ < $<
$(EBIN_DIR)/gen_server2.beam: $(SOURCE_DIR)/gen_server2.erl
erlc $(ERLC_OPTS) $<
diff --git a/generate_app b/generate_app
index 623012927e..5c15358a9e 100644
--- a/generate_app
+++ b/generate_app
@@ -1,10 +1,12 @@
#!/usr/bin/env escript
%% -*- erlang -*-
-main([BeamDir]) ->
+main([BeamDir, TargetFile]) ->
Modules = [list_to_atom(filename:basename(F, ".beam")) ||
F <- filelib:wildcard("*.beam", BeamDir)],
{ok, {application, Application, Properties}} = io:read(''),
NewProperties = lists:keyreplace(modules, 1, Properties,
{modules, Modules}),
- io:format("~p.", [{application, Application, NewProperties}]).
+ file:write_file(TargetFile, io_lib:format("~p.~n", [{application,
+ Application,
+ NewProperties}])).