aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/xref.mk
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 /plugins/xref.mk
parentb23a88ada3ad9d38bdc90c1f080fd1ffe396703b (diff)
downloaderlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.tar.gz
erlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.tar.bz2
erlang.mk-5451df8416d89c42c30fd4d72eb0654cccbeff7f.zip
add as a plugin
Diffstat (limited to 'plugins/xref.mk')
-rw-r--r--plugins/xref.mk38
1 files changed, 38 insertions, 0 deletions
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