From 51b5a41c631ea93e6a13befe036f3a13c93e8b3a Mon Sep 17 00:00:00 2001 From: Eric Merritt Date: Mon, 3 Sep 2012 11:33:40 -0500 Subject: [PATCH] add a full makefile that drives rebar Signed-off-by: Jordan Wilberding --- .gitignore | 1 + Makefile | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ rebar.config | 9 +++++++- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/.gitignore b/.gitignore index 4e5856e..65c6b5c 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ doc/*.css doc/edoc-info doc/erlang.png ebin/* +.* _build erl_crash.dump *.pyc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..11948ac --- /dev/null +++ b/Makefile @@ -0,0 +1,64 @@ +# Copyright 2012 Erlware, LLC. All Rights Reserved. +# +# BSD License see COPYING + +ERL = $(shell which erl) + +ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin + +REBAR=$(shell which rebar) + +ifeq ($(REBAR),) +$(error "Rebar not available on this system") +endif + +ERLWARE_COMMONS_PLT=$(CURDIR)/.erlware_commons_plt + +.PHONY: all compile doc clean eunit dialyzer typer shell distclean pdf get-deps escript + +all: compile eunit dialyzer + +get-deps: + $(REBAR) get-deps + $(REBAR) compile + +compile: + $(REBAR) skip_deps=true compile + +doc: compile + $(REBAR) skip_deps=true doc + +eunit: compile + $(REBAR) skip_deps=true eunit + +$(ERLWARE_COMMONS_PLT): + @echo Building local plt at $(ERLWARE_COMMONS_PLT) + @echo + - dialyzer --output_plt $(ERLWARE_COMMONS_PLT) --build_plt \ + --apps erts kernel stdlib -r deps + +dialyzer: $(ERLWARE_COMMONS_PLT) + dialyzer --plt $(ERLWARE_COMMONS_PLT) -Wrace_conditions --src src + +typer: + typer --plt $(ERLWARE_COMMONS_PLT) -r ./src + +shell: compile +# You often want *rebuilt* rebar tests to be available to the +# shell you have to call eunit (to get the tests +# rebuilt). However, eunit runs the tests, which probably +# fails (thats probably why You want them in the shell). This +# runs eunit but tells make to ignore the result. + - @$(REBAR) eunit + @$(ERL) $(ERLFLAGS) + +clean: + $(REBAR) clean + rm $(CURDIR)/doc/*.html + rm $(CURDIR)/doc/*.css + rm $(CURDIR)/doc/*.png + rm $(CURDIR)/doc/edoc-info + +distclean: clean + rm -rf $(ERLWARE_COMMONS_PLT) + rm -rvf $(CURDIR)/deps/* diff --git a/rebar.config b/rebar.config index 27aa310..6b037b1 100644 --- a/rebar.config +++ b/rebar.config @@ -1,3 +1,10 @@ +%% -*- mode: Erlang; fill-column: 80; comment-column: 75; -*- + +%% These are all only compile time dependencies +{deps, [ + {proper, "", {git, "https://github.com/manopapad/proper.git", {branch, master}}} + ]}. + {erl_opts, [debug_info, - warnings_as_errors]}. \ No newline at end of file + warnings_as_errors]}.