[thrift] adding dialyzer to erlang library Makefile

Summary: ... because static analysis can find bugs

Reviewed By: cpiro

Test Plan: cd src ; make dialyzer -j
     gape in awe at errors

Revert Plan: sure


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665523 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/erl/src/Makefile b/lib/erl/src/Makefile
index 452cfee..32b7395 100644
--- a/lib/erl/src/Makefile
+++ b/lib/erl/src/Makefile
@@ -52,7 +52,8 @@
 # ----------------------------------------------------
 
 ERL_FLAGS +=
-ERL_COMPILE_FLAGS += -I../include -I../../fslib/include -I../../system_status/include
+ERL_INCLUDE = -I../include -I../../fslib/include -I../../system_status/include
+ERL_COMPILE_FLAGS += $(ERL_INCLUDE)
 
 # ----------------------------------------------------
 # Targets
@@ -75,6 +76,9 @@
 $(EBIN):
 	mkdir $(EBIN)
 
+dialyzer: $(TARGET_FILES)
+	dialyzer --src -r . $(ERL_INCLUDE)
+
 # ----------------------------------------------------
 # Special Build Targets
 # ----------------------------------------------------