xref.mk 789 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Copyright (c) 2015, Erlang Solutions Ltd.
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: xref distclean-xref
  4. # Configuration.
  5. ifeq ($(XREF_CONFIG),)
  6. XREF_ARGS :=
  7. else
  8. XREF_ARGS := -c $(XREF_CONFIG)
  9. endif
  10. XREFR ?= $(CURDIR)/xrefr
  11. export XREFR
  12. XREFR_URL ?= https://github.com/inaka/xref_runner/releases/download/0.2.2/xrefr
  13. # Core targets.
  14. help::
  15. $(verbose) printf "%s\n" "" \
  16. "Xref targets:" \
  17. " xref Run Xrefr using $XREF_CONFIG as config file if defined"
  18. distclean:: distclean-xref
  19. # Plugin-specific targets.
  20. $(XREFR):
  21. $(gen_verbose) $(call core_http_get,$(XREFR),$(XREFR_URL))
  22. $(verbose) chmod +x $(XREFR)
  23. xref: deps app $(XREFR)
  24. $(gen_verbose) $(XREFR) $(XREFR_ARGS)
  25. distclean-xref:
  26. $(gen_verbose) rm -rf $(XREFR)