diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | generate_app | 6 |
2 files changed, 4 insertions, 4 deletions
@@ -94,7 +94,7 @@ $(DEPS_FILE): $(SOURCES) $(INCLUDES) echo $(subst : ,:,$(foreach FILE,$^,$(FILE):)) | escript generate_deps $@ $(EBIN_DIR) $(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(SOURCES) generate_app - escript generate_app $@ $(SOURCE_DIR) < $< + escript generate_app $< $@ $(SOURCE_DIR) $(EBIN_DIR)/%.beam: $(SOURCE_DIR)/%.erl | $(DEPS_FILE) erlc $(ERLC_OPTS) -pa $(EBIN_DIR) $< diff --git a/generate_app b/generate_app index d8813542..fb0eb1ea 100644 --- a/generate_app +++ b/generate_app @@ -1,16 +1,16 @@ #!/usr/bin/env escript %% -*- erlang -*- -main([TargetFile | SrcDirs]) -> +main([InFile, OutFile | SrcDirs]) -> Modules = [list_to_atom(filename:basename(F, ".erl")) || SrcDir <- SrcDirs, F <- filelib:wildcard("*.erl", SrcDir)], - {ok, {application, Application, Properties}} = io:read(''), + {ok, [{application, Application, Properties}]} = file:consult(InFile), NewProperties = case proplists:get_value(modules, Properties) of [] -> lists:keyreplace(modules, 1, Properties, {modules, Modules}); _ -> Properties end, file:write_file( - TargetFile, + OutFile, io_lib:format("~p.~n", [{application, Application, NewProperties}])). |