Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add dialyzer support.

Cross-pollinating from the fork at https://github.com/psym/erlang-irc-bot
  • Loading branch information...
commit 99b4b3d10bb7782041dab2656493e6cd32cac5a4 1 parent 411948b
@gdamjan authored
Showing with 17 additions and 1 deletion.
  1. +1 −0  .gitignore
  2. +16 −1 Makefile
View
1  .gitignore
@@ -2,3 +2,4 @@ settings.cfg
*.beam
ebin/
deps/
+.dialyzer_plt
View
17 Makefile
@@ -7,6 +7,9 @@ ERL_OBJ := $(patsubst src/%.erl,ebin/%.beam,${ERL_SRC})
SRC_SUBDIRS := $(shell find src -type d)
OBJ_SUBDIRS := $(patsubst src%,ebin%,${SRC_SUBDIRS})
+APPS = kernel stdlib sasl erts ssl tools os_mon runtime_tools crypto inets \
+ xmerl webtool snmp public_key mnesia eunit syntax_tools compiler
+COMBO_PLT = .dialyzer_plt
all: compile ebin/ircbot.app
compile: ${OBJ_SUBDIRS} ${ERL_OBJ}
@@ -18,8 +21,20 @@ ebin/%.app: src/%.app.src
cp $< $@
ebin/%.beam: src/%.erl
- erlc -o $(dir $@) $<
+ erlc ${ERLC_FLAGS} -o $(dir $@) $<
+check_plt: compile
+ dialyzer --check_plt --plt $(COMBO_PLT) --apps $(APPS) ebin
+
+build_plt: compile
+ dialyzer --build_plt --output_plt $(COMBO_PLT) --apps $(APPS) ebin
+
+dialyzer: compile
+ @echo Compile with "'make ERLC_FLAGS=+debug_info'" prior to using this target.
+ @echo Use "'make build_plt'" to build PLT prior to using this target.
+ @echo Use "'make check_plt'" to check PLT prior to using this target.
+ @sleep 1
+ dialyzer -Wno_return --plt $(COMBO_PLT) ebin
clean:
rm -rf ebin/
Please sign in to comment.
Something went wrong with that request. Please try again.