Add support for rebar.

This commit is contained in:
Juan Jose Comellas 2010-09-23 15:08:58 -03:00
parent 58960e6356
commit f539fbbc8a
5 changed files with 40 additions and 29 deletions

View File

@ -1,36 +1,45 @@
PROJECT=getopt
ERL=erl
ERLC=erlc -I include -v -o ebin
SOURCES=src/*.erl
EPATH=-pa ebin
DOC_OPTS={dir, \"doc\"}, {includes, [\"include\"]}, {source_path, [\"include\", \"src\"]}
APPLICATION := getopt
all:
@mkdir -p ebin
@$(ERL) $(EPATH) -make
ERL := erl
EPATH := -pa ebin
TEST_EPATH := -pa .eunit
run: all
$(ERL) -sname "$(PROJECT)" $(EPATH)
DIALYZER=dialyzer
DIALYZER_OPTS=-Wno_return -Wrace_conditions -Wunderspecs -Wbehaviours
PLT_FILE=.getopt_plt
APPS=kernel stdlib
test: all
@$(ERL) -noshell $(EPATH) -s $(PROJECT)_test test -s init stop
.PHONY: all clean test
example: all
@$(ERL) -noshell $(EPATH) -s ex1 test -s init stop
all: compile
docs: all
@$(ERL) -noshell $(EPATH) \
-eval "edoc:files(filelib:wildcard(\"$(SOURCES)\"), [$(DOC_OPTS)])" \
-s init stop
compile:
@./rebar compile
doc:
@./rebar doc
plt: compile
$(DIALYZER) --build_plt --output_plt $(PLT_FILE) --apps $(APPS) ebin
check_plt: compile
$(DIALYZER) --check_plt --plt $(PLT_FILE) --apps $(APPS) ebin
analyze: compile
$(DIALYZER) --plt $(PLT_FILE) $(DIALYZER_OPTS) -r ebin
clean:
rm -fv ebin/*.beam
rm -fv erl_crash.dump ebin/erl_crash.dump
@./rebar clean
distclean:
rm -fv ebin/*.beam
rm -fv doc/*
rm -fv erl_crash.dump ebin/erl_crash.dump
test:
@./rebar eunit
dialyzer:
@./rebar analyze
shell: compile
$(ERL) -sname $(APPLICATION) $(EPATH)
testshell: test
$(ERL) -sname $(APPLICATION)_test $(TEST_EPATH)
docclean:
rm -fv doc/*

View File

@ -20,7 +20,7 @@ To run the unit tests run ``make test``.
To run the example module run ``make example``.
To build the (very) limited documentation run ``make docs``.
To build the (very) limited documentation run ``make doc``.
Usage

View File

@ -2,7 +2,7 @@
{application, getopt,
[{description, "Options parser for Erlang"},
{vsn, "0.1.1"},
{vsn, "0.3.0"},
{modules, [getopt]},
{registered, []},
{applications, [kernel, stdlib]}]}.

BIN
rebar vendored Executable file

Binary file not shown.

2
rebar.config Normal file
View File

@ -0,0 +1,2 @@
{erl_first_files, ["src/getopt.erl"]}.
{erl_opts, [debug_info, fail_on_warning]}.