forked from benoitc/lhttpc-old
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve rebar support and fix tests on erlang R14a
- Loading branch information
Showing
9 changed files
with
53 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,6 @@ util/*.beam | |
cover_report/ | ||
test/*.beam | ||
test/*.log | ||
test_ebin/ | ||
logs/ | ||
*.swp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
% -*- mode: erlang -*- | ||
{["src/*"], | ||
[{i, "include"}, | ||
{outdir, "ebin"}, | ||
debug_info] | ||
}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,38 @@ | ||
APPLICATION := lhttpc | ||
APP_FILE := ebin/$(APPLICATION).app | ||
SOURCES := $(wildcard src/*.erl) | ||
HEADERS := $(wildcard src/*.hrl) | ||
MODULES := $(patsubst src/%.erl,%,$(SOURCES)) | ||
BEAMS := $(patsubst %,ebin/%.beam,$(MODULES)) | ||
|
||
comma := , | ||
e := | ||
space := $(e) $(e) | ||
MODULELIST := $(subst $(space),$(comma),$(MODULES)) | ||
|
||
TEST_SOURCES := $(wildcard test/*.erl) | ||
TEST_BEAMS := $(patsubst %.erl,%.beam, $(TEST_SOURCES)) | ||
ERL ?= erl | ||
ERLC ?= erlc | ||
APP := lhttpc | ||
|
||
include vsn.mk | ||
|
||
.PHONY: all clean dialyzer | ||
|
||
all: $(APPLICATION) doc | ||
|
||
$(APPLICATION): $(BEAMS) $(APP_FILE) | ||
|
||
test: $(APPLICATION) $(TEST_BEAMS) util/run_test.beam | ||
@echo Running tests | ||
@erl -pa util/ -pa ebin/ -pa test/ -noinput -s run_test run | ||
|
||
test_shell: $(APPLICATION) $(TEST_BEAMS) | ||
@echo Starting a shell with test paths included | ||
@erl -pa ebin/ -pa test/ | ||
|
||
test/%.beam: test/%.erl | ||
@echo Compiling $< | ||
@erlc +debug_info -o test/ $< | ||
|
||
$(APP_FILE): src/$(APPLICATION).app.src vsn.mk | ||
@echo Generating $@ | ||
@sed -e 's/@MODULES@/$(MODULELIST)/' -e 's/@VSN@/$(VSN)/' $< > $@ | ||
all: doc | ||
@(./rebar compile) | ||
|
||
ebin/%.beam: src/%.erl $(HEADERS) $(filter-out $(wildcard ebin), ebin) | ||
@echo Compiling $< | ||
@erlc +debug_info +warn_missing_spec -o ebin/ $< | ||
|
||
ebin: | ||
@echo Creating ebin/ | ||
@mkdir ebin/ | ||
clean: | ||
@(./rebar clean) | ||
@rm -f test/*.beam doc/*.{html,css,png} doc/edoc-info | ||
@rm -rf cover_report | ||
@rm -f util/*.beam | ||
@rm -rf tests_ebin | ||
|
||
|
||
doc: doc/edoc-info | ||
|
||
dialyzer: | ||
@echo Running dialyzer on sources | ||
@dialyzer --src -r src/ | ||
|
||
doc/edoc-info: doc/overview.edoc $(SOURCES) | ||
@erlc -o util/ util/make_doc.erl | ||
doc/edoc-info: | ||
@$(ERLC) -o util/ util/make_doc.erl | ||
@echo Generating documentation from edoc | ||
@erl -pa util/ -noinput -s make_doc edoc | ||
|
||
util/%.beam: util/%.erl | ||
@erlc -o util/ util/run_test.erl | ||
@$(ERL) -pa util/ -noinput -s make_doc edoc | ||
|
||
clean: | ||
@echo Cleaning | ||
@rm -f ebin/*.{beam,app} test/*.beam doc/*.{html,css,png} doc/edoc-info | ||
@rm -rf cover_report | ||
@rm -f util/*.beam | ||
test: all | ||
@$(ERLC) -o util/ util/run_test.erl | ||
@echo Running tests | ||
@mkdir -p test_ebin | ||
@cd test;$(ERL) -make | ||
@$(ERL) -noshell -pa util/ -pa ebin -pa test_ebin -noinput -s run_test run | ||
|
||
release: clean all test dialyzer | ||
@util/releaser $(APPLICATION) $(VSN) | ||
@util/releaser $(APP) $(VSN) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
%%-*- mode: erlang -*- | ||
{fail_on_warning, true}. | ||
{cover_enabled, true}. | ||
{erl_opts, [debug_info]}. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{"*", [warn_obsolete_guard, warn_unused_import, | ||
warn_shadow_vars, warn_export_vars, debug_info, | ||
{i, "../include"}, | ||
{outdir, "../test_ebin"}]}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters