From d20989e722c50afea4ed510f372bbbd9221b9048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 17 Jan 2013 16:46:59 +0100 Subject: Do not require rebar to build Ranch All is done in the Makefile, like with Cowboy. --- Makefile | 53 ++++++++++++++++++++++++++++++++++------------------- cover.spec | 1 - rebar.config | 6 ------ rebar.tests.config | 4 ---- test/cover.spec | 1 + 5 files changed, 35 insertions(+), 30 deletions(-) delete mode 100644 cover.spec delete mode 100644 rebar.config delete mode 100644 rebar.tests.config create mode 100644 test/cover.spec diff --git a/Makefile b/Makefile index fd627e2..16ddee3 100644 --- a/Makefile +++ b/Makefile @@ -1,27 +1,40 @@ # See LICENSE for licensing information. PROJECT = ranch +ERLC_OPTS = -Werror +debug_info +warn_export_all # +bin_opt_info +warn_missing_spec -DIALYZER = dialyzer -REBAR = rebar +DEPS_DIR ?= $(CURDIR)/deps +export DEPS_DIR -all: app +.PHONY: all clean-all app clean docs clean-docs tests build-plt dialyze # Application. -deps: - @$(REBAR) get-deps +all: app + +clean-all: clean clean-docs + rm -f .$(PROJECT).plt + rm -rf $(DEPS_DIR) logs -app: deps - @$(REBAR) compile +MODULES = $(shell ls src/*.erl | sed 's/src\///;s/\.erl/,/' | sed '$$s/.$$//') + +app: + @mkdir -p ebin/ + @cat src/$(PROJECT).app.src \ + | sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \ + > ebin/$(PROJECT).app + erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ \ + src/$(PROJECT)_transport.erl src/*.erl clean: - @$(REBAR) clean + rm -rf ebin/ rm -f test/*.beam rm -f erl_crash.dump +# Documentation. + docs: clean-docs - @$(REBAR) doc skip_deps=true + erl -noshell -eval 'edoc:application($(PROJECT), ".", []), init:stop().' clean-docs: rm -f doc/*.css @@ -31,20 +44,22 @@ clean-docs: # Tests. -tests: clean app eunit ct - -eunit: - @$(REBAR) -C rebar.tests.config eunit skip_deps=true +CT_RUN = ct_run \ + -pa ebin $(DEPS_DIR)/*/ebin \ + -dir test \ + -logdir logs \ + -cover test/cover.spec -ct: - @$(REBAR) -C rebar.tests.config ct skip_deps=true +tests: clean app + @mkdir -p logs/ + @$(CT_RUN) -suite acceptor_SUITE # Dialyzer. -build-plt: - @$(DIALYZER) --build_plt --output_plt .$(PROJECT).plt \ - --apps kernel stdlib sasl tools inets crypto public_key ssl +build-plt: app + @dialyzer --build_plt --output_plt .$(PROJECT).plt \ + --apps erts kernel stdlib crypto public_key ssl dialyze: - @$(DIALYZER) --src src --plt .$(PROJECT).plt \ + @dialyzer --src src --plt .$(PROJECT).plt \ -Werror_handling -Wrace_conditions -Wunmatched_returns # -Wunderspecs diff --git a/cover.spec b/cover.spec deleted file mode 100644 index 13c52ba..0000000 --- a/cover.spec +++ /dev/null @@ -1 +0,0 @@ -{incl_app, ranch, details}. diff --git a/rebar.config b/rebar.config deleted file mode 100644 index ef0f6ed..0000000 --- a/rebar.config +++ /dev/null @@ -1,6 +0,0 @@ -{erl_opts, [ -%% bin_opt_info, -%% warn_missing_spec, - warnings_as_errors, - warn_export_all -]}. diff --git a/rebar.tests.config b/rebar.tests.config deleted file mode 100644 index 9fbc6af..0000000 --- a/rebar.tests.config +++ /dev/null @@ -1,4 +0,0 @@ -{cover_enabled, true}. -{deps, []}. -{eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "."}]}}]}. -{erl_opts, []}. diff --git a/test/cover.spec b/test/cover.spec new file mode 100644 index 0000000..13c52ba --- /dev/null +++ b/test/cover.spec @@ -0,0 +1 @@ +{incl_app, ranch, details}. -- cgit v1.2.3