Add support for rebar.
This commit is contained in:
parent
58960e6356
commit
f539fbbc8a
63
Makefile
63
Makefile
@ -1,36 +1,45 @@
|
|||||||
PROJECT=getopt
|
APPLICATION := 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\"]}
|
|
||||||
|
|
||||||
all:
|
ERL := erl
|
||||||
@mkdir -p ebin
|
EPATH := -pa ebin
|
||||||
@$(ERL) $(EPATH) -make
|
TEST_EPATH := -pa .eunit
|
||||||
|
|
||||||
run: all
|
DIALYZER=dialyzer
|
||||||
$(ERL) -sname "$(PROJECT)" $(EPATH)
|
DIALYZER_OPTS=-Wno_return -Wrace_conditions -Wunderspecs -Wbehaviours
|
||||||
|
PLT_FILE=.getopt_plt
|
||||||
|
APPS=kernel stdlib
|
||||||
|
|
||||||
test: all
|
.PHONY: all clean test
|
||||||
@$(ERL) -noshell $(EPATH) -s $(PROJECT)_test test -s init stop
|
|
||||||
|
|
||||||
example: all
|
all: compile
|
||||||
@$(ERL) -noshell $(EPATH) -s ex1 test -s init stop
|
|
||||||
|
|
||||||
docs: all
|
compile:
|
||||||
@$(ERL) -noshell $(EPATH) \
|
@./rebar compile
|
||||||
-eval "edoc:files(filelib:wildcard(\"$(SOURCES)\"), [$(DOC_OPTS)])" \
|
|
||||||
-s init stop
|
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:
|
clean:
|
||||||
rm -fv ebin/*.beam
|
@./rebar clean
|
||||||
rm -fv erl_crash.dump ebin/erl_crash.dump
|
|
||||||
|
|
||||||
distclean:
|
test:
|
||||||
rm -fv ebin/*.beam
|
@./rebar eunit
|
||||||
rm -fv doc/*
|
|
||||||
rm -fv erl_crash.dump ebin/erl_crash.dump
|
dialyzer:
|
||||||
|
@./rebar analyze
|
||||||
|
|
||||||
|
shell: compile
|
||||||
|
$(ERL) -sname $(APPLICATION) $(EPATH)
|
||||||
|
|
||||||
|
testshell: test
|
||||||
|
$(ERL) -sname $(APPLICATION)_test $(TEST_EPATH)
|
||||||
|
|
||||||
docclean:
|
|
||||||
rm -fv doc/*
|
|
||||||
|
@ -20,7 +20,7 @@ To run the unit tests run ``make test``.
|
|||||||
|
|
||||||
To run the example module run ``make example``.
|
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
|
Usage
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{application, getopt,
|
{application, getopt,
|
||||||
[{description, "Options parser for Erlang"},
|
[{description, "Options parser for Erlang"},
|
||||||
{vsn, "0.1.1"},
|
{vsn, "0.3.0"},
|
||||||
{modules, [getopt]},
|
{modules, [getopt]},
|
||||||
{registered, []},
|
{registered, []},
|
||||||
{applications, [kernel, stdlib]}]}.
|
{applications, [kernel, stdlib]}]}.
|
||||||
|
2
rebar.config
Normal file
2
rebar.config
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
{erl_first_files, ["src/getopt.erl"]}.
|
||||||
|
{erl_opts, [debug_info, fail_on_warning]}.
|
Loading…
x
Reference in New Issue
Block a user