|
@@ -1,6 +1,15 @@
|
|
NAME := epgsql
|
|
NAME := epgsql
|
|
VERSION := $(shell git describe --always --tags)
|
|
VERSION := $(shell git describe --always --tags)
|
|
|
|
|
|
|
|
+ERL := erl
|
|
|
|
+ERLC := erlc
|
|
|
|
+
|
|
|
|
+# ------------------------------------------------------------------------
|
|
|
|
+
|
|
|
|
+ERLC_FLAGS := -Wall -I include +debug_info
|
|
|
|
+
|
|
|
|
+TESTS := $(wildcard test_src/*.erl)
|
|
|
|
+
|
|
all: compile ebin/$(NAME).app
|
|
all: compile ebin/$(NAME).app
|
|
|
|
|
|
compile:
|
|
compile:
|
|
@@ -11,3 +20,15 @@ ebin/%.qpp: src/%.app.src
|
|
|
|
|
|
clean:
|
|
clean:
|
|
rebar clean
|
|
rebar clean
|
|
|
|
+
|
|
|
|
+test: $(TESTS:test_src/%.erl=test_ebin/%.beam) compile
|
|
|
|
+ @dialyzer -n --src -c src
|
|
|
|
+ $(ERL) -config etc/epgsql_test.config -pa ebin/ -pa test_ebin/ -noshell -s pgsql_tests run_tests -s init stop
|
|
|
|
+
|
|
|
|
+# ------------------------------------------------------------------------
|
|
|
|
+
|
|
|
|
+.SUFFIXES: .erl .beam
|
|
|
|
+.PHONY: all compile clean test
|
|
|
|
+
|
|
|
|
+test_ebin/%.beam : test_src/%.erl
|
|
|
|
+ $(ERLC) $(ERLC_FLAGS) -o $(dir $@) $<
|