Makefile and generate_deps now more robust.

This commit is contained in:
Jerry Kuch 2010-11-11 16:10:13 +00:00
parent ad796f87f1
commit 5481193791
2 changed files with 5 additions and 4 deletions

View File

@ -93,8 +93,7 @@ all: $(TARGETS)
$(DEPS_FILE): $(SOURCES) $(INCLUDES)
rm -f $@
echo $(INCLUDES)
# echo $(SOURCES) $(INCLUDES) | escript generate_deps $@ $(EBIN_DIR)
echo $(foreach FILE,$^,$(FILE):) | escript generate_deps $@ $(EBIN_DIR)
$(EBIN_DIR)/rabbit.app: $(EBIN_DIR)/rabbit_app.in $(BEAM_TARGETS) generate_app
escript generate_app $(EBIN_DIR) $@ < $<

View File

@ -2,9 +2,11 @@
%% -*- erlang -*-
-mode(compile).
%% We expect the list of Erlang source and header files to arrive on stdin
%% We expect the list of Erlang source and header files to arrive on
%% stdin, with the entries colon-separated.
main([TargetFile, EbinDir]) ->
ErlsAndHrls = string:tokens(io:get_line(""), ":\n"),
ErlsAndHrls = [ string:strip(S,left) ||
S <- string:tokens(io:get_line(""), ":\n")],
ErlFiles = [F || F <- ErlsAndHrls, lists:suffix(".erl", F)],
Modules = sets:from_list(
[list_to_atom(filename:basename(FileName, ".erl")) ||