aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/xref.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-05-07 11:54:03 +0300
committerLoïc Hoguin <[email protected]>2015-05-07 11:54:23 +0300
commit6df73b9e519d0253bed626f1dc7f6d043533fb02 (patch)
tree58f7e87aac0f399514d7fe55eb2ff10142bd6beb /plugins/xref.mk
parentb970686c2bc9a2c15d7f8e257885bd153c7a8f0d (diff)
parent1a1915f8caab06860a8d14d17c184128dfea9acc (diff)
downloaderlang.mk-6df73b9e519d0253bed626f1dc7f6d043533fb02.tar.gz
erlang.mk-6df73b9e519d0253bed626f1dc7f6d043533fb02.tar.bz2
erlang.mk-6df73b9e519d0253bed626f1dc7f6d043533fb02.zip
Merge branch 'xref_plugin' of https://github.com/inaka/erlang.mk
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..cd1cc64
--- /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)