|
@@ -42,11 +42,17 @@ define filter_opts.erl
|
|
|
halt().
|
|
|
endef
|
|
|
|
|
|
+# DIALYZER_PLT is a variable understood directly by Dialyzer.
|
|
|
+#
|
|
|
+# We append the path to erts at the end of the PLT. This works
|
|
|
+# because the PLT file is in the external term format and the
|
|
|
+# function binary_to_term/1 ignores any trailing data.
|
|
|
$(DIALYZER_PLT): deps app
|
|
|
$(eval DEPS_LOG := $(shell test -f $(ERLANG_MK_TMP)/deps.log && \
|
|
|
while read p; do test -d $$p/ebin && echo $$p/ebin; done <$(ERLANG_MK_TMP)/deps.log))
|
|
|
$(verbose) dialyzer --build_plt $(DIALYZER_PLT_OPTS) --apps \
|
|
|
erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG) || test $$? -eq 2
|
|
|
+ $(verbose) $(ERL) -eval 'io:format("~n~s~n", [code:lib_dir(erts)]), halt().' >> $@
|
|
|
|
|
|
plt: $(DIALYZER_PLT)
|
|
|
|
|
@@ -55,6 +61,11 @@ distclean-plt:
|
|
|
|
|
|
ifneq ($(wildcard $(DIALYZER_PLT)),)
|
|
|
dialyze: $(if $(filter --src,$(DIALYZER_DIRS)),,deps app)
|
|
|
+ $(verbose) if ! tail -n1 $(DIALYZER_PLT) | \
|
|
|
+ grep -q "^`$(ERL) -eval 'io:format("~s", [code:lib_dir(erts)]), halt().'`$$"; then \
|
|
|
+ rm $(DIALYZER_PLT); \
|
|
|
+ $(MAKE) plt; \
|
|
|
+ fi
|
|
|
else
|
|
|
dialyze: $(DIALYZER_PLT)
|
|
|
endif
|