From 3c84c8a9fca70495fe3ceb22a9de94e175fd7cdc Mon Sep 17 00:00:00 2001 From: Juan Jose Comellas Date: Mon, 5 Oct 2009 17:10:33 -0300 Subject: [PATCH] Use Erlang make module to compile. --- Makefile | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 18b746e..f2b650b 100644 --- a/Makefile +++ b/Makefile @@ -2,25 +2,26 @@ PROJECT=getopt ERL=erl ERLC=erlc -I include -v -o ebin SOURCES=src/*.erl -TEST_SOURCES=src/test/*.erl EPATH=-pa ebin +DOC_OPTS={dir, \"doc\"}, {source_path, [\"include\", \"src\"]} all: @mkdir -p ebin - $(ERLC) $(SOURCES) - -all_test: all - @mkdir -p ebin - $(ERLC) -DTEST $(TEST_SOURCES) - + $(ERL) $(EPATH) -make + run: $(ERL) -sname "$(PROJECT)" $(EPATH) - -test: all_test + +test: all + $(ERL) -noshell $(EPATH) -s $(PROJECT)_test test -s init stop + +edoc: all $(ERL) -noshell $(EPATH) \ - -s $(PROJECT)_test test \ + -eval "edoc:files([string:tokens(\"src/getopt.erl\", \" \")], [$(DOC_OPTS)])" \ -s init stop - + + clean: rm -fv ebin/*.beam + rm -fv doc/* rm -fv erl_crash.dump ebin/erl_crash.dump