aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEuen <[email protected]>2015-03-17 18:45:32 -0300
committerEuen <[email protected]>2015-03-18 12:28:49 -0300
commit5451df8416d89c42c30fd4d72eb0654cccbeff7f (patch)
tree126e68a3eb289f26c1e4c1f705e1db05ea39d259
parentb23a88ada3ad9d38bdc90c1f080fd1ffe396703b (diff)
downloaderlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.tar.gz
erlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.tar.bz2
erlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.zip
add as a plugin
-rw-r--r--build.config1
-rw-r--r--erlang.mk39
-rw-r--r--plugins/xref.mk38
3 files changed, 78 insertions, 0 deletions
diff --git a/build.config b/build.config
index 7e60d80..7b75a8f 100644
--- a/build.config
+++ b/build.config
@@ -22,3 +22,4 @@ plugins/eunit
plugins/relx
plugins/shell
plugins/triq
+plugins/xref \ No newline at end of file
diff --git a/erlang.mk b/erlang.mk
index e6833bc..22d925b 100644
--- a/erlang.mk
+++ b/erlang.mk
@@ -1273,3 +1273,42 @@ triq: test-build
$(gen_verbose) $(call triq_run,[true] =:= lists:usort([triq:check(M) || M <- [$(MODULES)]]))
endif
endif
+
+# Copyright (c) 2015, Euen Lopez <[email protected]>
+# This file is part of erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: xref distclean-xref
+
+# Configuration.
+
+ifeq ($(XREF_CONFIG),)
+ XREF_ARGS :=
+else
+ XREF_ARGS := -c $(XREF_CONFIG)
+endif
+
+XREFR ?= $(CURDIR)/xrefr
+export XREFR
+
+XREFR_URL ?= https://github.com/inaka/xref_runner/releases/download/0.2.0/xrefr
+
+# Core targets.
+
+help::
+ @printf "%s\n" "" \
+ "Xref targets:" \
+ " xref Run Xrefr using $XREF_CONFIG as config file if defined"
+
+distclean:: distclean-xref
+
+# Plugin-specific targets.
+
+$(XREFR):
+ @$(call core_http_get,$(XREFR),$(XREFR_URL))
+ @chmod +x $(XREFR)
+
+xref: deps app $(XREFR)
+ $(gen_verbose) $(XREFR) $(XREFR_ARGS)
+
+distclean-xref:
+ $(gen_verbose) rm -rf $(XREFR)
diff --git a/plugins/xref.mk b/plugins/xref.mk
new file mode 100644
index 0000000..14ef16e
--- /dev/null
+++ b/plugins/xref.mk
@@ -0,0 +1,38 @@
+# Copyright (c) 2015, Euen Lopez <[email protected]>
+# This file is part of erlang.mk and subject to the terms of the ISC License.
+
+.PHONY: xref distclean-xref
+
+# Configuration.
+
+ifeq ($(XREF_CONFIG),)
+ XREF_ARGS :=
+else
+ XREF_ARGS := -c $(XREF_CONFIG)
+endif
+
+XREFR ?= $(CURDIR)/xrefr
+export XREFR
+
+XREFR_URL ?= https://github.com/inaka/xref_runner/releases/download/0.2.0/xrefr
+
+# Core targets.
+
+help::
+ @printf "%s\n" "" \
+ "Xref targets:" \
+ " xref Run Xrefr using $XREF_CONFIG as config file if defined"
+
+distclean:: distclean-xref
+
+# Plugin-specific targets.
+
+$(XREFR):
+ @$(call core_http_get,$(XREFR),$(XREFR_URL))
+ @chmod +x $(XREFR)
+
+xref: deps app $(XREFR)
+ $(gen_verbose) $(XREFR) $(XREFR_ARGS)
+
+distclean-xref:
+ $(gen_verbose) rm -rf $(XREFR) \ No newline at end of file